diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-11-08 20:33:24 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-11-08 20:33:24 -0600 |
commit | 704e0b72e628ff136f1246921eca71dab00e2639 (patch) | |
tree | 98a8dfd0d696e83574277e69eed610cc29d04c5f /ui | |
parent | 47d683d131ed5d34ef6cb8281fe8891dd06ef327 (diff) | |
download | horizon-704e0b72e628ff136f1246921eca71dab00e2639.tar.gz horizon-704e0b72e628ff136f1246921eca71dab00e2639.tar.bz2 horizon-704e0b72e628ff136f1246921eca71dab00e2639.tar.xz horizon-704e0b72e628ff136f1246921eca71dab00e2639.zip |
Qt UI: Implement UI.Intro.Tools
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt5/intropage.cc | 29 | ||||
-rw-r--r-- | ui/qt5/intropage.hh | 9 |
2 files changed, 35 insertions, 3 deletions
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 <QLabel> +#ifdef HAS_INSTALL_ENV +#include <QMenu> +#include <QProcess> +#endif /* HAS_INSTALL_ENV */ #include <QVBoxLayout> 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); } diff --git a/ui/qt5/intropage.hh b/ui/qt5/intropage.hh index e1ed3d9..5c50d6d 100644 --- a/ui/qt5/intropage.hh +++ b/ui/qt5/intropage.hh @@ -1,12 +1,19 @@ #ifndef WELCOMEPAGE_HH #define WELCOMEPAGE_HH +#ifdef HAS_INSTALL_ENV +#include <QPushButton> +#endif #include "horizonwizardpage.hh" class IntroPage : public HorizonWizardPage { public: - IntroPage(QWidget *parent = 0); + IntroPage(QWidget *parent = nullptr); int nextId() const; +#ifdef HAS_INSTALL_ENV +private: + QPushButton *toolButton; +#endif }; #endif // WELCOMEPAGE_HH |