diff --git a/rpm/patchmanager.spec b/rpm/patchmanager.spec index 5798ee97f..0852de414 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) diff --git a/src/qml/PatchManagerPage.qml b/src/qml/PatchManagerPage.qml index c1434f8a7..920a44cef 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 + /* + * 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 + path: "/org/SfietKonstantin/patchmanager/uisettings" + + property bool showUnapplyAll: false + } + + Timer { id : startTimer interval: 1500 @@ -138,16 +153,16 @@ 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()) } ) - visible: PatchManager.loaded + visible: uisettings.showUnapplyAll } - */ MenuItem { text: qsTranslate("", "About Patchmanager") diff --git a/src/qml/SettingsPage.qml b/src/qml/SettingsPage.qml index 00c1b7f52..8f3097284 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 { + + /* + * 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 + 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' pulley menu entry") + 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 + } + 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.")