summaryrefslogtreecommitdiff
path: root/ui/qt5/networkingpage.cc
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-12-01 18:03:17 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-12-01 18:03:17 -0600
commite1dc77db8d340d86f279b32c3d126c29f4286263 (patch)
tree124650958c8b2875173a5b4fc62ddc64f2e904a1 /ui/qt5/networkingpage.cc
parenta724bc15414f0fc1eaf66b82199e0aac3d18705a (diff)
downloadhorizon-e1dc77db8d340d86f279b32c3d126c29f4286263.tar.gz
horizon-e1dc77db8d340d86f279b32c3d126c29f4286263.tar.bz2
horizon-e1dc77db8d340d86f279b32c3d126c29f4286263.tar.xz
horizon-e1dc77db8d340d86f279b32c3d126c29f4286263.zip
Qt UI: Implement UI.Network.AddressType.MaybeNotDisable
Diffstat (limited to 'ui/qt5/networkingpage.cc')
-rw-r--r--ui/qt5/networkingpage.cc41
1 files changed, 40 insertions, 1 deletions
diff --git a/ui/qt5/networkingpage.cc b/ui/qt5/networkingpage.cc
index aac4b70..54fe9f3 100644
--- a/ui/qt5/networkingpage.cc
+++ b/ui/qt5/networkingpage.cc
@@ -13,6 +13,9 @@
#include "networkingpage.hh"
#include "horizonwizard.hh"
+#ifdef HAS_INSTALL_ENV
+# include <QDir>
+#endif /* HAS_INSTALL_ENV */
#include <QLabel>
#include <QVBoxLayout>
@@ -38,7 +41,11 @@ void NetworkingPage::initializePage() {
}
descLabel->setWordWrap(true);
- if(!horizonWizard()->interfaces.empty()) {
+#ifdef HAS_INSTALL_ENV
+ /* The interface list will be empty if we're in a Runtime Environment. */
+ if(!horizonWizard()->interfaces.empty())
+#endif /* HAS_INSTALL_ENV */
+ {
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"
@@ -77,6 +84,38 @@ void NetworkingPage::initializePage() {
layout->addWidget(advanced);
}
layout->addWidget(skip);
+
+#ifdef HAS_INSTALL_ENV
+ /* REQ: UI.Network.AddressType.MaybeNotDisable
+ *
+ * If we are running in an Installation Environment, we know we require
+ * networking if /packages doesn't exist, because this is a live-only
+ * media. If we are running in a Runtime Environment, we always require
+ * networking because we set the mirror as distfiles.adelielinux.org.
+ *
+ * This may change in the future, when we have mirror selection
+ * implemented; we may have a way to do "local" mirrors.
+ */
+ if(!QDir("/packages").exists())
+#endif /* HAS_INSTALL_ENV */
+ {
+ QLabel *warnIcon = new QLabel;
+ warnIcon->setPixmap(QIcon::fromTheme("dialog-warning").pixmap(QSize(16, 16)));
+ warnIcon->setMaximumSize(QSize(16, 16));
+
+ QLabel *warnLabel = new QLabel(tr("Networking cannot be skipped because a network connection is required to install packages."));
+ warnLabel->setWordWrap(true);
+
+ QHBoxLayout *warnLayout = new QHBoxLayout;
+ warnLayout->addSpacing(32);
+ warnLayout->addWidget(warnIcon);
+ warnLayout->addWidget(warnLabel);
+
+ layout->addLayout(warnLayout);
+
+ skip->setEnabled(false);
+ }
+
setLayout(layout);
}