aboutsummaryrefslogtreecommitdiff
path: root/libdino
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-09-18 23:42:07 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-10-09 14:08:59 +0200
commit677ac164a953a90acff60e7b84b0091184f56464 (patch)
treee015357c23ab56326fae4217c25d294b6626b850 /libdino
parent2f1f04b3e80beaf2c7f333a14cb7e14eeafe935e (diff)
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.
Diffstat (limited to 'libdino')
-rw-r--r--libdino/src/entity/settings.vala15
1 files changed, 15 insertions, 0 deletions
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);
+ }
+ }
}
}