Commit 8936a07e authored by Daniel Brötzmann's avatar Daniel Brötzmann Committed by Philipp Hörist

ServerInfo: Rework Dialog

- Split information into different notebook tabs
- Show connection information (Fixes #6096)
parent 0c84072e
Pipeline #4313 passed with stages
in 2 minutes and 36 seconds
......@@ -27,7 +27,7 @@ import gajim.plugins.gui
from gajim.gtk.dialogs import ShortcutsWindow
from gajim.gtk.history_sync import HistorySyncAssistant
from gajim.gtk.server_info import ServerInfoDialog
from gajim.gtk.server_info import ServerInfo
from gajim.gtk.mam_preferences import MamPreferences
from gajim.gtk.preferences import Preferences
from gajim.gtk.groupchat_creation import CreateGroupchatWindow
......@@ -241,11 +241,11 @@ def on_privacy_lists(action, param):
def on_server_info(action, param):
account = param.get_string()
if 'server_info' in interface.instances[account]:
interface.instances[account]['server_info'].present()
window = app.get_app_window(ServerInfo, account)
if window is None:
ServerInfo(account)
else:
interface.instances[account]['server_info'] = \
ServerInfoDialog(account)
window.present()
def on_xml_console(action, param):
......
......@@ -1018,6 +1018,9 @@ class Connection(CommonConnection, ConnectionHandlers):
msg = '%s over proxy %s:%s' % (msg, self._proxy['host'], self._proxy['port'])
log.info(msg)
def get_connection_info(self):
return self._current_host, self._proxy
def _connect_failure(self, con_type=None):
if not con_type:
# we are not retrying, and not conecting
......
......@@ -59,10 +59,10 @@
</object>
</child>
<child>
<object class="GtkMenuItem" id="view_certificate_menuitem">
<object class="GtkMenuItem" id="view_server_info_menuitem">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_View Certificate</property>
<property name="label" translatable="yes">_View Server Info</property>
<property name="use_underline">True</property>
</object>
</child>
......
......@@ -79,6 +79,7 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label">&lt;&gt;</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -106,6 +107,7 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label">&lt;&gt;</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -133,6 +135,7 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label">&lt;&gt;</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -163,7 +166,8 @@
<property name="wrap">True</property>
<property name="wrap_mode">char</property>
<property name="selectable">True</property>
<property name="max_width_chars">21</property>
<property name="max_width_chars">30</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -191,6 +195,7 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label">&lt;&gt;</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -218,6 +223,7 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label">&lt;&gt;</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -245,6 +251,7 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label">&lt;&gt;</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -272,6 +279,7 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label">&lt;&gt;</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -299,6 +307,7 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label">&lt;&gt;</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -347,6 +356,7 @@
<property name="wrap">True</property>
<property name="wrap_mode">char</property>
<property name="selectable">True</property>
<property name="max_width_chars">52</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -363,7 +373,7 @@
<property name="wrap">True</property>
<property name="wrap_mode">char</property>
<property name="selectable">True</property>
<property name="max_width_chars">42</property>
<property name="max_width_chars">52</property>
</object>
<packing>
<property name="left_attach">0</property>
......
This diff is collapsed.
......@@ -66,11 +66,11 @@ popover#EmoticonPopover { padding: 5px; background-color: @theme_unfocused_base_
#FinishedLabel { font-size: 14px; font-weight: bold }
/* Server Info */
#ServerInfoGrid > list { border: 1px solid; border-color: @borders; }
#ServerInfoGrid > list > row:first-child { border-top: 1px solid; border-color: @borders; }
#ServerInfoGrid > list > row { padding: 10px 20px 10px 10px; }
#ServerInfoGrid > list > label { padding:10px; color: @insensitive_fg_color; font-weight: bold; }
#ServerInfoGrid > list > row.activatable:active { box-shadow: none; }
#ServerInfo { border: 1px solid; border-color: @borders; }
#ServerInfo > row:first-child { border-top: 1px solid; border-color: @borders; }
#ServerInfo > row { padding: 10px 20px 10px 10px; }
#ServerInfo > label { padding:10px; color: @insensitive_fg_color; font-weight: bold; }
#ServerInfo > row.activatable:active { box-shadow: none; }
/* Features Info */
#FeaturesInfoGrid > list { border: 1px solid; border-color: @borders; }
......@@ -225,6 +225,7 @@ list.settings > row > box {
.margin-12 { margin: 12px; }
.margin-18 { margin: 18px; }
.padding-18 { margin: 18px; }
.padding-left30 { padding-left: 30px; }
/* Treeview */
treeview.space { padding: 6px; }
......
......@@ -468,6 +468,7 @@ class CertificateDialog(Gtk.ApplicationWindow):
self._ui = get_builder('certificate_dialog.ui')
self.add(self._ui.certificate_box)
self.account = account
self._clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
# Get data for labels and copy button
......@@ -483,10 +484,10 @@ class CertificateDialog(Gtk.ApplicationWindow):
self._ib_organization = issuer.organizationName or ''
self._ib_org_unit = issuer.organizationalUnitName or ''
issued = datetime.strptime(cert.get_notBefore().decode('ascii'),
'%Y%m%d%H%M%SZ')
'%Y%m%d%H%M%SZ')
self._issued = issued.strftime('%B %d, %Y, %H:%M:%S %z')
expires = datetime.strptime(cert.get_notAfter().decode('ascii'),
'%Y%m%d%H%M%SZ')
'%Y%m%d%H%M%SZ')
self._expires = expires.strftime('%B %d, %Y, %H:%M:%S %z')
self._sha1 = cert.digest('sha1').decode('utf-8')
self._sha256 = cert.digest('sha256').decode('utf-8')
......
This diff is collapsed.
......@@ -72,8 +72,8 @@ 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.server_info import ServerInfo
from gajim.gtk.single_message import SingleMessageWindow
from gajim.gtk.add_contact import AddNewContactWindow
from gajim.gtk.account_wizard import AccountCreationWizard
......@@ -3531,10 +3531,12 @@ 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_view_server_info(self, _widget, account):
window = app.get_app_window(ServerInfo, account)
if window is None:
ServerInfo(account)
else:
window.present()
def on_roster_window_focus_in_event(self, widget, event):
# roster received focus, so if we had urgency REMOVE IT
......@@ -4761,8 +4763,8 @@ class RosterWindow:
'service_discovery_menuitem')
execute_command_menuitem = xml.get_object(
'execute_command_menuitem')
view_certificate_menuitem = xml.get_object(
'view_certificate_menuitem')
view_server_info_menuitem = xml.get_object(
'view_server_info_menuitem')
edit_account_menuitem = xml.get_object('edit_account_menuitem')
sub_menu = Gtk.Menu()
status_menuitem.set_submenu(sub_menu)
......@@ -4840,14 +4842,14 @@ class RosterWindow:
account=account) # Fake contact
execute_command_menuitem.connect('activate',
self.on_execute_command, contact, account)
view_certificate_menuitem.connect('activate',
self.on_view_certificate, account)
view_server_info_menuitem.connect('activate',
self.on_view_server_info, account)
# make some items insensitive if account is offline
if not app.account_is_connected(account):
for widget in (add_contact_menuitem, service_discovery_menuitem,
execute_command_menuitem,
view_certificate_menuitem, pep_menuitem):
execute_command_menuitem, view_server_info_menuitem,
pep_menuitem):
widget.set_sensitive(False)
else:
xml = get_builder('zeroconf_context_menu.ui')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment