Skip to content

Commit

Permalink
[UI] Allow "Unapply All" menu entry through settings (#283)
Browse files Browse the repository at this point in the history
* fixup! PatchmanagerPage: Reorder pulley menu entries (#272)

* Control Unapply All option through settings

* update Requires for Nemo.Configuration plugin

* fixup! Control Unapply All option through settings

* PatchManagerPage: Enhance comment

* SettingsPage: Enhance commment and new strings

* SettingsPage: Hope that "for" is a correct preposition

… after trying "at" and pondering about "on" (both "feel" plausible, but not like a perfect fit).

Co-authored-by: olf <[email protected]>
  • Loading branch information
nephros and Olf0 authored Feb 26, 2022
1 parent 0a05e30 commit a76de1f
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 6 deletions.
1 change: 1 addition & 0 deletions rpm/patchmanager.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
25 changes: 20 additions & 5 deletions src/qml/PatchManagerPage.qml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2013 Lucien XU <[email protected]>
* Copyright (C) 2016 Andrey Kozhevnikov <[email protected]>
* Copyright (c) 2021, Patchmanager for SailfishOS contributors:
* Copyright (c) 2021, 2022, Patchmanager for SailfishOS contributors:
* - olf "Olf0" <https://github.com/Olf0>
* - Peter G. "nephros" <[email protected]>
* - Vlad G. "b100dian" <https://github.com/b100dian>
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
25 changes: 24 additions & 1 deletion src/qml/SettingsPage.qml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2013 Lucien XU <[email protected]>
* Copyright (C) 2016 Andrey Kozhevnikov <[email protected]>
* Copyright (c) 2021, Patchmanager for SailfishOS contributors:
* Copyright (c) 2021, 2022, Patchmanager for SailfishOS contributors:
* - olf "Olf0" <https://github.com/Olf0>
* - Peter G. "nephros" <[email protected]>
* - Vlad G. "b100dian" <https://github.com/b100dian>
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.")
Expand Down

0 comments on commit a76de1f

Please sign in to comment.