Commit 20107b4c authored by Daniel Brötzmann's avatar Daniel Brötzmann Committed by Philipp Hörist

Add View Certificate menu item to account context menu

parent d369ff91
Pipeline #3881 passed with stages
in 2 minutes and 47 seconds
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<!-- Generated with glade 3.22.1 -->
<requires lib="gtk+" version="3.12"/>
<object class="GtkMenu" id="account_context_menu">
......@@ -66,6 +66,14 @@
<property name="use_underline">True</property>
<object class="GtkMenuItem" id="view_certificate_menuitem">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_View Certificate</property>
<property name="use_underline">True</property>
<object class="GtkSeparatorMenuItem" id="seperator1">
<property name="visible">True</property>
......@@ -72,6 +72,7 @@ from gajim.gtk.dialogs import InputDialog
from gajim.gtk.dialogs import WarningDialog
from gajim.gtk.dialogs import InformationDialog
from gajim.gtk.dialogs import NonModalConfirmationDialog
from gajim.gtk.dialogs import CertificateDialog
from gajim.gtk.dialogs import InvitationReceivedDialog
from gajim.gtk.join_groupchat import JoinGroupchatWindow
from gajim.gtk.single_message import SingleMessageWindow
......@@ -3585,6 +3586,11 @@ class RosterWindow:
jid = jid + '/' + resource
AdHocCommand(account, jid)
def on_view_certificate(self, widget, account):
con = app.connections[account]
cert = con.connection.Connection.ssl_certificate
CertificateDialog(self.window, account, cert)
def on_roster_window_focus_in_event(self, widget, event):
# roster received focus, so if we had urgency REMOVE IT
# NOTE: we do not have to read the message to remove urgency
......@@ -4812,6 +4818,8 @@ class RosterWindow:
execute_command_menuitem = xml.get_object(
view_certificate_menuitem = xml.get_object(
edit_account_menuitem = xml.get_object('edit_account_menuitem')
sub_menu = Gtk.Menu()
......@@ -4898,6 +4906,8 @@ class RosterWindow:
account=account) # Fake contact
self.on_execute_command, contact, account)
self.on_view_certificate, account)
gc_sub_menu = Gtk.Menu() # gc is always a submenu
......@@ -4907,7 +4917,7 @@ class RosterWindow:
if not app.account_is_connected(account):
for widget in (add_contact_menuitem, service_discovery_menuitem,
join_group_chat_menuitem, execute_command_menuitem,
view_certificate_menuitem, pep_menuitem):
xml = get_builder('zeroconf_context_menu.ui')
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment