From cf87c44fc5a801d1ba978918178ff8b70dabb5ce Mon Sep 17 00:00:00 2001 From: Peter G Date: Wed, 23 Feb 2022 09:16:58 +0100 Subject: [PATCH 1/7] fixup! PatchmanagerPage: Reorder pulley menu entries (#272) --- src/qml/PatchManagerPage.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qml/PatchManagerPage.qml b/src/qml/PatchManagerPage.qml index c1434f8a..97a82901 100644 --- a/src/qml/PatchManagerPage.qml +++ b/src/qml/PatchManagerPage.qml @@ -138,10 +138,10 @@ Page { PullDownMenu { busy: view.busy enabled: !busy - + /* Disabled due to discussion at https://github.com/sailfishos-patches/patchmanager/pull/272#issuecomment-1047685536 - + MenuItem { text: qsTranslate("", "Deactivate all Patches") onClicked: menuRemorse.execute( text, function() { PatchManager.call(PatchManager.unapplyAllPatches()) } ) From f00507caed9a0ad9e2810c6bd711e122aa3df1fd Mon Sep 17 00:00:00 2001 From: Peter G Date: Fri, 25 Feb 2022 09:44:18 +0100 Subject: [PATCH 2/7] Control Unapply All option through settings --- src/qml/PatchManagerPage.qml | 21 ++++++++++++++++++--- src/qml/SettingsPage.qml | 25 ++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/qml/PatchManagerPage.qml b/src/qml/PatchManagerPage.qml index 97a82901..b9b58703 100644 --- a/src/qml/PatchManagerPage.qml +++ b/src/qml/PatchManagerPage.qml @@ -1,7 +1,7 @@ /* * Copyright (C) 2013 Lucien XU * Copyright (C) 2016 Andrey Kozhevnikov - * Copyright (c) 2021, Patchmanager for SailfishOS contributors: + * Copyright (c) 2021, 2022, Patchmanager for SailfishOS contributors: * - olf "Olf0" * - Peter G. "nephros" * - Vlad G. "b100dian" @@ -37,11 +37,26 @@ import QtQuick 2.0 import Sailfish.Silica 1.0 +import Nemo.Configuration 1.0 import org.SfietKonstantin.patchmanager 2.0 Page { id: container + /* + * usually config values are set through the patchmanager plugin on the + * daemon which stores in /etc/patchmanager2.conf. + * this config group is for UI settings which do not affect PM behaviour + * and thus need not be managed there. + */ + ConfigurationGroup { + id: uisettings + path: "/org/SfietKonstantin/patchmanager/uisettings" + + property bool showUnapplyAll: false + } + + Timer { id : startTimer interval: 1500 @@ -141,13 +156,13 @@ Page { /* Disabled due to discussion at https://github.com/sailfishos-patches/patchmanager/pull/272#issuecomment-1047685536 + */ MenuItem { text: qsTranslate("", "Deactivate all Patches") onClicked: menuRemorse.execute( text, function() { PatchManager.call(PatchManager.unapplyAllPatches()) } ) - visible: PatchManager.loaded + visible: uisettings.showUnapplyAll } - */ MenuItem { text: qsTranslate("", "About Patchmanager") diff --git a/src/qml/SettingsPage.qml b/src/qml/SettingsPage.qml index 00c1b7f5..8e00cb18 100644 --- a/src/qml/SettingsPage.qml +++ b/src/qml/SettingsPage.qml @@ -1,7 +1,7 @@ /* * Copyright (C) 2013 Lucien XU * Copyright (C) 2016 Andrey Kozhevnikov - * Copyright (c) 2021, Patchmanager for SailfishOS contributors: + * Copyright (c) 2021, 2022, Patchmanager for SailfishOS contributors: * - olf "Olf0" * - Peter G. "nephros" * - Vlad G. "b100dian" @@ -37,9 +37,24 @@ import QtQuick 2.0 import Sailfish.Silica 1.0 +import Nemo.Configuration 1.0 import org.SfietKonstantin.patchmanager 2.0 Page { + + /* + * usually config values are set through the patchmanager plugin on the + * daemon which stores in /etc/patchmanager2.conf. + * this config group is for UI settings which do not affect PM behaviour + * and thus need not be managed there. + */ + ConfigurationGroup { + id: uisettings + path: "/org/SfietKonstantin/patchmanager/uisettings" + + property bool showUnapplyAll: false + } + SilicaFlickable { id: flick anchors.fill: parent @@ -73,6 +88,14 @@ Page { automaticCheck: false } + TextSwitch { + text: qsTranslate("", "Show 'Deactivate all Patches' menu") + description: qsTranslate("", "Temporarily enable the menu option to deactivate all Patches.") + checked: uisettings.showUnapplyAll + onClicked: uisettings.showUnapplyAll = !uisettings.showUnapplyAll + automaticCheck: false + } + TextSwitch { text: qsTranslate("", "Allow incompatible Patches") description: qsTranslate("", "Enable activating Patches, which are not marked as compatible with the installed SailfishOS version. Note that Patches, which are actually incompatible, will not work.") From eb751abf69626404bfefa417b3006beae9973b33 Mon Sep 17 00:00:00 2001 From: Peter G Date: Fri, 25 Feb 2022 13:08:25 +0100 Subject: [PATCH 3/7] update Requires for Nemo.Configuration plugin --- rpm/patchmanager.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/rpm/patchmanager.spec b/rpm/patchmanager.spec index 5ec549f4..9f9af91a 100644 --- a/rpm/patchmanager.spec +++ b/rpm/patchmanager.spec @@ -22,6 +22,7 @@ Requires: patch Requires: grep Requires: sed Requires: sailfish-version >= 3.4.0 +Requires: qml(Nemo.Configuration) BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5DBus) BuildRequires: pkgconfig(Qt5Qml) From db29b53d72c1a78ae184431bfbe555833b6ae50a Mon Sep 17 00:00:00 2001 From: Peter G Date: Fri, 25 Feb 2022 13:12:03 +0100 Subject: [PATCH 4/7] fixup! Control Unapply All option through settings --- src/qml/SettingsPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qml/SettingsPage.qml b/src/qml/SettingsPage.qml index 8e00cb18..180af5b3 100644 --- a/src/qml/SettingsPage.qml +++ b/src/qml/SettingsPage.qml @@ -90,7 +90,7 @@ Page { TextSwitch { text: qsTranslate("", "Show 'Deactivate all Patches' menu") - description: qsTranslate("", "Temporarily enable the menu option to deactivate all Patches.") + description: qsTranslate("", "Enable a menu option to deactivate all Patches.") checked: uisettings.showUnapplyAll onClicked: uisettings.showUnapplyAll = !uisettings.showUnapplyAll automaticCheck: false From 6702af03d9261d650b802573414934bfca948491 Mon Sep 17 00:00:00 2001 From: olf Date: Sat, 26 Feb 2022 01:35:22 +0100 Subject: [PATCH 5/7] PatchManagerPage: Enhance comment --- src/qml/PatchManagerPage.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qml/PatchManagerPage.qml b/src/qml/PatchManagerPage.qml index b9b58703..920a44ce 100644 --- a/src/qml/PatchManagerPage.qml +++ b/src/qml/PatchManagerPage.qml @@ -44,10 +44,10 @@ Page { id: container /* - * usually config values are set through the patchmanager plugin on the - * daemon which stores in /etc/patchmanager2.conf. - * this config group is for UI settings which do not affect PM behaviour - * and thus need not be managed there. + * The usual, system-wide configuration values are set via D-Bus plugin by the + * Patchmanager daemon, which stores them in /etc/patchmanager2.conf + * This configuration group "uisettings" is for settings which *solely* affect + * the PM GUI application and consequently also are per-user settings. */ ConfigurationGroup { id: uisettings From 8436d92da56fba414d21bbd0b9b56ae67a1035cc Mon Sep 17 00:00:00 2001 From: olf Date: Sat, 26 Feb 2022 01:42:21 +0100 Subject: [PATCH 6/7] SettingsPage: Enhance commment and new strings --- src/qml/SettingsPage.qml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qml/SettingsPage.qml b/src/qml/SettingsPage.qml index 180af5b3..d97b3f86 100644 --- a/src/qml/SettingsPage.qml +++ b/src/qml/SettingsPage.qml @@ -43,10 +43,10 @@ import org.SfietKonstantin.patchmanager 2.0 Page { /* - * usually config values are set through the patchmanager plugin on the - * daemon which stores in /etc/patchmanager2.conf. - * this config group is for UI settings which do not affect PM behaviour - * and thus need not be managed there. + * The usual, system-wide configuration values are set via D-Bus plugin by the + * Patchmanager daemon, which stores them in /etc/patchmanager2.conf + * This configuration group "uisettings" is for settings which *solely* affect + * the PM GUI application and consequently also are per-user settings. */ ConfigurationGroup { id: uisettings @@ -89,8 +89,8 @@ Page { } TextSwitch { - text: qsTranslate("", "Show 'Deactivate all Patches' menu") - description: qsTranslate("", "Enable a menu option to deactivate all Patches.") + text: qsTranslate("", "Show 'Deactivate all Patches' pulley menu entry") + description: qsTranslate("", "Enable an additional pulley menu entry at Patchmanager's main page to deactivate all Patches.") checked: uisettings.showUnapplyAll onClicked: uisettings.showUnapplyAll = !uisettings.showUnapplyAll automaticCheck: false From 1d328bd339b27c5a4dc40375854499b5eef87f2b Mon Sep 17 00:00:00 2001 From: olf Date: Sat, 26 Feb 2022 02:59:40 +0100 Subject: [PATCH 7/7] SettingsPage: Hope that "for" is a correct preposition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … after trying "at" and pondering about "on" (both "feel" plausible, but not like a perfect fit). --- src/qml/SettingsPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qml/SettingsPage.qml b/src/qml/SettingsPage.qml index d97b3f86..8f309728 100644 --- a/src/qml/SettingsPage.qml +++ b/src/qml/SettingsPage.qml @@ -90,7 +90,7 @@ Page { TextSwitch { text: qsTranslate("", "Show 'Deactivate all Patches' pulley menu entry") - description: qsTranslate("", "Enable an additional pulley menu entry at Patchmanager's main page to deactivate all Patches.") + description: qsTranslate("", "Enable an additional pulley menu entry for Patchmanager's main page to deactivate all Patches.") checked: uisettings.showUnapplyAll onClicked: uisettings.showUnapplyAll = !uisettings.showUnapplyAll automaticCheck: false