Merge pull request #14000 from spowelljr/macPathing
GUI: Add `/usr/local/bin` to `PATH` env on Macpull/14008/head
commit
57ecdfd1f8
|
@ -82,6 +82,7 @@
|
|||
#include <QDir>
|
||||
#include <QFontDialog>
|
||||
#include <QStackedWidget>
|
||||
#include <QProcessEnvironment>
|
||||
|
||||
#ifndef QT_NO_TERMWIDGET
|
||||
#include <QApplication>
|
||||
|
@ -116,6 +117,14 @@ Window::Window()
|
|||
setWindowIcon(*trayIconIcon);
|
||||
}
|
||||
|
||||
QProcessEnvironment Window::setMacEnv()
|
||||
{
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
QString path = env.value("PATH");
|
||||
env.insert("PATH", path + ":/usr/local/bin");
|
||||
return env;
|
||||
}
|
||||
|
||||
void Window::createBasicView()
|
||||
{
|
||||
basicStartButton = new QPushButton(tr("Start"));
|
||||
|
@ -523,6 +532,12 @@ bool Window::sendMinikubeCommand(QStringList cmds, QString &text)
|
|||
arguments << cmds;
|
||||
|
||||
QProcess *process = new QProcess(this);
|
||||
#if __APPLE__
|
||||
if (env.isEmpty()) {
|
||||
env = setMacEnv();
|
||||
}
|
||||
process->setProcessEnvironment(env);
|
||||
#endif
|
||||
process->start(program, arguments);
|
||||
this->setCursor(Qt::WaitCursor);
|
||||
bool timedOut = process->waitForFinished(300 * 1000);
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
#include <QSystemTrayIcon>
|
||||
#include <QFormLayout>
|
||||
#include <QStackedWidget>
|
||||
#include <QProcessEnvironment>
|
||||
|
||||
#ifndef QT_NO_SYSTEMTRAYICON
|
||||
|
||||
|
@ -166,12 +167,14 @@ private:
|
|||
void dashboardBrowser();
|
||||
Cluster createClusterObject(QJsonObject obj);
|
||||
QProcess *dashboardProcess;
|
||||
QProcessEnvironment env;
|
||||
|
||||
// Error messaging
|
||||
void outputFailedStart(QString text);
|
||||
QLabel *createLabel(QString title, QString text, QFormLayout *form, bool isLink);
|
||||
|
||||
void checkForMinikube();
|
||||
QProcessEnvironment setMacEnv();
|
||||
QStackedWidget *stackedWidget;
|
||||
bool isBasicView;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue