diff options
-rw-r--r-- | ui/qt5/intropage.cc | 5 | ||||
-rw-r--r-- | ui/qt5/partitionmanualpage.cc | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/ui/qt5/intropage.cc b/ui/qt5/intropage.cc index 94e222d..d0189e7 100644 --- a/ui/qt5/intropage.cc +++ b/ui/qt5/intropage.cc @@ -56,6 +56,11 @@ IntroPage::IntroPage(QWidget *parent) : HorizonWizardPage(parent) { connect(toolMenu->addAction("&Partition Editor"), &QAction::triggered, [=](void) { QProcess *p = new QProcess(this); p->start("sudo", {"/usr/bin/partitionmanager"}); + p->waitForStarted(); + if(p->error() == QProcess::FailedToStart) { + // We may be on the -inst CD that has no sudo and runs as root. + p->start("/usr/bin/partitionmanager"); + } horizonWizard()->tools.push_back(p); }); connect(toolMenu->addAction("&Web Browser"), &QAction::triggered, [=](void){ diff --git a/ui/qt5/partitionmanualpage.cc b/ui/qt5/partitionmanualpage.cc index b9c2d55..28329bc 100644 --- a/ui/qt5/partitionmanualpage.cc +++ b/ui/qt5/partitionmanualpage.cc @@ -39,6 +39,11 @@ PartitionManualPage::PartitionManualPage(QWidget *parent) connect(button, &QPushButton::clicked, [=]{ QProcess p; p.execute("sudo", {"/usr/bin/partitionmanager"}); + p.waitForStarted(); + if(p.error() == QProcess::FailedToStart) { + // We may be on the -inst CD that has no sudo and runs as root. + p.start("/usr/bin/partitionmanager"); + } }); layout->addStretch(); layout->addWidget(button, 0, Qt::AlignCenter); |