diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2016-10-02 07:11:37 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2016-10-02 07:11:37 -0500 |
commit | 93ebeb837625d9db5bbc8a5575f73eded60d5b8d (patch) | |
tree | 5b63e3916e487f7d39543d281201a43038ef1d88 | |
parent | c9bbd46209e4802864b973131aacad6c42bc6ce0 (diff) | |
download | horizon-qt5-93ebeb837625d9db5bbc8a5575f73eded60d5b8d.tar.gz horizon-qt5-93ebeb837625d9db5bbc8a5575f73eded60d5b8d.tar.bz2 horizon-qt5-93ebeb837625d9db5bbc8a5575f73eded60d5b8d.tar.xz horizon-qt5-93ebeb837625d9db5bbc8a5575f73eded60d5b8d.zip |
Add some starts of a network config part
-rw-r--r-- | horizon.qrc | 2 | ||||
-rw-r--r-- | horizonwizard.cc | 2 | ||||
-rw-r--r-- | networkingpage.cc | 57 | ||||
-rw-r--r-- | networkingpage.hh | 6 | ||||
-rw-r--r-- | resources/network-high.png | bin | 0 -> 311676 bytes | |||
-rw-r--r-- | resources/network-low.png | bin | 0 -> 98234 bytes |
6 files changed, 65 insertions, 2 deletions
diff --git a/horizon.qrc b/horizon.qrc index cb44beb..5fcf84f 100644 --- a/horizon.qrc +++ b/horizon.qrc @@ -2,5 +2,7 @@ <qresource prefix="/wizard_pixmaps"> <file>resources/welcome-high.png</file> <file>resources/welcome-low.png</file> + <file>resources/network-low.png</file> + <file>resources/network-high.png</file> </qresource> </RCC> diff --git a/horizonwizard.cc b/horizonwizard.cc index d956694..cd87423 100644 --- a/horizonwizard.cc +++ b/horizonwizard.cc @@ -7,7 +7,7 @@ HorizonWizard::HorizonWizard(QWidget *parent) : QWizard(parent) { setWindowTitle(tr("Adélie Linux System Installation")); - setFixedSize(QSize(600, 450)); + setFixedSize(QSize(700, 450)); setOption(DisabledBackButtonOnLastPage); setOption(HaveHelpButton); diff --git a/networkingpage.cc b/networkingpage.cc index cc3aeb3..7859a37 100644 --- a/networkingpage.cc +++ b/networkingpage.cc @@ -1,6 +1,61 @@ #include "networkingpage.hh" +#include <QLabel> +#include <QRadioButton> +#include <QVBoxLayout> + NetworkingPage::NetworkingPage(QWidget *parent) : HorizonWizardPage(parent) { - setTitle(tr("Network Setup")); + QLabel *descLabel; + QRadioButton *simple, *advanced, *skip; + QVBoxLayout *layout; + + loadWatermark("network"); + setTitle(tr("Networking Setup")); + + descLabel = new QLabel(tr( + "If you have a normal network connection where your " + "computer is directly connected to the Internet via " + "Ethernet or Wi-Fi using a modem or router, choose " + "Simple. If you have a more complicated network " + "configuration, you need to set a static IP address, " + "or you use a VPN, choose Advanced.\n\n" + + "If you don't want to configure networking or you " + "don't want to use this computer on the Internet, " + "choose Skip.")); + descLabel->setWordWrap(true); + + simple = new QRadioButton(tr( + "&Simple - my computer connects to the Internet directly " + "or via a modem/router")); + advanced = new QRadioButton(tr( + "&Advanced - my computer connects to an enterprise " + "network or\nI use a static IP address/VPN/802.1X")); + skip = new QRadioButton(tr( + "S&kip - I don't want to connect to a network or the " + "Internet right now")); + + radioGroup = new QButtonGroup(this); + radioGroup->addButton(simple); + radioGroup->addButton(advanced); + radioGroup->addButton(skip); + + QObject::connect(radioGroup, (void (QButtonGroup:: *)(QAbstractButton *))&QButtonGroup::buttonClicked, + [=](QAbstractButton *button) { + emit completeChanged(); + }); + + layout = new QVBoxLayout; + layout->addWidget(descLabel); + layout->addSpacing(50); + layout->addWidget(simple); + layout->addWidget(advanced); + layout->addWidget(skip); + setLayout(layout); +} + +bool NetworkingPage::isComplete() const +{ + return (radioGroup->checkedButton() != nullptr); } diff --git a/networkingpage.hh b/networkingpage.hh index bf517f8..6a880ca 100644 --- a/networkingpage.hh +++ b/networkingpage.hh @@ -3,10 +3,16 @@ #include "horizonwizardpage.hh" +#include <QButtonGroup> + class NetworkingPage : public HorizonWizardPage { public: NetworkingPage(QWidget *parent = 0); + + bool isComplete() const; +private: + QButtonGroup *radioGroup; }; #endif // NETWORKINGPAGE_HH diff --git a/resources/network-high.png b/resources/network-high.png Binary files differnew file mode 100644 index 0000000..77ef906 --- /dev/null +++ b/resources/network-high.png diff --git a/resources/network-low.png b/resources/network-low.png Binary files differnew file mode 100644 index 0000000..f8535f3 --- /dev/null +++ b/resources/network-low.png |