From 1cebfe1fd8731f9338f7a1dd808428841a209d92 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Thu, 28 Mar 2024 23:00:26 -0500 Subject: [PATCH] no network --- .../pkgselect/PackageSelectViewStep.cpp | 60 +- common/modules/pkgselect/pkgselect.ui | 538 +++++++++--------- 2 files changed, 326 insertions(+), 272 deletions(-) diff --git a/common/modules/pkgselect/PackageSelectViewStep.cpp b/common/modules/pkgselect/PackageSelectViewStep.cpp index 7c58b3a..c3c2555 100644 --- a/common/modules/pkgselect/PackageSelectViewStep.cpp +++ b/common/modules/pkgselect/PackageSelectViewStep.cpp @@ -1,6 +1,7 @@ #include "PackageSelectViewStep.h" #include "JobQueue.h" #include "GlobalStorage.h" +#include "network/Manager.h" #include @@ -64,25 +65,31 @@ void PackageSelectViewStep::onActivate() { // Connect the Minimal Installation radio button connect(ui->minimal_button, &QRadioButton::toggled, this, [this](bool checked) { - ui->extraparty_scroll->setVisible(!checked); - ui->extraparty_text->setVisible(!checked); + Calamares::Network::Manager network; + if (checked && network.hasInternet()) { + ui->extraparty_scroll->setVisible(false); + ui->extraparty_text->setVisible(false); + ui->mandatory_warning_label->setVisible(false); - ui->element_button->setChecked(false); - ui->thunderbird_button->setChecked(false); - ui->virtmanager_button->setChecked(false); - ui->krita_button->setChecked(false); + ui->element_button->setChecked(false); + ui->thunderbird_button->setChecked(false); + ui->virtmanager_button->setChecked(false); + ui->krita_button->setChecked(false); - ui->element_button->setEnabled(!checked); - ui->thunderbird_button->setEnabled(!checked); - ui->virtmanager_button->setEnabled(!checked); - ui->krita_button->setEnabled(!checked); + ui->element_button->setEnabled(false); + ui->thunderbird_button->setEnabled(false); + ui->virtmanager_button->setEnabled(false); + ui->krita_button->setEnabled(false); + } }); // Connect the Normal Installation radio button connect(ui->normal_button, &QRadioButton::toggled, this, [this](bool checked) { - if (checked) { + Calamares::Network::Manager network; + if (checked && network.hasInternet()) { ui->extraparty_scroll->setVisible(true); ui->extraparty_text->setVisible(true); + ui->mandatory_warning_label->setVisible(true); ui->element_button->setChecked(false); ui->thunderbird_button->setChecked(false); @@ -98,9 +105,11 @@ void PackageSelectViewStep::onActivate() // Connect the Full Installation radio button connect(ui->full_button, &QRadioButton::toggled, this, [this](bool checked) { - if (checked) { + Calamares::Network::Manager network; + if (checked && network.hasInternet()) { ui->extraparty_scroll->setVisible(true); ui->extraparty_text->setVisible(true); + ui->mandatory_warning_label->setVisible(true); ui->element_button->setChecked(true); ui->thunderbird_button->setChecked(true); @@ -114,6 +123,33 @@ void PackageSelectViewStep::onActivate() } }); + // Disable many bits of functionality if network is not enabled + Calamares::Network::Manager network; + if (!network.hasInternet()) { + ui->full_button->setVisible(false); + ui->full_text->setVisible(false); + + ui->additional_label->setVisible(false); + ui->updates_button->setVisible(false); + ui->updates_text->setVisible(false); + ui->party_button->setVisible(false); + ui->party_text->setVisible(false); + + ui->extraparty_scroll->setVisible(false); + ui->extraparty_text->setVisible(false); + ui->mandatory_warning_label->setVisible(false); + + ui->element_button->setChecked(false); + ui->thunderbird_button->setChecked(false); + ui->virtmanager_button->setChecked(false); + ui->krita_button->setChecked(false); + + ui->element_button->setEnabled(false); + ui->thunderbird_button->setEnabled(false); + ui->virtmanager_button->setEnabled(false); + ui->krita_button->setEnabled(false); + } + // Connect the storage items /// Full/Normal/Minimal connect(ui->minimal_button, &QRadioButton::toggled, this, &PackageSelectViewStep::updatePackageSelections); diff --git a/common/modules/pkgselect/pkgselect.ui b/common/modules/pkgselect/pkgselect.ui index e7983b9..91b1068 100644 --- a/common/modules/pkgselect/pkgselect.ui +++ b/common/modules/pkgselect/pkgselect.ui @@ -28,8 +28,55 @@ QLabel { } - - + + + + Qt::Horizontal + + + QSizePolicy::Minimum + + + + 20 + 20 + + + + + + + + + 16777215 + 21 + + + + + 12 + + + + Minimal Installation + + + + + + + + 10 + true + + + + This software is subject to license terms included with its documentation, and some may be proprietary + + + + + Qt::Vertical @@ -39,7 +86,75 @@ QLabel { 20 - 10 + 20 + + + + + + + + + 16777215 + 21 + + + + + 12 + + + + Full Installation + + + + + + + + 16777215 + 21 + + + + + 12 + + + + Normal Installation + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 @@ -60,20 +175,140 @@ QLabel { - - + + + + + 16777215 + 21 + + - 18 - 50 - false + 12 - - padding-left: 0px; padding-right: 0px; + + Download and install updates following installation + + + + + + + + 10 + true + - Additional Options + Only the desktop environment + + + + + + + + 10 + true + + + + This saves time after installation, and keeps your system secure + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + + + 10 + true + + + + Web browser, utilities, office software, games, and media players + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 3 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + + + 10 + true + + + + All applications in the Normal Installation, and all extra third-party packages listed below + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop @@ -94,97 +329,23 @@ QLabel { - - - - - 16777215 - 21 - - + + - 12 + 18 + 50 + false - - Minimal Installation - - - - - - - - 10 - true - + + padding-left: 0px; padding-right: 0px; - Web browser, utilities, office software, games, and media players + Install additional third-party packages - - - - - 10 - true - - - - This software is subject to license terms included with its documentation, and some may be proprietary - - - - - - - - 10 - true - - - - This saves time after installation, and keeps your system secure - - - - - - - - 16777215 - 21 - - - - - 12 - - - - Full Installation - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - @@ -195,8 +356,8 @@ QLabel { 0 0 - 758 - 287 + 762 + 269 @@ -404,102 +565,6 @@ QLabel { - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 18 - 50 - false - - - - padding-left: 0px; padding-right: 0px; - - - Install additional third-party packages - - - - - - - - 16777215 - 21 - - - - - 12 - - - - Download and install updates following installation - - - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 20 - 20 - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - @@ -518,69 +583,20 @@ QLabel { - - - - - 16777215 - 21 - - + + - 12 + 18 + 50 + false - - Normal Installation - - - true - - - - - - - - 10 - true - + + padding-left: 0px; padding-right: 0px; - All applications in the Normal Installation, and all extra third-party packages listed below - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - - 10 - true - - - - Only the desktop environment + Additional Options @@ -600,21 +616,23 @@ QLabel { - - - - Qt::Vertical + + + + + 11 + 75 + false + true + - - QSizePolicy::Fixed + + Note: Ubuntu and flavors are NOT responsible for third-party software installed from this list. - - - 20 - 3 - + + true - +