diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-11-08 02:38:58 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-11-08 02:38:58 -0600 |
commit | 386ff62ca3aba790f9831ee7c194d24f6fb781fe (patch) | |
tree | 9bb4233e965f3fe71224fd0a5983c1e631787ae4 /ui/qt5/networkingpage.cc | |
parent | 561db34595bd4181fde3781d3a00bab9a6d1403f (diff) | |
download | horizon-386ff62ca3aba790f9831ee7c194d24f6fb781fe.tar.gz horizon-386ff62ca3aba790f9831ee7c194d24f6fb781fe.tar.bz2 horizon-386ff62ca3aba790f9831ee7c194d24f6fb781fe.tar.xz horizon-386ff62ca3aba790f9831ee7c194d24f6fb781fe.zip |
UI: Import some of the 2016 prototype - welcome to Qt UI development
Diffstat (limited to 'ui/qt5/networkingpage.cc')
-rw-r--r-- | ui/qt5/networkingpage.cc | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/ui/qt5/networkingpage.cc b/ui/qt5/networkingpage.cc new file mode 100644 index 0000000..140e9af --- /dev/null +++ b/ui/qt5/networkingpage.cc @@ -0,0 +1,74 @@ +#include "networkingpage.hh" +#include "horizonwizard.hh" + +#include <cstdint> +#include <QLabel> +#include <QVBoxLayout> + +NetworkingPage::NetworkingPage(QWidget *parent) : HorizonWizardPage(parent) +{ + QLabel *descLabel; + QVBoxLayout *layout; + + loadWatermark("network"); + setTitle(tr("Networking Setup")); + + descLabel = new QLabel(tr( + "If you have a typical network connection where your computer is " + "directly connected to the Internet via Ethernet or Wi-Fi using a " + "modem or router, choose Automatic. If you need to set a static IP " + "address, or you use a VPN or proxy server, choose Manual.\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("&Automatic - my computer connects to the Internet directly\n" + "or via a modem/router.")); + advanced = new QRadioButton(tr("&Manual - my computer connects to an enterprise network,\n" + "or I use a static IP address, VPN, or 802.1X.")); + skip = new QRadioButton(tr("&Skip - I don't want to connect to a network or the Internet.")); + + radioGroup = new QButtonGroup(this); + radioGroup->addButton(simple); + radioGroup->addButton(advanced); + radioGroup->addButton(skip); + + QObject::connect(radioGroup, static_cast<void (QButtonGroup:: *)(QAbstractButton *)>(&QButtonGroup::buttonClicked), + [=](QAbstractButton *button __attribute__((unused))) { + 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); +} + +int NetworkingPage::nextId() const +{ + if(radioGroup->checkedButton() == simple) { + /* determine wifi */ + if(false) { + return HorizonWizard::Page_Network_Wireless; + } else { + if(false) { + return HorizonWizard::Page_Network_Iface; + } else { + return HorizonWizard::Page_Network_DHCP; + } + } + } else if(radioGroup->checkedButton() == advanced) { + return HorizonWizard::Page_Network_Manual; + } else { + return HorizonWizard::Page_DateTime; + } +} |