aboutsummaryrefslogtreecommitdiff
path: root/libdino
diff options
context:
space:
mode:
Diffstat (limited to 'libdino')
-rw-r--r--libdino/src/entity/settings.vala28
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;
+ }
+ }
}
}