blob: 3aef02f3e220f8ca4971658c45e7f0ed4fae861f (
plain) (
blame)
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
|
/*
* netsimplewifipage.cc - Implementation of the UI.Network.Wireless page
* horizon-qt5, the Qt 5 user interface for
* Project Horizon
*
* Copyright (c) 2019 Adélie Linux and contributors. All rights reserved.
* This code is licensed under the AGPL 3.0 license, as noted in the
* LICENSE-code file in the root directory of this repository.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#include "netsimplewifipage.hh"
#include <bcnm/wpactrl.h>
#include <QVBoxLayout>
NetworkSimpleWirelessPage::NetworkSimpleWirelessPage(QWidget *parent)
: HorizonWizardPage(parent) {
QVBoxLayout *layout;
loadWatermark("network");
setTitle(tr("Select Your Network"));
statusLabel = new QLabel(tr("Scanning for networks..."));
rescanButton = new QPushButton(tr("&Rescan Networks"));
rescanButton->setEnabled(false);
connect(rescanButton, &QPushButton::clicked, [=](void) { doScan(); });
ssidListView = new QListWidget;
passphrase = new QLineEdit(this);
passphrase->setEchoMode(QLineEdit::Password);
passphrase->setPlaceholderText(tr("Passphrase"));
passphrase->hide();
layout = new QVBoxLayout;
layout->addWidget(statusLabel, 0, Qt::AlignCenter);
layout->addSpacing(10);
layout->addWidget(ssidListView, 0, Qt::AlignCenter);
layout->addWidget(rescanButton);
layout->addSpacing(10);
layout->addWidget(passphrase);
setLayout(layout);
}
void NetworkSimpleWirelessPage::doScan() {
ssidListView->clear();
rescanButton->setEnabled(false);
}
void NetworkSimpleWirelessPage::initializePage() {
doScan();
}
int NetworkSimpleWirelessPage::nextId() const {
return HorizonWizard::Page_Network_DHCP;
}
|