From 704e0b72e628ff136f1246921eca71dab00e2639 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Fri, 8 Nov 2019 20:33:24 -0600 Subject: Qt UI: Implement UI.Intro.Tools --- ui/qt5/intropage.cc | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'ui/qt5/intropage.cc') diff --git a/ui/qt5/intropage.cc b/ui/qt5/intropage.cc index 6284ba1..29bec11 100644 --- a/ui/qt5/intropage.cc +++ b/ui/qt5/intropage.cc @@ -1,6 +1,10 @@ #include "intropage.hh" #include +#ifdef HAS_INSTALL_ENV +#include +#include +#endif /* HAS_INSTALL_ENV */ #include IntroPage::IntroPage(QWidget *parent) : HorizonWizardPage(parent) { @@ -32,7 +36,24 @@ IntroPage::IntroPage(QWidget *parent) : HorizonWizardPage(parent) { "Internet.")); descLabel->setOpenExternalLinks(true); descLabel->setTextFormat(Qt::RichText); -#else +#else /* HAS_INSTALL_ENV */ + QMenu *toolMenu; + toolButton = new QPushButton(tr("Launch &Tool..."), this); + toolMenu = new QMenu("&Tools", toolButton); + connect(toolMenu->addAction("&Terminal"), &QAction::triggered, [=](void) { + QProcess p; + p.execute("xterm", {"-fa", "Liberation Mono", "-fs", "12"}); + }); + connect(toolMenu->addAction("&Partition Editor"), &QAction::triggered, [=](void) { + QProcess p; + p.execute("partitionmanager"); + }); + /*connect(toolMenu->addAction("&Web Browser"), &QAction::triggered, [=](void){ + QProcess p; + p.execute("otter-browser"); + });*/ + toolButton->setMenu(toolMenu); + descLabel = new QLabel( tr("Thank you for choosing the Adélie Linux operating system. " "This installation process will only take about 10-15 minutes of your time. " @@ -46,11 +67,15 @@ IntroPage::IntroPage(QWidget *parent) : HorizonWizardPage(parent) { "If you are unable to use a mouse, you may press the Tab key to cycle between the available inputs. " "The currently selected input will be highlighted.")); -#endif +#endif /* !HAS_INSTALL_ENV */ descLabel->setWordWrap(true); layout = new QVBoxLayout; layout->addWidget(descLabel); +#ifdef HAS_INSTALL_ENV + layout->addStretch(); + layout->addWidget(toolButton); +#endif /* HAS_INSTALL_ENV */ setLayout(layout); } -- cgit v1.2.3-60-g2f50