1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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();
}
|