diff options
Diffstat (limited to 'plugins/omemo/src/ui/encryption_preferences_entry.vala')
| -rw-r--r-- | plugins/omemo/src/ui/encryption_preferences_entry.vala | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/plugins/omemo/src/ui/encryption_preferences_entry.vala b/plugins/omemo/src/ui/encryption_preferences_entry.vala index 42b5d0aa..b620b320 100644 --- a/plugins/omemo/src/ui/encryption_preferences_entry.vala +++ b/plugins/omemo/src/ui/encryption_preferences_entry.vala @@ -36,10 +36,8 @@ public class OmemoPreferencesWidget : Adw.PreferencesGroup { private Store store; private Set<uint32> displayed_ids = new HashSet<uint32>(); - [GtkChild] private unowned Adw.ActionRow automatically_accept_new_row; - [GtkChild] private Switch automatically_accept_new_switch; - [GtkChild] private unowned Adw.ActionRow encrypt_by_default_row; - [GtkChild] private Switch encrypt_by_default_switch; + [GtkChild] private unowned Adw.SwitchRow automatically_accept_new_row; + [GtkChild] private unowned Adw.SwitchRow encrypt_by_default_row; [GtkChild] private unowned Label new_keys_label; [GtkChild] private unowned Adw.PreferencesGroup keys_preferences_group; @@ -71,12 +69,12 @@ public class OmemoPreferencesWidget : Adw.PreferencesGroup { return; } - automatically_accept_new_switch.set_active(plugin.db.trust.get_blind_trust(identity_id, jid.bare_jid.to_string(), true)); - automatically_accept_new_switch.state_set.connect(on_auto_accept_toggled); + automatically_accept_new_row.active = plugin.db.trust.get_blind_trust(identity_id, jid.bare_jid.to_string(), true); + automatically_accept_new_row.notify["active"].connect((obj, _) => { on_auto_accept_toggled(((Adw.SwitchRow) obj).active); }); encrypt_by_default_row.visible = account.bare_jid.equals_bare(jid); - encrypt_by_default_switch.set_active(plugin.app.settings.get_default_encryption(account) != Encryption.NONE); - encrypt_by_default_switch.state_set.connect(on_omemo_by_default_toggled); + encrypt_by_default_row.active = plugin.app.settings.get_default_encryption(account) != Encryption.NONE; + encrypt_by_default_row.notify["active"].connect((obj, _) => { on_omemo_by_default_toggled(((Adw.SwitchRow) obj).active); }); Dino.Application? app = Application.get_default() as Dino.Application; if (app != null) { @@ -269,7 +267,7 @@ public class OmemoPreferencesWidget : Adw.PreferencesGroup { case TrustLevel.VERIFIED: plugin.trust_manager.set_device_trust(account, jid, device[plugin.db.identity_meta.device_id], TrustLevel.VERIFIED); plugin.trust_manager.set_blind_trust(account, jid, false); - automatically_accept_new_switch.set_active(false); + automatically_accept_new_row.active = false; break; } } |
