Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions src/bin/dialog/dialog.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2016 Andrey Kozhevnikov <coderusinbox@gmail.com>
* Copyright (c) 2021-2022, Patchmanager for SailfishOS contributors:
* Copyright (c) 2021-2025, Patchmanager for SailfishOS contributors:
* - olf "Olf0" <https://github.com/Olf0>
* - Peter G. "nephros" <sailfish@nephros.org>
*
Expand Down Expand Up @@ -35,7 +35,8 @@

import QtQuick 2.0
import Sailfish.Silica 1.0
import org.nemomobile.dbus 2.0
import Nemo.DBus 2.0
import Nemo.Configuration 1.0

ApplicationWindow {
id: appWindow
Expand All @@ -58,16 +59,24 @@ ApplicationWindow {
}
initialPage: Component {
Page {
allowedOrientations: Orientation.All
onStatusChanged: {
if (status == PageStatus.Active && !appWindow.remorseItem) {
var timeout = dialogConf.value * 1000
remorse.execute(button, qsTranslate("", "Activate all enabled Patches"), function() {
console.info("Accepted activation of all enabled Patches.");
dbusPm.call("loadRequest", [true]);
}, 10000)
}, timeout)
appWindow.remorseItem = remorse
}
}

ConfigurationValue {
id: dialogConf
key: "/org/SfietKonstantin/patchmanager/dialog/timeout"
defaultValue: 10
}

SilicaFlickable {
anchors.fill: parent
contentHeight: content.height
Expand All @@ -86,7 +95,7 @@ ApplicationWindow {
anchors.right: parent.right
anchors.margins: Theme.horizontalPageMargin
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
text: qsTranslate("", "Patchmanager will start to activate all enabled Patches in 10 seconds.")
text: qsTranslate("", "Patchmanager will start to activate all enabled Patches in %1 seconds.").arg(dialogConf.value)
}

Item {
Expand Down Expand Up @@ -209,7 +218,7 @@ ApplicationWindow {
}

CoverActionList {
enabled: appWindow.remorseItem.pending
enabled: !!appWindow.remorseItem && appWindow.remorseItem.pending
CoverAction {
iconSource: "image://theme/icon-cover-cancel"
onTriggered: {
Expand Down
52 changes: 43 additions & 9 deletions src/qml/SettingsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* Copyright (C) 2013 Lucien XU <sfietkonstantin@free.fr>
* Copyright (C) 2016 Andrey Kozhevnikov <coderusinbox@gmail.com>
* Copyright (c) 2021-2023 Patchmanager for SailfishOS contributors:
* Copyright (c) 2021-2025 Patchmanager for SailfishOS contributors:
* - olf "Olf0" <https://github.com/Olf0>
* - Peter G. "nephros" <sailfish@nephros.org>
* - Vlad G. "b100dian" <https://github.com/b100dian>
Expand Down Expand Up @@ -71,6 +71,12 @@ Page {
property bool showUpdatesOnly: true
}

ConfigurationValue {
id: dialogConf
key: "/org/SfietKonstantin/patchmanager/dialog/timeout"
defaultValue: 10
}

SilicaFlickable {
id: flick
anchors.fill: parent
Expand All @@ -95,14 +101,6 @@ Page {
automaticCheck: false
}

TextSwitch {
text: qsTranslate("", "Activate enabled Patches when booting")
description: qsTranslate("", "Automatically activate all enabled Patches when SailfishOS starts.")
checked: PatchManager.applyOnBoot
onClicked: PatchManager.applyOnBoot = !PatchManager.applyOnBoot
automaticCheck: false
}

TextSwitch {
text: qsTranslate("", "Show 'Disable and deactivate all Patches' pulley menu entry")
description: qsTranslate("", "Enable an additional pulley menu entry for Patchmanager's main page to disable and deactivate all Patches.")
Expand All @@ -119,6 +117,42 @@ Page {
automaticCheck: false
}

SectionHeader { text: qsTranslate("", "Startup Activation") }

TextSwitch {
text: qsTranslate("", "Activate Patches on first login")
description: qsTranslate("", "Automatically activate all enabled Patches after Home Screen has been started for the first time.")
checked: !PatchManager.applyOnBoot
onClicked: PatchManager.applyOnBoot = !PatchManager.applyOnBoot
automaticCheck: false
}

Slider {
anchors {
leftMargin: Theme.paddingLarge*2 // align to TextSwitch labels
right: parent.right
left: parent.left
}
enabled: !PatchManager.applyOnBoot
opacity: enabled ? 1.0 : Theme.opacityLow
Behavior on opacity { FadeAnimation{} }
label: qsTranslate("", "Activation Delay")
valueText: qsTranslate("", "%1 seconds").arg(sliderValue)
minimumValue: 5
maximumValue: 120
stepSize: 5
value: dialogConf.value
onSliderValueChanged: dialogConf.value = sliderValue
}

TextSwitch {
text: qsTranslate("", "Activate Patches when booting")
description: qsTranslate("", "Automatically activate all enabled Patches when SailfishOS starts.")
checked: PatchManager.applyOnBoot
onClicked: PatchManager.applyOnBoot = !PatchManager.applyOnBoot
automaticCheck: false
}

SectionHeader { text: qsTranslate("", "Advanced") }

ComboBox {
Expand Down