summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--horizon-qt5.pro6
-rw-r--r--horizon.qrc2
-rw-r--r--horizonwizard.cc4
-rw-r--r--horizonwizard.hh3
-rw-r--r--resources/software-high.pngbin0 -> 287010 bytes
-rw-r--r--resources/software-low.pngbin0 -> 95747 bytes
-rw-r--r--softwarepage.cc91
-rw-r--r--softwarepage.hh22
8 files changed, 126 insertions, 2 deletions
diff --git a/horizon-qt5.pro b/horizon-qt5.pro
index 7d96e3a..14909e9 100644
--- a/horizon-qt5.pro
+++ b/horizon-qt5.pro
@@ -10,13 +10,15 @@ SOURCES += main.cc \
horizonwizard.cc \
welcomepage.cc \
networkingpage.cc \
- horizonwizardpage.cc
+ horizonwizardpage.cc \
+ softwarepage.cc
HEADERS += \
horizonwizard.hh \
welcomepage.hh \
networkingpage.hh \
- horizonwizardpage.hh
+ horizonwizardpage.hh \
+ softwarepage.hh
RESOURCES += \
horizon.qrc
diff --git a/horizon.qrc b/horizon.qrc
index 5fcf84f..741a7f5 100644
--- a/horizon.qrc
+++ b/horizon.qrc
@@ -4,5 +4,7 @@
<file>resources/welcome-low.png</file>
<file>resources/network-low.png</file>
<file>resources/network-high.png</file>
+ <file>resources/software-high.png</file>
+ <file>resources/software-low.png</file>
</qresource>
</RCC>
diff --git a/horizonwizard.cc b/horizonwizard.cc
index cd87423..1f7229f 100644
--- a/horizonwizard.cc
+++ b/horizonwizard.cc
@@ -2,6 +2,7 @@
#include "welcomepage.hh"
#include "networkingpage.hh"
+#include "softwarepage.hh"
HorizonWizard::HorizonWizard(QWidget *parent) : QWizard(parent)
{
@@ -17,4 +18,7 @@ HorizonWizard::HorizonWizard(QWidget *parent) : QWizard(parent)
setPage(Page_Welcome, new WelcomePage);
setPage(Page_Networking, new NetworkingPage);
+ setPage(Page_Software, new SoftwarePage);
+
+ selected.insert("adelie-base");
}
diff --git a/horizonwizard.hh b/horizonwizard.hh
index 3428266..ca7cc03 100644
--- a/horizonwizard.hh
+++ b/horizonwizard.hh
@@ -2,6 +2,8 @@
#define HORIZONWIZARD_HH
#include <QWizard>
+#include <set>
+#include <string>
class HorizonWizard : public QWizard
{
@@ -23,6 +25,7 @@ public:
};
HorizonWizard(QWidget *parent = 0);
+ std::set<std::string> selected;
};
#endif // HORIZONWIZARD_HH
diff --git a/resources/software-high.png b/resources/software-high.png
new file mode 100644
index 0000000..b58ddf9
--- /dev/null
+++ b/resources/software-high.png
Binary files differ
diff --git a/resources/software-low.png b/resources/software-low.png
new file mode 100644
index 0000000..72ff89d
--- /dev/null
+++ b/resources/software-low.png
Binary files differ
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;
+ }
+}
diff --git a/softwarepage.hh b/softwarepage.hh
new file mode 100644
index 0000000..03cece0
--- /dev/null
+++ b/softwarepage.hh
@@ -0,0 +1,22 @@
+#ifndef SOFTWAREPAGE_HH
+#define SOFTWAREPAGE_HH
+
+#include "horizonwizardpage.hh"
+
+#include <QButtonGroup>
+#include <QCheckBox>
+
+class SoftwarePage : public HorizonWizardPage
+{
+public:
+ SoftwarePage(QWidget *parent = 0);
+
+ int nextId() const;
+ void toggleDesktops(bool show);
+private:
+ QButtonGroup *typeGroup;
+ QCheckBox *desktop, *server, *advanced,
+ *kde, *xfce, *lxqt, *openbox;
+};
+
+#endif // SOFTWAREPAGE_HH