diff --git a/data/gschemas.compiled b/data/gschemas.compiled new file mode 100644 index 000000000..288e385c3 Binary files /dev/null and b/data/gschemas.compiled differ diff --git a/data/io.elementary.mail.gschema.xml b/data/io.elementary.mail.gschema.xml index 0453634e9..d80f94910 100644 --- a/data/io.elementary.mail.gschema.xml +++ b/data/io.elementary.mail.gschema.xml @@ -32,6 +32,16 @@ Whether to always load remote images without prompting Whether to always load remote images without prompting + + false + Whether to hide read conversations in the list + Stores the last used state of the “Hide read conversations” filter + + + false + Whether to hide unstarred conversations in the list + Stores the last used state of the “Hide unstarred conversations” filter + [] A list of sender addresses for which remote images will be automatically loaded @@ -51,4 +61,3 @@ - diff --git a/src/ConversationList/ConversationList.vala b/src/ConversationList/ConversationList.vala index 2c3159db7..8eaac42e2 100644 --- a/src/ConversationList/ConversationList.vala +++ b/src/ConversationList/ConversationList.vala @@ -88,7 +88,6 @@ public class Mail.ConversationList : Gtk.Box { }; hide_read_switch = new Granite.SwitchModelButton (_("Hide read conversations")); - hide_unstarred_switch = new Granite.SwitchModelButton (_("Hide unstarred conversations")); var filter_menu_popover_box = new Gtk.Box (VERTICAL, 0) { @@ -203,8 +202,11 @@ public class Mail.ConversationList : Gtk.Box { } }); - hide_read_switch.toggled.connect (() => load_folder.begin (folder_info_per_account)); + var settings = new GLib.Settings ("io.elementary.mail"); + settings.bind ("hide-read-conversations", hide_read_switch, "active", DEFAULT); + settings.bind ("hide-unstarred-conversations", hide_unstarred_switch, "active", DEFAULT); + hide_read_switch.toggled.connect (() => load_folder.begin (folder_info_per_account)); hide_unstarred_switch.toggled.connect (() => load_folder.begin (folder_info_per_account)); } @@ -222,7 +224,7 @@ public class Mail.ConversationList : Gtk.Box { } } - public async void load_folder (Gee.Map folder_info_per_account) { + public async void load_folder (Gee.Map folder_info_per_account) requires (folder_info_per_account != null) { lock (this.folder_info_per_account) { this.folder_info_per_account = folder_info_per_account; }