aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgor Nemtsev <enemtsev@luxoft.com>2020-01-31 14:40:22 +0300
committerEgor Nemtsev <enemtsev@luxoft.com>2020-01-31 13:48:30 +0000
commita3f5ae361051d5d483df062fadb74804e0db13cf (patch)
tree4b03d33bf655a4a18e75947f7c0c058b588e52b0
parent272912a220ea76597f22c9ddc2a63ebaf1860509 (diff)
[sysui] update widgets state on each change
-- rootstore will save state on almost each change, except "widget order", because ordering is maintained by widgetgrid and this object is located too deep inside objects tree to propagate signals from it Task-number: AUTOSUITE-1439 Change-Id: I9a465c0d8db288bac366faf08f69f68ddbb64cea Reviewed-by: Nikolay Zamotaev <nzamotaev@luxoft.com>
-rw-r--r--imports_system/system/models/application/ApplicationModel.qml5
-rw-r--r--sysui/stores/RootStore.qml3
2 files changed, 8 insertions, 0 deletions
diff --git a/imports_system/system/models/application/ApplicationModel.qml b/imports_system/system/models/application/ApplicationModel.qml
index 58d03889..31e66180 100644
--- a/imports_system/system/models/application/ApplicationModel.qml
+++ b/imports_system/system/models/application/ApplicationModel.qml
@@ -72,6 +72,7 @@ ListModel {
signal applicationPopupAdded(var window)
signal autostartAppsListChanged()
signal autorecoverAppsListChanged()
+ signal widgetStatesChanged()
signal appRemoved(var appInfo);
// Populate the model
@@ -564,6 +565,10 @@ ListModel {
window.application.activated();
d.reactOnAppActivation(window.application.id);
break;
+ case "neptuneState":
+ if (window.windowProperty(name).startsWith("Widget") && root.activeAppInfo === null)
+ root.widgetStatesChanged()
+ break;
}
}
}
diff --git a/sysui/stores/RootStore.qml b/sysui/stores/RootStore.qml
index 173becb5..f489cdfd 100644
--- a/sysui/stores/RootStore.qml
+++ b/sysui/stores/RootStore.qml
@@ -88,6 +88,9 @@ Store {
onAutostartAppsListChanged: { settingsStore.setValue("autostartApps", applicationModel.serializeAutostart()); }
onAutorecoverAppsListChanged: { settingsStore.setValue("autorecoverApps", applicationModel.serializeAutorecover()); }
onApplicationPopupAdded: applicationPopupsStore.appPopupsModel.append({"window":window});
+ onWidgetStatesChanged: {
+ settingsStore.setValue("widgetStates", applicationModel.serializeWidgetStates());
+ }
}
readonly property ApplicationPopupsStore applicationPopupsStore: ApplicationPopupsStore {}