mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-17 15:46:44 +00:00
GODT-1320: Add loading property to each action within a notification
This commit is contained in:
@ -110,7 +110,7 @@ Dialog {
|
|||||||
|
|
||||||
secondary: index > 0
|
secondary: index > 0
|
||||||
|
|
||||||
loading: notification.loading
|
loading: modelData.loading
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,6 @@ QtObject {
|
|||||||
|
|
||||||
property bool dismissed: false
|
property bool dismissed: false
|
||||||
property bool active: false
|
property bool active: false
|
||||||
property bool loading: false
|
|
||||||
readonly property var occurred: active ? new Date() : undefined
|
readonly property var occurred: active ? new Date() : undefined
|
||||||
|
|
||||||
property var data
|
property var data
|
||||||
|
|||||||
@ -353,6 +353,7 @@ QtObject {
|
|||||||
|
|
||||||
action: [
|
action: [
|
||||||
Action {
|
Action {
|
||||||
|
id: disableBeta_remindLater
|
||||||
text: qsTr("Remind me later")
|
text: qsTr("Remind me later")
|
||||||
|
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
@ -360,10 +361,12 @@ QtObject {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
Action {
|
Action {
|
||||||
|
id: disableBeta_disable
|
||||||
text: qsTr("Disable and restart")
|
text: qsTr("Disable and restart")
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
root.backend.toggleBeta(false)
|
root.backend.toggleBeta(false)
|
||||||
root.disableBeta.loading = true
|
disableBeta_disable.loading = true
|
||||||
|
disableBeta_remindLater.enabled = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -647,21 +650,26 @@ QtObject {
|
|||||||
target: (root && root.enableSplitMode && root.enableSplitMode.user ) ? root.enableSplitMode.user : null
|
target: (root && root.enableSplitMode && root.enableSplitMode.user ) ? root.enableSplitMode.user : null
|
||||||
onToggleSplitModeFinished: {
|
onToggleSplitModeFinished: {
|
||||||
root.enableSplitMode.active = false
|
root.enableSplitMode.active = false
|
||||||
root.enableSplitMode.loading = false
|
|
||||||
|
enableSplitMode_enable.loading = false
|
||||||
|
enableSplitMode_cancel.enabled = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
action: [
|
action: [
|
||||||
Action {
|
Action {
|
||||||
|
id: enableSplitMode_cancel
|
||||||
text: qsTr("Cancel")
|
text: qsTr("Cancel")
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
root.enableSplitMode.active = false
|
root.enableSplitMode.active = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Action {
|
Action {
|
||||||
|
id: enableSplitMode_enable
|
||||||
text: qsTr("Enable split mode")
|
text: qsTr("Enable split mode")
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
root.enableSplitMode.loading = true
|
enableSplitMode_enable.loading = true
|
||||||
|
enableSplitMode_cancel.enabled = false
|
||||||
root.enableSplitMode.user.toggleSplitMode(true)
|
root.enableSplitMode.user.toggleSplitMode(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -686,21 +694,26 @@ QtObject {
|
|||||||
target: root.backend
|
target: root.backend
|
||||||
onChangeLocalCacheFinished: {
|
onChangeLocalCacheFinished: {
|
||||||
root.disableLocalCache.active = false
|
root.disableLocalCache.active = false
|
||||||
root.disableLocalCache.loading = false
|
|
||||||
|
disableLocalCache_disable.loading = false
|
||||||
|
disableLocalCache_cancel.enabled = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
action: [
|
action: [
|
||||||
Action {
|
Action {
|
||||||
|
id: disableLocalCache_cancel
|
||||||
text: qsTr("Cancel")
|
text: qsTr("Cancel")
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
root.disableLocalCache.active = false
|
root.disableLocalCache.active = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Action {
|
Action {
|
||||||
|
id: disableLocalCache_disable
|
||||||
text: qsTr("Disable and restart")
|
text: qsTr("Disable and restart")
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
root.disableLocalCache.loading = true
|
disableLocalCache_disable.loading = true
|
||||||
|
disableLocalCache_cancel.enabled = false
|
||||||
root.backend.changeLocalCache(false, root.backend.diskCachePath)
|
root.backend.changeLocalCache(false, root.backend.diskCachePath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -728,19 +741,24 @@ QtObject {
|
|||||||
target: root.backend
|
target: root.backend
|
||||||
onChangeLocalCacheFinished: {
|
onChangeLocalCacheFinished: {
|
||||||
root.enableLocalCache.active = false
|
root.enableLocalCache.active = false
|
||||||
root.enableLocalCache.loading = false
|
|
||||||
|
enableLocalCache_enable.loading = false
|
||||||
|
enableLocalCache_cancel.enabled = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
action: [
|
action: [
|
||||||
Action {
|
Action {
|
||||||
|
id: enableLocalCache_enable
|
||||||
text: qsTr("Enable and restart")
|
text: qsTr("Enable and restart")
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
root.enableLocalCache.loading = true
|
enableLocalCache_enable.loading = true
|
||||||
|
enableLocalCache_cancel.enabled = false
|
||||||
root.backend.changeLocalCache(true, root.enableLocalCache.path)
|
root.backend.changeLocalCache(true, root.enableLocalCache.path)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Action {
|
Action {
|
||||||
|
id: enableLocalCache_cancel
|
||||||
text: qsTr("Cancel")
|
text: qsTr("Cancel")
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
root.enableLocalCache.active = false
|
root.enableLocalCache.active = false
|
||||||
@ -769,21 +787,26 @@ QtObject {
|
|||||||
target: root.backend
|
target: root.backend
|
||||||
onResetFinished: {
|
onResetFinished: {
|
||||||
root.resetBridge.active = false
|
root.resetBridge.active = false
|
||||||
root.resetBridge.loading = false
|
|
||||||
|
resetBridge_reset.loading = false
|
||||||
|
resetBridge_cancel.enabled = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
action: [
|
action: [
|
||||||
Action {
|
Action {
|
||||||
|
id: resetBridge_cancel
|
||||||
text: qsTr("Cancel")
|
text: qsTr("Cancel")
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
root.resetBridge.active = false
|
root.resetBridge.active = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Action {
|
Action {
|
||||||
|
id: resetBridge_reset
|
||||||
text: qsTr("Reset and restart")
|
text: qsTr("Reset and restart")
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
root.resetBridge.loading = true
|
resetBridge_reset.loading = true
|
||||||
|
resetBridge_cancel.enabled = false
|
||||||
root.backend.triggerReset()
|
root.backend.triggerReset()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
23
internal/frontend/qml/Proton/Action.qml
Normal file
23
internal/frontend/qml/Proton/Action.qml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
// Copyright (c) 2021 Proton Technologies AG
|
||||||
|
//
|
||||||
|
// This file is part of ProtonMail Bridge.
|
||||||
|
//
|
||||||
|
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import QtQuick 2.12
|
||||||
|
import QtQuick.Templates 2.12 as T
|
||||||
|
|
||||||
|
T.Action {
|
||||||
|
property bool loading
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user