From a6ece69a5a6e5c6a965eb6ee55f1485d503b81e4 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Thu, 21 Mar 2024 22:44:13 -0500 Subject: [PATCH] Ensure the items show up in globalStorage, but fail at actually using them --- .../pkgselect/PackageSelectViewStep.cpp | 28 ++++++++++++++----- .../modules/pkgselect/PackageSelectViewStep.h | 2 +- lubuntu/modules/pkgselect_context.conf | 10 +++---- lubuntu/modules/pkgselect_snap_context.conf | 10 ++++--- 4 files changed, 33 insertions(+), 17 deletions(-) diff --git a/common/modules/pkgselect/PackageSelectViewStep.cpp b/common/modules/pkgselect/PackageSelectViewStep.cpp index bd255fc..e12bd07 100644 --- a/common/modules/pkgselect/PackageSelectViewStep.cpp +++ b/common/modules/pkgselect/PackageSelectViewStep.cpp @@ -113,6 +113,20 @@ void PackageSelectViewStep::onActivate() ui->krita_button->setEnabled(false); } }); + + // Connect the storage items + /// Full/Normal/Minimal + connect(ui->minimal_button, &QRadioButton::toggled, this, &PackageSelectViewStep::updatePackageSelections); + connect(ui->normal_button, &QRadioButton::toggled, this, &PackageSelectViewStep::updatePackageSelections); + connect(ui->full_button, &QRadioButton::toggled, this, &PackageSelectViewStep::updatePackageSelections); + /// Additional Options + connect(ui->updates_button, &QRadioButton::toggled, this, &PackageSelectViewStep::updatePackageSelections); + connect(ui->party_button, &QRadioButton::toggled, this, &PackageSelectViewStep::updatePackageSelections); + /// Third-Party Apps + connect(ui->element_button, &QCheckBox::toggled, this, &PackageSelectViewStep::updatePackageSelections); + connect(ui->thunderbird_button, &QCheckBox::toggled, this, &PackageSelectViewStep::updatePackageSelections); + connect(ui->virtmanager_button, &QCheckBox::toggled, this, &PackageSelectViewStep::updatePackageSelections); + connect(ui->krita_button, &QCheckBox::toggled, this, &PackageSelectViewStep::updatePackageSelections); } void @@ -123,17 +137,17 @@ PackageSelectViewStep::onLeave() for (auto i = m_packageSelections.begin(); i != m_packageSelections.end(); ++i) { if (exists_and_true(i.key())) { config.insert(i.key(), i.value()); - } + } } gs->insert("packages", config); } -void PackageSelectViewStep::setPackageSelections(const QVariantMap &value) -{ - if (m_packageSelections != value) { - m_packageSelections = value; - emit packageSelectionsChanged(); - } +void PackageSelectViewStep::updatePackageSelections(bool checked) { + QObject* sender_obj = sender(); + if (!sender_obj) return; + + QString key = "packages." + sender_obj->objectName(); + m_packageSelections[key] = checked; } CALAMARES_PLUGIN_FACTORY_DEFINITION( PackageSelectViewStepFactory, registerPlugin< PackageSelectViewStep >(); ) diff --git a/common/modules/pkgselect/PackageSelectViewStep.h b/common/modules/pkgselect/PackageSelectViewStep.h index ec2ac23..a68b4a1 100644 --- a/common/modules/pkgselect/PackageSelectViewStep.h +++ b/common/modules/pkgselect/PackageSelectViewStep.h @@ -35,7 +35,7 @@ public: void onLeave() override; QVariantMap packageSelections() const { return m_packageSelections; } - void setPackageSelections(const QVariantMap &value); + void updatePackageSelections(bool checked); signals: void packageSelectionsChanged(); diff --git a/lubuntu/modules/pkgselect_context.conf b/lubuntu/modules/pkgselect_context.conf index c9bc096..2669fbd 100644 --- a/lubuntu/modules/pkgselect_context.conf +++ b/lubuntu/modules/pkgselect_context.conf @@ -1,17 +1,17 @@ --- dontChroot: false timeout: 300 -"packages.minimalInstall": +"packages.minimal_button": true: - "apt-get -y --purge remove snapd vlc plasma-discover transmission-qt quassel 2048-qt featherpad noblenote kcalc qps zsync partitionmanager qapt-deb-installer picom qlipper qtpass libreoffice*" - "apt-get -y autoremove" -"packages.restrictedExtras": +"packages.party_button": true: - "apt-get update" - "apt-get -y install ubuntu-restricted-addons unrar" -"packages.updateNow": +"packages.updates_button": true: "apt-get -y full-upgrade" -"packages.virt-manager": +"packages.virtmanager_button": true: "apt-get -y install virt-manager" -"packages.thunderbird": +"packages.thunderbird_button": true: "apt-get -y install thunderbird" diff --git a/lubuntu/modules/pkgselect_snap_context.conf b/lubuntu/modules/pkgselect_snap_context.conf index 02b0956..2116686 100644 --- a/lubuntu/modules/pkgselect_snap_context.conf +++ b/lubuntu/modules/pkgselect_snap_context.conf @@ -1,7 +1,9 @@ --- dontChroot: true timeout: 600 -"packages.element": - true: "calamares_snap_install ${ROOT} element-desktop=stable" -"packages.krita": - true: "calamares_snap_install ${ROOT} cups=stable kf5-5-111-qt-5-15-11-core22=stable krita=stable" +"packages.element_button": + true: "calamares_snap_install ${ROOT} element-desktop=stable gtk-common-themes=stable gnome-42-2204=stable core22=stable" +"packages.krita_button": + true: "calamares_snap_install ${ROOT} cups=stable kf5-5-111-qt-5-15-11-core22=stable gtk-common-themes=stable core22=stable krita=stable" +"packages.full_button": + true: "calamares_snap_install ${ROOT} gtk-common-themes=stable gnome-42-2204=stable core22=stable kf5-5-111-qt-5-15-11-core22=stable bare=stable element-desktop=stable cups=stable snapd=stable krita=stable"