aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/Prefs.qml
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/Prefs.qml')
-rw-r--r--desktop/Prefs.qml19
1 files changed, 18 insertions, 1 deletions
diff --git a/desktop/Prefs.qml b/desktop/Prefs.qml
index 80515a4..f7e841b 100644
--- a/desktop/Prefs.qml
+++ b/desktop/Prefs.qml
@@ -75,6 +75,21 @@ Singleton {
root.write(Object.assign({}, root.doc, { companionBlushFile: p }));
}
+ // The companion's app lines as saved: a map of lowercased window class
+ // to phrases, or null for the defaults in companion/Lines.js. The
+ // Companion phrases page edits it.
+ property var companionApps: null
+ function setCompanionApps(map) {
+ root.companionApps = map;
+ root.write(Object.assign({}, root.doc, { companionApps: map }));
+ }
+ function resetCompanionApps() {
+ root.companionApps = null;
+ const d = Object.assign({}, root.doc);
+ delete d.companionApps;
+ root.write(d);
+ }
+
// The settings window's sidebar width, dragged by its edge.
readonly property int sidebarMin: 160
readonly property int sidebarMax: 420
@@ -137,6 +152,8 @@ Singleton {
const sk = parsed.companionSkirtless;
root.companionSkirtless = Number.isInteger(sk) && sk >= 0 ? sk : 60;
root.companionBlushFile = typeof parsed.companionBlushFile === "string" ? parsed.companionBlushFile : "";
+ const ca = parsed.companionApps;
+ root.companionApps = ca && typeof ca === "object" && !Array.isArray(ca) ? ca : null;
root.ready = true;
}
@@ -152,6 +169,6 @@ Singleton {
onFileChanged: reload()
onLoaded: root.reparse()
// Missing file: the defaults, and nothing written.
- onLoadFailed: { root.doc = {}; root.pinnedIp = ""; root.presets = null; root.settingsSidebar = 200; root.assistantModel = ""; root.companion = true; root.companionBlushFile = ""; root.companionSkirtless = 60; root.ready = true; }
+ onLoadFailed: { root.doc = {}; root.pinnedIp = ""; root.presets = null; root.settingsSidebar = 200; root.assistantModel = ""; root.companion = true; root.companionBlushFile = ""; root.companionSkirtless = 60; root.companionApps = null; root.ready = true; }
}
}