aboutsummaryrefslogtreecommitdiff
path: root/plugins/omemo/src/ui
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2022-02-14 14:55:59 +0100
committerfiaxh <git@lightrise.org>2022-07-27 20:34:20 +0200
commit7e7dcedaf31ee35499875491c9f569c575d28435 (patch)
tree0c5fee2b28baf320775fbc92b3c252e97d9d054f /plugins/omemo/src/ui
parentf25bfb00969a7e09996da2d5500e6718f4cc0148 (diff)
downloaddino-7e7dcedaf31ee35499875491c9f569c575d28435.tar.gz
dino-7e7dcedaf31ee35499875491c9f569c575d28435.zip
Port from GTK3 to GTK4
Diffstat (limited to 'plugins/omemo/src/ui')
-rw-r--r--plugins/omemo/src/ui/account_settings_entry.vala54
-rw-r--r--plugins/omemo/src/ui/account_settings_widget.vala54
-rw-r--r--plugins/omemo/src/ui/bad_messages_populator.vala6
-rw-r--r--plugins/omemo/src/ui/contact_details_dialog.vala57
-rw-r--r--plugins/omemo/src/ui/contact_details_provider.vala6
-rw-r--r--plugins/omemo/src/ui/device_notification_populator.vala8
-rw-r--r--plugins/omemo/src/ui/encryption_list_entry.vala8
-rw-r--r--plugins/omemo/src/ui/manage_key_dialog.vala28
8 files changed, 103 insertions, 118 deletions
diff --git a/plugins/omemo/src/ui/account_settings_entry.vala b/plugins/omemo/src/ui/account_settings_entry.vala
index 3866febe..8736260b 100644
--- a/plugins/omemo/src/ui/account_settings_entry.vala
+++ b/plugins/omemo/src/ui/account_settings_entry.vala
@@ -1,26 +1,58 @@
+using Dino.Entities;
+using Gtk;
+
namespace Dino.Plugins.Omemo {
public class AccountSettingsEntry : Plugins.AccountSettingsEntry {
private Plugin plugin;
+ private Account account;
+
+ private Box box = new Box(Orientation.HORIZONTAL, 0);
+ private Label fingerprint = new Label("...") { xalign=0 };
+ private Button btn = new Button.from_icon_name("view-list-symbolic") { has_frame=false, valign=Align.CENTER, visible=false };
+
+ public override string id { get { return "omemo_identity_key"; }}
+
+ public override string name { get { return "OMEMO"; }}
public AccountSettingsEntry(Plugin plugin) {
this.plugin = plugin;
- }
- public override string id { get {
- return "omemo_identity_key";
- }}
+ Border border = new Button().get_style_context().get_padding();
+ fingerprint.margin_top = border.top + 1;
+ fingerprint.margin_start = border.left + 1;
+ fingerprint.visible = true;
+ box.append(fingerprint);
- public override string name { get {
- return "OMEMO";
- }}
+ btn.clicked.connect(() => {
+ activated();
+ ContactDetailsDialog dialog = new ContactDetailsDialog(plugin, account, account.bare_jid);
+ dialog.set_transient_for((Window) box.get_root());
+ dialog.present();
+ });
+ // TODO expand=false?
+ box.append(btn);
+ }
+
+ public override Object? get_widget(WidgetType type) {
+ if (type != WidgetType.GTK4) return null;
+ return box;
+ }
- public override Plugins.AccountSettingsWidget? get_widget(WidgetType type) {
- if (type == WidgetType.GTK) {
- return new AccountSettingWidget(plugin);
+ public override void set_account(Account account) {
+ this.account = account;
+ btn.visible = false;
+ Qlite.Row? row = plugin.db.identity.row_with(plugin.db.identity.account_id, account.id).inner;
+ if (row == null) {
+ fingerprint.set_markup("%s\n<span font='8'>%s</span>".printf(_("Own fingerprint"), _("Will be generated on first connection")));
+ } else {
+ string res = fingerprint_markup(fingerprint_from_base64(((!)row)[plugin.db.identity.identity_key_public_base64]));
+ fingerprint.set_markup("%s\n<span font_family='monospace' font='8'>%s</span>".printf(_("Own fingerprint"), res));
+ btn.visible = true;
}
- return null;
}
+
+ public override void deactivate() { }
}
} \ No newline at end of file
diff --git a/plugins/omemo/src/ui/account_settings_widget.vala b/plugins/omemo/src/ui/account_settings_widget.vala
deleted file mode 100644
index cc562221..00000000
--- a/plugins/omemo/src/ui/account_settings_widget.vala
+++ /dev/null
@@ -1,54 +0,0 @@
-using Gtk;
-using Dino.Entities;
-
-namespace Dino.Plugins.Omemo {
-
-public class AccountSettingWidget : Plugins.AccountSettingsWidget, Box {
- private Plugin plugin;
- private Label fingerprint;
- private Account account;
- private Button btn;
-
- public AccountSettingWidget(Plugin plugin) {
- this.plugin = plugin;
-
- fingerprint = new Label("...");
- fingerprint.xalign = 0;
- Border border = new Button().get_style_context().get_padding(StateFlags.NORMAL);
- fingerprint.margin_top = border.top + 1;
- fingerprint.margin_start = border.left + 1;
- fingerprint.visible = true;
- pack_start(fingerprint);
-
- btn = new Button();
- btn.image = new Image.from_icon_name("view-list-symbolic", IconSize.BUTTON);
- btn.relief = ReliefStyle.NONE;
- btn.visible = false;
- btn.valign = Align.CENTER;
- btn.clicked.connect(() => {
- activated();
- ContactDetailsDialog dialog = new ContactDetailsDialog(plugin, account, account.bare_jid);
- dialog.set_transient_for((Window) get_toplevel());
- dialog.present();
- });
- pack_start(btn, false);
- }
-
- public void set_account(Account account) {
- this.account = account;
- btn.visible = false;
- Qlite.Row? row = plugin.db.identity.row_with(plugin.db.identity.account_id, account.id).inner;
- if (row == null) {
- fingerprint.set_markup("%s\n<span font='8'>%s</span>".printf(_("Own fingerprint"), _("Will be generated on first connection")));
- } else {
- string res = fingerprint_markup(fingerprint_from_base64(((!)row)[plugin.db.identity.identity_key_public_base64]));
- fingerprint.set_markup("%s\n<span font_family='monospace' font='8'>%s</span>".printf(_("Own fingerprint"), res));
- btn.visible = true;
- }
- }
-
- public void deactivate() {
- }
-}
-
-}
diff --git a/plugins/omemo/src/ui/bad_messages_populator.vala b/plugins/omemo/src/ui/bad_messages_populator.vala
index bd2474f2..ca0bd35d 100644
--- a/plugins/omemo/src/ui/bad_messages_populator.vala
+++ b/plugins/omemo/src/ui/bad_messages_populator.vala
@@ -123,7 +123,7 @@ public class BadMessageItem : Plugins.MetaConversationItem {
this.badness_type = badness_type;
}
- public override Object? get_widget(Plugins.WidgetType widget_type) {
+ public override Object? get_widget(Plugins.ConversationItemWidgetInterface outer, Plugins.WidgetType widget_type) {
return new BadMessagesWidget(plugin, conversation, problem_jid, badness_type);
}
@@ -161,12 +161,12 @@ public class BadMessagesWidget : Box {
}
Label label = new Label(warning_text) { margin_start=70, margin_end=70, justify=Justification.CENTER, use_markup=true, selectable=true, wrap=true, wrap_mode=Pango.WrapMode.WORD_CHAR, hexpand=true, visible=true };
label.get_style_context().add_class("dim-label");
- this.add(label);
+ this.append(label);
label.activate_link.connect(() => {
if (badness_type == BadnessType.UNTRUSTED) {
ContactDetailsDialog dialog = new ContactDetailsDialog(plugin, conversation.account, jid);
- dialog.set_transient_for((Window) get_toplevel());
+ dialog.set_transient_for((Window) get_root());
dialog.present();
}
diff --git a/plugins/omemo/src/ui/contact_details_dialog.vala b/plugins/omemo/src/ui/contact_details_dialog.vala
index b4d6d8f0..80943824 100644
--- a/plugins/omemo/src/ui/contact_details_dialog.vala
+++ b/plugins/omemo/src/ui/contact_details_dialog.vala
@@ -37,10 +37,12 @@ public class ContactDetailsDialog : Gtk.Dialog {
[GtkChild] private unowned ListBox inactive_keys_listbox;
[GtkChild] private unowned Switch auto_accept_switch;
[GtkChild] private unowned Button copy_button;
- [GtkChild] private unowned Button show_qrcode_button;
+ [GtkChild] private unowned MenuButton show_qrcode_button;
[GtkChild] private unowned Image qrcode_image;
[GtkChild] private unowned Popover qrcode_popover;
+ private ArrayList<Widget> new_keys_listbox_children = new ArrayList<Widget>();
+
construct {
// If we set the strings in the .ui file, they don't get translated
title = _("OMEMO Key Management");
@@ -59,7 +61,7 @@ public class ContactDetailsDialog : Gtk.Dialog {
this.jid = jid;
if (Environment.get_variable("GTK_CSD") != "0") {
- ((HeaderBar) get_header_bar()).set_subtitle(jid.bare_jid.to_string());
+// ((HeaderBar) get_header_bar()).set_subtitle(jid.bare_jid.to_string());
}
keys_listbox.row_activated.connect(on_key_entry_clicked);
@@ -89,7 +91,7 @@ public class ContactDetailsDialog : Gtk.Dialog {
string fingerprint = fingerprint_from_base64(own_b64);
own_fingerprint_label.set_markup(fingerprint_markup(fingerprint));
- copy_button.clicked.connect(() => {Clipboard.get_default(get_display()).set_text(fingerprint, fingerprint.length);});
+ copy_button.clicked.connect(() => { copy_button.get_clipboard().set_text(fingerprint); });
int sid = plugin.db.identity.row_with(plugin.db.identity.account_id, account.id)[plugin.db.identity.device_id];
var iri_query = @"omemo-sid-$(sid)=$(fingerprint)";
@@ -104,12 +106,12 @@ public class ContactDetailsDialog : Gtk.Dialog {
const int MODULE_SIZE_PX = 4; // arbitrary
var qr_pixbuf = new QRcode(iri, 2)
.to_pixbuf(MODULE_SIZE_PX * qrcode_image.scale_factor);
- qrcode_image.set_from_surface(
- Gdk.cairo_surface_create_from_pixbuf(qr_pixbuf,0,get_window()));
- qrcode_image.margin = QUIET_ZONE_MODULES*MODULE_SIZE_PX;
+ qrcode_image.set_from_pixbuf(qr_pixbuf);
+ qrcode_image.margin_top = qrcode_image.margin_end =
+ qrcode_image.margin_bottom = qrcode_image.margin_start = QUIET_ZONE_MODULES*MODULE_SIZE_PX;
qrcode_popover.get_style_context().add_class("qrcode-container");
- show_qrcode_button.clicked.connect(qrcode_popover.popup);
+ show_qrcode_button.popover = qrcode_popover;
}
new_keys_listbox.set_header_func(header_function);
@@ -196,10 +198,10 @@ public class ContactDetailsDialog : Gtk.Dialog {
if (device[plugin.db.identity_meta.now_active]) {
keys_container.visible = true;
- keys_listbox.add(fingerprint_row);
+ keys_listbox.append(fingerprint_row);
} else {
inactive_keys_expander.visible=true;
- inactive_keys_listbox.add(fingerprint_row);
+ inactive_keys_listbox.append(fingerprint_row);
}
displayed_ids.add(device[plugin.db.identity_meta.device_id]);
}
@@ -210,7 +212,7 @@ public class ContactDetailsDialog : Gtk.Dialog {
Row updated_device = plugin.db.identity_meta.get_device(fingerprint_row.row[plugin.db.identity_meta.identity_id], fingerprint_row.row[plugin.db.identity_meta.address_name], fingerprint_row.row[plugin.db.identity_meta.device_id]);
ManageKeyDialog manage_dialog = new ManageKeyDialog(updated_device, plugin.db);
- manage_dialog.set_transient_for((Gtk.Window) get_toplevel());
+ manage_dialog.set_transient_for((Gtk.Window) get_root());
manage_dialog.present();
manage_dialog.response.connect((response) => {
fingerprint_row.update_trust_state(response, fingerprint_row.row[plugin.db.identity_meta.now_active]);
@@ -257,12 +259,12 @@ public class ContactDetailsDialog : Gtk.Dialog {
Box box = new Box(Gtk.Orientation.HORIZONTAL, 40) { visible = true, margin_start = 20, margin_end = 20, margin_top = 14, margin_bottom = 14, hexpand = true };
Button accept_button = new Button() { visible = true, valign = Align.CENTER, hexpand = true };
- accept_button.add(new Image.from_icon_name("emblem-ok-symbolic", IconSize.BUTTON) { visible=true }); // using .image = sets .image-button. Together with .suggested/destructive action that breaks the button Adwaita
+ accept_button.set_icon_name("emblem-ok-symbolic"); // using .image = sets .image-button. Together with .suggested/destructive action that breaks the button Adwaita
accept_button.get_style_context().add_class("suggested-action");
accept_button.tooltip_text = _("Accept key");
Button reject_button = new Button() { visible = true, valign = Align.CENTER, hexpand = true };
- reject_button.add(new Image.from_icon_name("action-unavailable-symbolic", IconSize.BUTTON) { visible=true });
+ reject_button.set_icon_name("action-unavailable-symbolic");
reject_button.get_style_context().add_class("destructive-action");
reject_button.tooltip_text = _("Reject key");
@@ -270,35 +272,38 @@ public class ContactDetailsDialog : Gtk.Dialog {
plugin.trust_manager.set_device_trust(account, jid, device[plugin.db.identity_meta.device_id], TrustLevel.TRUSTED);
add_fingerprint(device, TrustLevel.TRUSTED);
new_keys_listbox.remove(lbr);
- if (new_keys_listbox.get_children().length() < 1) new_keys_container.visible = false;
+ new_keys_listbox_children.remove(lbr);
+ if (new_keys_listbox_children.size < 1) new_keys_container.visible = false;
});
reject_button.clicked.connect(() => {
plugin.trust_manager.set_device_trust(account, jid, device[plugin.db.identity_meta.device_id], TrustLevel.UNTRUSTED);
add_fingerprint(device, TrustLevel.UNTRUSTED);
new_keys_listbox.remove(lbr);
- if (new_keys_listbox.get_children().length() < 1) new_keys_container.visible = false;
+ new_keys_listbox_children.remove(lbr);
+ if (new_keys_listbox_children.size < 1) new_keys_container.visible = false;
});
string res = fingerprint_markup(fingerprint_from_base64(device[plugin.db.identity_meta.identity_key_public_base64]));
Label fingerprint_label = new Label(res) { use_markup=true, justify=Justification.RIGHT, visible=true, halign = Align.START, valign = Align.CENTER, hexpand = false };
- box.add(fingerprint_label);
+ box.append(fingerprint_label);
Box control_box = new Box(Gtk.Orientation.HORIZONTAL, 0) { visible = true, hexpand = true };
- control_box.add(accept_button);
- control_box.add(reject_button);
+ control_box.append(accept_button);
+ control_box.append(reject_button);
control_box.get_style_context().add_class("linked"); // .linked: Visually link the accept / reject buttons
- box.add(control_box);
+ box.append(control_box);
- lbr.add(box);
- new_keys_listbox.add(lbr);
+ lbr.set_child(box);
+ new_keys_listbox.append(lbr);
+ new_keys_listbox_children.add(lbr);
displayed_ids.add(device[plugin.db.identity_meta.device_id]);
}
}
public class FingerprintRow : ListBoxRow {
- private Image trust_image = new Image() { visible = true, halign = Align.END, icon_size = IconSize.BUTTON };
+ private Image trust_image = new Image() { visible = true, halign = Align.END };
private Label fingerprint_label = new Label("") { use_markup=true, justify=Justification.RIGHT, visible=true, halign = Align.START, valign = Align.CENTER, hexpand = false };
private Label trust_label = new Label(null) { visible = true, hexpand = true, xalign = 0 };
@@ -308,13 +313,13 @@ public class FingerprintRow : ListBoxRow {
Box box = new Box(Gtk.Orientation.HORIZONTAL, 40) { visible = true, margin_start = 20, margin_end = 20, margin_top = 14, margin_bottom = 14, hexpand = true };
Box status_box = new Box(Gtk.Orientation.HORIZONTAL, 5) { visible = true, hexpand = true };
- box.add(fingerprint_label);
- box.add(status_box);
+ box.append(fingerprint_label);
+ box.append(status_box);
- status_box.add(trust_label);
- status_box.add(trust_image);
+ status_box.append(trust_label);
+ status_box.append(trust_image);
- this.add(box);
+ this.set_child(box);
}
public FingerprintRow(Row row, string key_base64, int trust, bool now_active) {
diff --git a/plugins/omemo/src/ui/contact_details_provider.vala b/plugins/omemo/src/ui/contact_details_provider.vala
index 7250d135..822294cc 100644
--- a/plugins/omemo/src/ui/contact_details_provider.vala
+++ b/plugins/omemo/src/ui/contact_details_provider.vala
@@ -15,7 +15,7 @@ public class ContactDetailsProvider : Plugins.ContactDetailsProvider, Object {
}
public void populate(Conversation conversation, Plugins.ContactDetails contact_details, WidgetType type) {
- if (conversation.type_ == Conversation.Type.CHAT && type == WidgetType.GTK) {
+ if (conversation.type_ == Conversation.Type.CHAT && type == WidgetType.GTK4) {
int identity_id = plugin.db.identity.get_id(conversation.account.id);
if (identity_id < 0) return;
@@ -28,11 +28,11 @@ public class ContactDetailsProvider : Plugins.ContactDetailsProvider, Object {
}
if (i > 0) {
- Button btn = new Button.from_icon_name("view-list-symbolic") { visible = true, valign = Align.CENTER, relief = ReliefStyle.NONE };
+ Button btn = new Button.from_icon_name("view-list-symbolic") { visible = true, valign = Align.CENTER, has_frame = false };
btn.clicked.connect(() => {
btn.activate();
ContactDetailsDialog dialog = new ContactDetailsDialog(plugin, conversation.account, conversation.counterpart);
- dialog.set_transient_for((Window) btn.get_toplevel());
+ dialog.set_transient_for((Window) btn.get_root());
dialog.response.connect((response_type) => {
plugin.device_notification_populator.should_hide();
});
diff --git a/plugins/omemo/src/ui/device_notification_populator.vala b/plugins/omemo/src/ui/device_notification_populator.vala
index 2f276f2b..9f40353d 100644
--- a/plugins/omemo/src/ui/device_notification_populator.vala
+++ b/plugins/omemo/src/ui/device_notification_populator.vala
@@ -70,18 +70,18 @@ private class ConversationNotification : MetaConversationNotification {
this.account = account;
Box box = new Box(Orientation.HORIZONTAL, 5) { visible=true };
- Button manage_button = new Button() { label=_("Manage"), visible=true };
+ Button manage_button = new Button.with_label(_("Manage")) { visible=true };
manage_button.clicked.connect(() => {
manage_button.activate();
ContactDetailsDialog dialog = new ContactDetailsDialog(plugin, account, jid);
- dialog.set_transient_for((Window) manage_button.get_toplevel());
+ dialog.set_transient_for((Window) manage_button.get_root());
dialog.response.connect((response_type) => {
should_hide();
});
dialog.present();
});
- box.add(new Label(_("This contact has new devices")) { margin_end=10, visible=true });
- box.add(manage_button);
+ box.append(new Label(_("This contact has new devices")) { margin_end=10, visible=true });
+ box.append(manage_button);
widget = box;
}
diff --git a/plugins/omemo/src/ui/encryption_list_entry.vala b/plugins/omemo/src/ui/encryption_list_entry.vala
index a0e6bb0f..b262ef81 100644
--- a/plugins/omemo/src/ui/encryption_list_entry.vala
+++ b/plugins/omemo/src/ui/encryption_list_entry.vala
@@ -22,9 +22,11 @@ public class EncryptionListEntry : Plugins.EncryptionListEntry, Object {
return "OMEMO";
}}
- public static IconSize ICON_SIZE_HEADER = Gtk.icon_size_register("im.dino.Dino.HEADER_ICON2", 17, 12);
-
public Object? get_encryption_icon(Entities.Conversation conversation, ContentItem content_item) {
+ return null;
+ }
+
+ public string? get_encryption_icon_name(Entities.Conversation conversation, ContentItem content_item) {
if (content_item.encryption != encryption) return null;
RowOption row = db.content_item_meta.select( { db.identity_meta.trust_level } ).with(db.content_item_meta.content_item_id, "=", content_item.id)
@@ -33,7 +35,7 @@ public class EncryptionListEntry : Plugins.EncryptionListEntry, Object {
if (row.is_present() && (TrustLevel) row[db.identity_meta.trust_level] == TrustLevel.VERIFIED) {
- return new Image.from_icon_name("dino-security-high-symbolic", ICON_SIZE_HEADER) { opacity=0.4, visible = true };
+ return "dino-security-high-symbolic";
}
return null;
}
diff --git a/plugins/omemo/src/ui/manage_key_dialog.vala b/plugins/omemo/src/ui/manage_key_dialog.vala
index 9bdaaaee..a4b61f70 100644
--- a/plugins/omemo/src/ui/manage_key_dialog.vala
+++ b/plugins/omemo/src/ui/manage_key_dialog.vala
@@ -32,7 +32,7 @@ public class ManageKeyDialog : Gtk.Dialog {
construct {
// If we set the strings in the .ui file, they don't get translated
- headerbar.title = _("Manage Key");
+ this.title = _("Manage Key");
compare_fingerprint_label.label = _("Compare the fingerprint, character by character, with the one shown on your contact's device.");
verify_no_button.label = _("Fingerprints differ");
verify_yes_button.label = _("Fingerprints match");
@@ -56,7 +56,7 @@ public class ManageKeyDialog : Gtk.Dialog {
});
verify_yes_button.clicked.connect(() => {
- confirm_image.set_from_icon_name("security-high-symbolic", IconSize.DIALOG);
+ confirm_image.set_from_icon_name("security-high-symbolic");
confirm_title_label.label = _("Verify key");
confirm_desc_label.set_markup(_("Future messages sent by %s from the device that uses this key will be highlighted accordingly in the chat window.").printf(@"<b>$(device[db.identity_meta.address_name])</b>"));
manage_stack.set_visible_child_name("confirm");
@@ -67,7 +67,7 @@ public class ManageKeyDialog : Gtk.Dialog {
verify_no_button.clicked.connect(() => {
return_to_main = false;
- confirm_image.set_from_icon_name("dialog-warning-symbolic", IconSize.DIALOG);
+ confirm_image.set_from_icon_name("dialog-warning-symbolic");
confirm_title_label.label = _("Fingerprints do not match");
confirm_desc_label.set_markup(_("Please verify that you are comparing the correct fingerprint. If fingerprints do not match, %s's account may be compromised and you should consider rejecting this key.").printf(@"<b>$(device[db.identity_meta.address_name])</b>"));
manage_stack.set_visible_child_name("confirm");
@@ -107,8 +107,8 @@ public class ManageKeyDialog : Gtk.Dialog {
lbl_desc.attributes = desc_attrs;
lbl_desc.get_style_context().add_class("dim-label");
- box.add(lbl_title);
- box.add(lbl_desc);
+ box.append(lbl_title);
+ box.append(lbl_desc);
return box;
}
@@ -121,25 +121,25 @@ public class ManageKeyDialog : Gtk.Dialog {
});
ListBoxRow verify_row = new ListBoxRow() { visible = true };
- verify_row.add(make_action_box(_("Verify key fingerprint"), _("Compare this key's fingerprint with the fingerprint displayed on the contact's device.")));
+ verify_row.set_child(make_action_box(_("Verify key fingerprint"), _("Compare this key's fingerprint with the fingerprint displayed on the contact's device.")));
ListBoxRow reject_row = new ListBoxRow() { visible = true };
- reject_row.add(make_action_box(_("Reject key"), _("Block encrypted communication with the contact's device that uses this key.")));
+ reject_row.set_child(make_action_box(_("Reject key"), _("Block encrypted communication with the contact's device that uses this key.")));
ListBoxRow accept_row = new ListBoxRow() {visible = true };
- accept_row.add(make_action_box(_("Accept key"), _("Allow encrypted communication with the contact's device that uses this key.")));
+ accept_row.set_child(make_action_box(_("Accept key"), _("Allow encrypted communication with the contact's device that uses this key.")));
switch((TrustLevel) device[db.identity_meta.trust_level]) {
case TrustLevel.TRUSTED:
main_desc_label.set_markup(_("This key is currently %s.").printf("<span color='#1A63D9'>"+_("accepted")+"</span>")+" "+_("This means it can be used by %s to receive and send encrypted messages.").printf(@"<b>$(device[db.identity_meta.address_name])</b>"));
- main_action_list.add(verify_row);
- main_action_list.add(reject_row);
+ main_action_list.append(verify_row);
+ main_action_list.append(reject_row);
break;
case TrustLevel.VERIFIED:
main_desc_label.set_markup(_("This key is currently %s.").printf("<span color='#1A63D9'>"+_("verified")+"</span>")+" "+_("This means it can be used by %s to receive and send encrypted messages.").printf(@"<b>$(device[db.identity_meta.address_name])</b>") + " " + _("Additionally it has been verified to match the key on the contact's device."));
- main_action_list.add(reject_row);
+ main_action_list.append(reject_row);
break;
case TrustLevel.UNTRUSTED:
main_desc_label.set_markup(_("This key is currently %s.").printf("<span color='#D91900'>"+_("rejected")+"</span>")+" "+_("This means it cannot be used by %s to decipher your messages, and you won't see messages encrypted with it.").printf(@"<b>$(device[db.identity_meta.address_name])</b>"));
- main_action_list.add(accept_row);
+ main_action_list.append(accept_row);
break;
}
@@ -148,7 +148,7 @@ public class ManageKeyDialog : Gtk.Dialog {
if(row == verify_row) {
manage_stack.set_visible_child_name("verify");
} else if (row == reject_row) {
- confirm_image.set_from_icon_name("action-unavailable-symbolic", IconSize.DIALOG);
+ confirm_image.set_from_icon_name("action-unavailable-symbolic");
confirm_title_label.label = _("Reject key");
confirm_desc_label.set_markup(_("You won't see encrypted messages from the device of %s that uses this key. Conversely, that device won't be able to decipher your messages anymore.").printf(@"<b>$(device[db.identity_meta.address_name])</b>"));
manage_stack.set_visible_child_name("confirm");
@@ -156,7 +156,7 @@ public class ManageKeyDialog : Gtk.Dialog {
return_to_main = true;
current_response = TrustLevel.UNTRUSTED;
} else if (row == accept_row) {
- confirm_image.set_from_icon_name("emblem-ok-symbolic", IconSize.DIALOG);
+ confirm_image.set_from_icon_name("emblem-ok-symbolic");
confirm_title_label.label = _("Accept key");
confirm_desc_label.set_markup(_("You will be able to exchange encrypted messages with the device of %s that uses this key.").printf(@"<b>$(device[db.identity_meta.address_name])</b>"));
manage_stack.set_visible_child_name("confirm");