aboutsummaryrefslogtreecommitdiff
path: root/plugins/omemo/src
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2025-10-05 13:35:41 +0200
committerfiaxh <git@lightrise.org>2025-10-05 17:59:08 +0200
commite14c7d933bfa0bdd97781857b9341854232058a2 (patch)
treee302c07398dad3196a87a99843d9383ef116cb25 /plugins/omemo/src
parent6d8ccb414529c017ef1b8a52499b7bbdb6432adb (diff)
Adjust to Adw 1.4: Use specialized ActionRows
Diffstat (limited to 'plugins/omemo/src')
-rw-r--r--plugins/omemo/src/ui/encryption_preferences_entry.vala16
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;
}
}