diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-09-18 23:15:06 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-10-09 14:08:59 +0200 |
| commit | 2f1f04b3e80beaf2c7f333a14cb7e14eeafe935e (patch) | |
| tree | 8595300e969dc7510804ea26e7d15d2d2e5ea7b7 /libdino/src/entity/settings.vala | |
| parent | be7e0c2d5689d962fd2424e60ed21062d0674e95 (diff) | |
Make send button settings-selectable
Diffstat (limited to 'libdino/src/entity/settings.vala')
| -rw-r--r-- | libdino/src/entity/settings.vala | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libdino/src/entity/settings.vala b/libdino/src/entity/settings.vala index 716c5f7d..2e0bce1b 100644 --- a/libdino/src/entity/settings.vala +++ b/libdino/src/entity/settings.vala @@ -13,6 +13,8 @@ public class Settings : Object { convert_utf8_smileys_ = col_to_bool_or_default("convert_utf8_smileys", true); check_spelling = col_to_bool_or_default("check_spelling", true); 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); } private bool col_to_bool_or_default(string key, bool def) { @@ -98,6 +100,32 @@ public class Settings : Object { default_encryption_ = value; } } + + public signal void send_button_update(bool visible); + private bool send_button_; + public bool send_button { + get { return send_button_; } + set { + db.settings.upsert() + .value(db.settings.key, "send_button", true) + .value(db.settings.value, value.to_string()) + .perform(); + send_button_ = value; + send_button_update(value); + } + } + + private bool enter_newline_; + public bool enter_newline { + get { return enter_newline_; } + set { + db.settings.upsert() + .value(db.settings.key, "enter_newline", true) + .value(db.settings.value, value.to_string()) + .perform(); + enter_newline_ = value; + } + } } } |
