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 | 456 +++++++++--------- 2 files changed, 285 insertions(+), 231 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,24 +28,55 @@ QLabel { } - - + + - Qt::Vertical + Qt::Horizontal - QSizePolicy::Fixed + QSizePolicy::Minimum 20 - 10 + 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 @@ -60,42 +91,26 @@ QLabel { - - - - - 18 - 50 - false - - - - padding-left: 0px; padding-right: 0px; - - - Additional Options + + + + + 16777215 + 21 + - - - - - 18 - 50 - false + 12 - - padding-left: 0px; padding-right: 0px; - - Installation Mode + Full Installation - - + + 16777215 @@ -108,25 +123,78 @@ QLabel { - Minimal Installation + Normal Installation + + + true - - + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 16777215 + 21 + + - 10 - true + 12 - Web browser, utilities, office software, games, and media players + Download and install updates following installation - - + + 10 @@ -134,7 +202,7 @@ QLabel { - This software is subject to license terms included with its documentation, and some may be proprietary + Only the desktop environment @@ -151,26 +219,69 @@ QLabel { - - - + + + + Qt::Vertical + + + QSizePolicy::Fixed + + - 16777215 - 21 + 20 + 10 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + - 12 + 10 + true - Full Installation + Web browser, utilities, office software, games, and media players - - + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 3 + + + + + + Qt::Vertical @@ -185,6 +296,56 @@ QLabel { + + + + + 10 + true + + + + All applications in the Normal Installation, and all extra third-party packages listed below + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + + 18 + 50 + false + + + + padding-left: 0px; padding-right: 0px; + + + Installation Mode + + + + + + + + 18 + 50 + false + + + + padding-left: 0px; padding-right: 0px; + + + Install additional third-party packages + + + @@ -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 - - - - Normal Installation - - - true - - - - - + + - 10 - true + 18 + 50 + false - - 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 - + + padding-left: 0px; padding-right: 0px; - 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 - +