diff options
author | fiaxh <git@mx.ax.lt> | 2018-01-04 21:13:44 +0100 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2018-01-04 21:17:56 +0100 |
commit | a8cc94c188c085e8788e072017ef21d7b7812a55 (patch) | |
tree | f537499e6106144a0b6dd756d25d4d6252f146fe /main | |
parent | 6b58b348fa42c3206f56c4b897a255d81f0ea7a9 (diff) | |
download | dino-a8cc94c188c085e8788e072017ef21d7b7812a55.tar.gz dino-a8cc94c188c085e8788e072017ef21d7b7812a55.zip |
Show error on invalid TLS certificate
Diffstat (limited to 'main')
-rw-r--r-- | main/data/contact_details_dialog.ui | 1 | ||||
-rw-r--r-- | main/data/manage_accounts/dialog.ui | 3 | ||||
-rw-r--r-- | main/src/ui/manage_accounts/dialog.vala | 13 |
3 files changed, 13 insertions, 4 deletions
diff --git a/main/data/contact_details_dialog.ui b/main/data/contact_details_dialog.ui index 8fa62398..8ce7306d 100644 --- a/main/data/contact_details_dialog.ui +++ b/main/data/contact_details_dialog.ui @@ -77,6 +77,7 @@ <child> <object class="GtkLabel" id="jid_label"> <property name="xalign">0</property> + <property name="yalign">0</property> <property name="selectable">True</property> <property name="expand">True</property> <property name="visible">True</property> diff --git a/main/data/manage_accounts/dialog.ui b/main/data/manage_accounts/dialog.ui index 9235f613..2dc2762b 100644 --- a/main/data/manage_accounts/dialog.ui +++ b/main/data/manage_accounts/dialog.ui @@ -88,6 +88,7 @@ <child> <object class="GtkBox"> <property name="visible">True</property> + <property name="halign">end</property> <child> <object class="GtkBox"> <property name="visible">True</property> @@ -121,6 +122,7 @@ <child> <object class="GtkLabel" id="jid_label"> <property name="xalign">0</property> + <property name="yalign">1</property> <property name="visible">True</property> <attributes> <attribute name="weight" value="PANGO_WEIGHT_BOLD"/> @@ -136,6 +138,7 @@ <child> <object class="GtkLabel" id="state_label"> <property name="xalign">0</property> + <property name="yalign">0</property> <property name="visible">True</property> <style> <class name="dim-label"/> diff --git a/main/src/ui/manage_accounts/dialog.vala b/main/src/ui/manage_accounts/dialog.vala index dd2383a2..b157a936 100644 --- a/main/src/ui/manage_accounts/dialog.vala +++ b/main/src/ui/manage_accounts/dialog.vala @@ -171,7 +171,7 @@ public class Dialog : Gtk.Dialog { } } - private bool on_active_switch_state_changed(bool state) { + private bool change_account_state(bool state) { selected_account.enabled = state; if (state) { if (selected_account.enabled) account_disabled(selected_account); @@ -189,7 +189,7 @@ public class Dialog : Gtk.Dialog { } private void populate_grid_data(Account account) { - active_switch.state_set.disconnect(on_active_switch_state_changed); + active_switch.state_set.disconnect(change_account_state); Util.image_set_from_scaled_pixbuf(image, (new AvatarGenerator(50, 50, image.scale_factor)).draw_account(stream_interactor, account)); active_switch.set_active(account.enabled); @@ -201,7 +201,7 @@ public class Dialog : Gtk.Dialog { update_status_label(account); - active_switch.state_set.connect(on_active_switch_state_changed); + active_switch.state_set.connect(change_account_state); foreach(Plugins.AccountSettingsWidget widget in plugin_widgets) { widget.set_account(account); @@ -216,8 +216,11 @@ public class Dialog : Gtk.Dialog { state_label.get_style_context().add_class("is_error"); if (error.source == ConnectionManager.ConnectionError.Source.SASL || - (error.flag != null && error.flag.reconnection_recomendation == Xmpp.StreamError.Flag.Reconnect.NEVER)) { + error.source == ConnectionManager.ConnectionError.Source.TLS || + error.reconnect_recomendation == ConnectionManager.ConnectionError.Reconnect.NEVER) { + active_switch.state_set.disconnect(change_account_state); active_switch.active = false; + active_switch.state_set.connect(change_account_state); } } else { @@ -238,6 +241,8 @@ public class Dialog : Gtk.Dialog { switch (error.source) { case ConnectionManager.ConnectionError.Source.SASL: return _("Wrong password"); + case ConnectionManager.ConnectionError.Source.TLS: + return _("Invalid TLS certificate"); } if (error.identifier != null) { return _("Error") + ": " + error.identifier; |