diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2017-02-27 20:08:10 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2017-03-01 18:39:01 -0600 |
commit | a3c5b6e75573ebe22b2cd2319448cdf828eaf1fc (patch) | |
tree | 4108f6e3562d63f9daf79eb1c286061c0306d42a /softwarepage.cc | |
parent | dcc45c4b24418aa363e2a7ee2fe0b929e0fca8b2 (diff) | |
download | horizon-qt5-a3c5b6e75573ebe22b2cd2319448cdf828eaf1fc.tar.gz horizon-qt5-a3c5b6e75573ebe22b2cd2319448cdf828eaf1fc.tar.bz2 horizon-qt5-a3c5b6e75573ebe22b2cd2319448cdf828eaf1fc.tar.xz horizon-qt5-a3c5b6e75573ebe22b2cd2319448cdf828eaf1fc.zip |
Add software selection page
Diffstat (limited to 'softwarepage.cc')
-rw-r--r-- | softwarepage.cc | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/softwarepage.cc b/softwarepage.cc new file mode 100644 index 0000000..28805e3 --- /dev/null +++ b/softwarepage.cc @@ -0,0 +1,91 @@ +#include "softwarepage.hh" +#include "horizonwizard.hh" + +#include <QHBoxLayout> +#include <QLabel> +#include <QVBoxLayout> + +SoftwarePage::SoftwarePage(QWidget *parent) : HorizonWizardPage(parent) +{ + QLabel *descLabel; + QVBoxLayout *layout, *desktopLayout; + QHBoxLayout *nudgeOver; + + loadWatermark("software"); + setTitle(tr("Select Software")); + + descLabel = new QLabel(tr( + "You can select what software you want to install on " + "your computer.")); + descLabel->setWordWrap(true); + + desktop = new QCheckBox(tr( + "&Desktop Software - Web browser, email client, media " + "player, and more")); + kde = new QCheckBox(tr( + "Use the &KDE Plasma 5 desktop\nIdeal for newer computers, " + "KDE Plasma 5 provides a clean,\nmodern experience.")); + xfce = new QCheckBox(tr( + "Use the &XFCE 4 desktop\nXFCE provides a classic desktop " + "experience well suited to\nsmaller screens.")); + lxqt = new QCheckBox(tr( + "Use the &LXQt desktop\nLXQt provides a modern experience " + "similar to KDE Plasma 5\noptimised for older hardware.")); + openbox = new QCheckBox(tr( + "Use the &OpenBox desktop\nOpenBox is for people who are " + "familiar with other Linux/Unix\ndesktop experiences.")); + server = new QCheckBox(tr( + "&Server Software - Web server, print server, and more")); + advanced = new QCheckBox(tr( + "&Advanced - select which software to install")); + + QObject::connect(desktop, (void (QCheckBox:: *)(bool))&QCheckBox::clicked, + [=](bool checked) { + this->toggleDesktops(checked); + }); + + desktop->setChecked(true); + + typeGroup = new QButtonGroup(this); + typeGroup->addButton(kde); + typeGroup->addButton(xfce); + typeGroup->addButton(lxqt); + typeGroup->addButton(openbox); + + desktopLayout = new QVBoxLayout; + desktopLayout->addWidget(kde); + desktopLayout->addWidget(xfce); + desktopLayout->addWidget(lxqt); + desktopLayout->addWidget(openbox); + + nudgeOver = new QHBoxLayout; + nudgeOver->addSpacing(20); + nudgeOver->addLayout(desktopLayout); + + layout = new QVBoxLayout; + layout->addWidget(descLabel); + layout->addSpacing(50); + layout->addWidget(desktop); + layout->addLayout(nudgeOver); + layout->addWidget(server); + layout->addWidget(advanced); + setLayout(layout); +} + +void SoftwarePage::toggleDesktops(bool show) +{ + kde->setVisible(show); + xfce->setVisible(show); + lxqt->setVisible(show); + openbox->setVisible(show); +} + +int SoftwarePage::nextId() const +{ + if(advanced->isChecked()) + { + return HorizonWizard::Page_AdvancedSoftware; + } else { + return HorizonWizard::Page_Startup; + } +} |