From c18ea2704ba5b9f37845d99e7d3bd2e258d33476 Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 28 Feb 2021 14:43:52 -0400 Subject: [PATCH] PushRuleSettingsPopup: spinner while saving/rming --- .../PushRuleSettingsPopup/PushRuleSettingsPopup.qml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/Popups/PushRuleSettingsPopup/PushRuleSettingsPopup.qml b/src/gui/Popups/PushRuleSettingsPopup/PushRuleSettingsPopup.qml index 881110b3..5d1534b1 100644 --- a/src/gui/Popups/PushRuleSettingsPopup/PushRuleSettingsPopup.qml +++ b/src/gui/Popups/PushRuleSettingsPopup/PushRuleSettingsPopup.qml @@ -17,6 +17,9 @@ HFlickableColumnPopup { property var rule property bool ruleExists: true + property string saveFutureId: "" + property string removeFutureId: "" + readonly property bool generalChecked: overrideRadio.checked || underrideRadio.checked @@ -61,12 +64,14 @@ HFlickableColumnPopup { actions, ] - py.callClientCoro(userId, "edit_pushrule", args, root.close) + saveFutureId = + py.callClientCoro(userId, "edit_pushrule", args, root.close) } function remove() { const args = [rule.kind, rule.rule_id] - py.callClientCoro(userId, "remove_pushrule", args, root.close) + removeFutureId = + py.callClientCoro(userId, "remove_pushrule", args, root.close) } page.implicitWidth: Math.min(maximumPreferredWidth, 550 * theme.uiScale) @@ -75,6 +80,7 @@ HFlickableColumnPopup { ApplyButton { text: qsTr("Save changes") enabled: true // TODO + loading: saveFutureId !== "" onClicked: root.save() } @@ -87,6 +93,7 @@ HFlickableColumnPopup { icon.name: "pushrule-remove" text: qsTr("Remove rule") enabled: ! root.rule.default + loading: removeFutureId !== "" onClicked: root.remove() } }