summaryrefslogtreecommitdiff
path: root/ui/qt5/networkingpage.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ui/qt5/networkingpage.cc')
-rw-r--r--ui/qt5/networkingpage.cc59
1 files changed, 37 insertions, 22 deletions
diff --git a/ui/qt5/networkingpage.cc b/ui/qt5/networkingpage.cc
index eb8d883..8379877 100644
--- a/ui/qt5/networkingpage.cc
+++ b/ui/qt5/networkingpage.cc
@@ -17,31 +17,40 @@
#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"
+void NetworkingPage::initializePage() {
+ QLabel *descLabel;
+ QVBoxLayout *layout;
- "If you don't want to configure networking or you don't want to use "
- "this computer on the Internet, choose Skip."));
+ if(horizonWizard()->interfaces.empty()) {
+ descLabel = new QLabel(tr(
+ "No supported network interfaces have been detected on your computer.\n\n"
+ "You will not be able to connect to a network nor the Internet.\n\n"
+ "If you have a network interface attached to your computer, it may not be supported by Adélie Linux. Please contact our community at https://help.adelielinux.org/ for help."));
+ } else {
+ descLabel = new QLabel(tr(
+ "If your computer is directly connected to the Internet via Ethernet or Wi-Fi using a modem or router, choose Automatic.\n\n"
+ "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."));
+ if(!horizonWizard()->interfaces.empty()) {
+ 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);
+ if(!horizonWizard()->interfaces.empty()) {
+ radioGroup->addButton(simple);
+ radioGroup->addButton(advanced);
+ }
radioGroup->addButton(skip);
QObject::connect(radioGroup, static_cast<void (QButtonGroup:: *)(QAbstractButton *)>(&QButtonGroup::buttonClicked),
@@ -52,8 +61,10 @@ NetworkingPage::NetworkingPage(QWidget *parent) : HorizonWizardPage(parent) {
layout = new QVBoxLayout;
layout->addWidget(descLabel);
layout->addSpacing(50);
- layout->addWidget(simple);
- layout->addWidget(advanced);
+ if(!horizonWizard()->interfaces.empty()) {
+ layout->addWidget(simple);
+ layout->addWidget(advanced);
+ }
layout->addWidget(skip);
setLayout(layout);
}
@@ -64,11 +75,14 @@ bool NetworkingPage::isComplete() const {
int NetworkingPage::nextId() const {
if(radioGroup->checkedButton() == simple) {
- if(false) {
- return HorizonWizard::Page_Network_Wireless;
+ if(horizonWizard()->interfaces.size() > 1) {
+ return HorizonWizard::Page_Network_Iface;
} else {
- if(false) {
- return HorizonWizard::Page_Network_Iface;
+ horizonWizard()->chosen_auto_iface =
+ (horizonWizard()->interfaces.begin())->first;
+ if((horizonWizard()->interfaces.begin())->second
+ == HorizonWizard::Wireless) {
+ return HorizonWizard::Page_Network_Wireless;
} else {
return HorizonWizard::Page_Network_DHCP;
}
@@ -76,6 +90,7 @@ int NetworkingPage::nextId() const {
} else if(radioGroup->checkedButton() == advanced) {
return HorizonWizard::Page_Network_Manual;
} else {
+ /* REQ: UI.Network.AddressType.Skip */
return HorizonWizard::Page_DateTime;
}
}