From 677ac164a953a90acff60e7b84b0091184f56464 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Mon, 18 Sep 2023 23:42:07 +0200 Subject: Make Ctrl-Q accelerator user-configurable Some devices, such as those using virtual keyboards such as Squeekboard, might find the Ctrl-Q accelerator annoying, as it can be easily mistyped. --- libdino/src/entity/settings.vala | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libdino/src/entity') diff --git a/libdino/src/entity/settings.vala b/libdino/src/entity/settings.vala index 2e0bce1b..42631acf 100644 --- a/libdino/src/entity/settings.vala +++ b/libdino/src/entity/settings.vala @@ -15,6 +15,7 @@ public class Settings : Object { default_encryption = col_to_encryption_or_default("default_encryption", Encryption.OMEMO); send_button = col_to_bool_or_default("send_button", false); enter_newline = col_to_bool_or_default("enter_newline", false); + quit_ctrl_q = col_to_bool_or_default("quit_ctrl_q", true); } private bool col_to_bool_or_default(string key, bool def) { @@ -126,6 +127,20 @@ public class Settings : Object { enter_newline_ = value; } } + + public signal void quit_ctrl_q_update(bool active); + private bool quit_ctrl_q_; + public bool quit_ctrl_q { + get { return quit_ctrl_q_; } + set { + db.settings.upsert() + .value(db.settings.key, "quit_ctrl_q", true) + .value(db.settings.value, value.to_string()) + .perform(); + quit_ctrl_q_ = value; + quit_ctrl_q_update(value); + } + } } } -- cgit v1.2.3