summaryrefslogtreecommitdiff
path: root/ui/qt5/netsimplewifipage.cc
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-11-08 02:38:58 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-11-08 02:38:58 -0600
commit386ff62ca3aba790f9831ee7c194d24f6fb781fe (patch)
tree9bb4233e965f3fe71224fd0a5983c1e631787ae4 /ui/qt5/netsimplewifipage.cc
parent561db34595bd4181fde3781d3a00bab9a6d1403f (diff)
downloadhorizon-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/netsimplewifipage.cc')
-rw-r--r--ui/qt5/netsimplewifipage.cc71
1 files changed, 71 insertions, 0 deletions
diff --git a/ui/qt5/netsimplewifipage.cc b/ui/qt5/netsimplewifipage.cc
new file mode 100644
index 0000000..4ce6eb4
--- /dev/null
+++ b/ui/qt5/netsimplewifipage.cc
@@ -0,0 +1,71 @@
+#include "netsimplewifipage.hh"
+
+#include <QHBoxLayout>
+#include <QLabel>
+#include <QVBoxLayout>
+
+#include <horizon/wirelesscontroller.hh>
+
+NetworkSimpleWirelessPage::NetworkSimpleWirelessPage(QWidget *parent)
+ : HorizonWizardPage(parent)
+{
+ QHBoxLayout *securityLayout;
+ QVBoxLayout *layout;
+ QLabel *descLabel, *securityTypeLabel, *statusLabel;
+
+ loadWatermark("network");
+ setTitle(tr("Wireless Networking Setup"));
+
+ descLabel = new QLabel(tr(
+ "A supported Wi-Fi device has been found in this "
+ "computer. If you connect to the Internet using "
+ "Wi-Fi, select your Access Point below.\n\n"
+
+ "If you don't want to use Wi-Fi, select \"Use Wired "
+ "Connection\" to continue using a wired connection."));
+ descLabel->setWordWrap(true);
+
+ statusLabel = new QLabel(tr("Scanning for networks..."));
+
+ ssidListView = new QListView;
+
+ ssidName = new QLineEdit(this);
+ ssidName->setPlaceholderText(tr("Network Name"));
+ ssidName->hide();
+
+ securityTypeLabel = new QLabel(tr("Security type"));
+
+ securityType = new QComboBox(this);
+ securityType->addItems({tr("None"), tr("WPA2 Personal"),
+ tr("WPA2 Enterprise"), tr("WPA Personal"),
+ tr("WPA Enterprise"), tr("WEP")});
+ securityType->setEnabled(false);
+ securityType->hide();
+
+ passphrase = new QLineEdit(this);
+ passphrase->setEchoMode(QLineEdit::Password);
+ passphrase->setPlaceholderText(tr("Passphrase"));
+ passphrase->hide();
+
+ securityLayout = new QHBoxLayout;
+ securityLayout->addWidget(securityTypeLabel);
+ securityLayout->addWidget(securityType);
+
+ layout = new QVBoxLayout;
+ layout->addWidget(descLabel);
+ layout->addWidget(statusLabel, 0, Qt::AlignCenter);
+ layout->addSpacing(10);
+ layout->addWidget(ssidListView, 0, Qt::AlignCenter);
+ layout->addSpacing(10);
+ layout->addWidget(ssidName);
+ layout->addSpacing(10);
+ layout->addLayout(securityLayout);
+ layout->addSpacing(10);
+ layout->addWidget(passphrase);
+ setLayout(layout);
+}
+
+void NetworkSimpleWirelessPage::initializePage()
+{
+ Horizon::WirelessController::wirelessController()->performScan();
+}