Philipp Hörist pushed to branch master at gajim / gajim
Commits: 0d5cca1e by lovetox at 2020-08-12T15:17:59+02:00 ServerInfo: Show more information about the connection
- - - - -
2 changed files:
- gajim/data/gui/server_info.ui - gajim/gtk/server_info.py
Changes:
===================================== gajim/data/gui/server_info.ui ===================================== @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.36.0 --> +<!-- Generated with glade 3.22.1 --> <interface> <requires lib="gtk+" version="3.22"/> <object class="GtkNotebook" id="server_info_notebook"> @@ -166,7 +166,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">0</property> + <property name="top_attach">4</property> </packing> </child> <child> @@ -181,7 +181,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">2</property> + <property name="top_attach">5</property> </packing> </child> <child> @@ -194,18 +194,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">2</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="connection_protocol"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">start</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> + <property name="top_attach">5</property> </packing> </child> <child> @@ -221,7 +210,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">4</property> + <property name="top_attach">8</property> <property name="width">2</property> </packing> </child> @@ -237,7 +226,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">3</property> + <property name="top_attach">6</property> </packing> </child> <child> @@ -250,7 +239,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">3</property> + <property name="top_attach">6</property> </packing> </child> <child> @@ -265,15 +254,30 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="top_attach">4</property> </packing> </child> <child> - <object class="GtkLabel"> + <object class="GtkLabel" id="domain_label"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">end</property> - <property name="label" translatable="yes">Protocol</property> + <property name="label">Domain</property> + <style> + <class name="dim-label"/> + </style> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="dns_label"> + <property name="can_focus">False</property> + <property name="no_show_all">True</property> + <property name="halign">end</property> + <property name="label">DNS</property> <style> <class name="dim-label"/> </style> @@ -283,6 +287,90 @@ <property name="top_attach">1</property> </packing> </child> + <child> + <object class="GtkLabel" id="ip_port_label"> + <property name="can_focus">False</property> + <property name="no_show_all">True</property> + <property name="halign">end</property> + <property name="label">IP / Port</property> + <style> + <class name="dim-label"/> + </style> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="websocket_label"> + <property name="can_focus">False</property> + <property name="no_show_all">True</property> + <property name="halign">end</property> + <property name="label">WebSocket URL</property> + <style> + <class name="dim-label"/> + </style> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">3</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="domain"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="dns"> + <property name="can_focus">False</property> + <property name="no_show_all">True</property> + <property name="halign">start</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="ip_port"> + <property name="can_focus">False</property> + <property name="no_show_all">True</property> + <property name="halign">start</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">2</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="websocket"> + <property name="can_focus">False</property> + <property name="no_show_all">True</property> + <property name="halign">start</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">3</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> <style> <class name="margin-18"/> </style>
===================================== gajim/gtk/server_info.py ===================================== @@ -91,25 +91,38 @@ class ServerInfo(Gtk.ApplicationWindow, EventHelper):
def _add_connection_info(self): # Connection type - client = app.connections[self.account].connection - con_type = client.current_connection_type - self._ui.connection_type.set_text(con_type.value) - if con_type.is_plain: - self._ui.conection_type.get_style_context().add_class( - 'error-color') + nbxmpp_client = app.connections[self.account].connection + address = nbxmpp_client.current_address
- is_websocket = app.connections[self.account].connection.is_websocket - protocol = 'WebSocket' if is_websocket else 'TCP' - self._ui.connection_protocol.set_text(protocol) + self._ui.connection_type.set_text(address.type.value) + if address.type.is_plain: + self._ui.conection_type.get_style_context().add_class('error-color')
# Connection proxy - proxy = client.proxy + proxy = address.proxy if proxy is not None: self._ui.proxy_type.set_text(proxy.type) self._ui.proxy_host.set_text(proxy.host)
self._ui.cert_button.set_sensitive(self.cert)
+ self._ui.domain.set_text(address.domain) + + visible = address.service is not None + self._ui.dns_label.set_visible(visible) + self._ui.dns.set_visible(visible) + self._ui.dns.set_text(address.service or '') + + visible = nbxmpp_client.remote_address is not None + self._ui.ip_port_label.set_visible(visible) + self._ui.ip_port.set_visible(visible) + self._ui.ip_port.set_text(nbxmpp_client.remote_address or '') + + visible = address.uri is not None + self._ui.websocket_label.set_visible(visible) + self._ui.websocket.set_visible(visible) + self._ui.websocket.set_text(address.uri or '') + def _on_cert_button_clicked(self, _button): open_window('CertificateDialog', account=self.account,
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/0d5cca1e93b8cefaf861b21458b99d726...