Philipp Hörist pushed to branch gajim_1.1 at gajim / gajim
Commits: c1948d05 by Philipp Hörist at 2019-03-16T14:38:19Z Get module instance after checking for zeroconf
- - - - - 36e80622 by Philipp Hörist at 2019-03-16T14:47:51Z Notifications: Check if DBus is available
- - - - - 3729b8f9 by Philipp Hörist at 2019-03-16T15:17:05Z Themes: Better visibility of scrollbar
- - - - - 76cb4d1d by Philipp Hörist at 2019-03-16T15:18:49Z HistoryWindow: Center top widgets vertically
- - - - - 7ba9bc4b by Philipp Hörist at 2019-03-16T15:19:11Z Dont leak DNS query if we connect via proxy
Fixes #9573
- - - - - d159a7a1 by Philipp Hörist at 2019-03-16T15:19:26Z Fix error while quitting
Fixes #9622
- - - - - bb4daa29 by Philipp Hörist at 2019-03-16T15:19:37Z Generate account label correctly
- - - - -
7 changed files:
- gajim/common/connection.py - gajim/data/gui/history_window.ui - gajim/data/gui/themes_window.ui - gajim/gtk/account_wizard.py - gajim/notify.py - gajim/plugins/pluginmanager.py - gajim/roster_window.py
Changes:
===================================== gajim/common/connection.py ===================================== @@ -905,10 +905,6 @@ class Connection(CommonConnection, ConnectionHandlers): ] self._hostname = hostname
- if h: - app.resolver.resolve('_xmppconnect.' + helpers.idn_to_ascii(h), - self._on_resolve_txt, type_='txt') - if use_srv and self._proxy is None: self._srv_hosts = []
@@ -918,6 +914,9 @@ class Connection(CommonConnection, ConnectionHandlers): for service in services: record_name = '_' + service + '._tcp.' + helpers.idn_to_ascii(h) app.resolver.resolve(record_name, self._on_resolve_srv) + + app.resolver.resolve('_xmppconnect.' + helpers.idn_to_ascii(h), + self._on_resolve_txt, type_='txt') else: self._connect_to_next_host()
===================================== gajim/data/gui/history_window.ui ===================================== @@ -311,6 +311,7 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">start</property> + <property name="valign">center</property> <property name="label" translatable="yes">Chat</property> <style> <class name="dim-label"/> @@ -326,6 +327,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="tooltip_text" translatable="yes">Record history for this chat</property> + <property name="valign">center</property> <signal name="notify::active" handler="on_log_history_checkbutton_toggled" swapped="no"/> </object> <packing> @@ -337,6 +339,7 @@ <object class="GtkLabel"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="valign">center</property> <property name="margin_left">6</property> <property name="label" translatable="yes">Record History</property> <style> @@ -353,6 +356,7 @@ <property name="width_request">400</property> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="valign">center</property> <property name="hexpand">True</property> <property name="model">liststore1</property> <property name="tearoff_title" translatable="yes">Ttitle</property>
===================================== gajim/data/gui/themes_window.ui ===================================== @@ -10,7 +10,8 @@ <property name="can_focus">True</property> <property name="hscrollbar_policy">never</property> <property name="shadow_type">in</property> - <property name="min_content_height">200</property> + <property name="min_content_height">260</property> + <property name="overlay_scrolling">False</property> <child> <object class="GtkViewport"> <property name="visible">True</property>
===================================== gajim/gtk/account_wizard.py ===================================== @@ -564,6 +564,7 @@ class AccountCreationWizard: def create_vars(self, config): app.config.add_per('accounts', self.account)
+ config['account_label'] = '%s@%s' % (config['name'], config['hostname']) if not config['savepass']: config['password'] = ''
===================================== gajim/notify.py ===================================== @@ -75,31 +75,10 @@ class Notification: Handle notifications """ def __init__(self): + self._dbus_available = False self.daemon_capabilities = ['actions']
- # Detect if actions are supported by the notification daemon - if sys.platform not in ('win32', 'darwin'): - def on_proxy_ready(source, res, data=None): - try: - proxy = Gio.DBusProxy.new_finish(res) - self.daemon_capabilities = proxy.GetCapabilities() - except GLib.Error as e: - if e.domain == 'g-dbus-error-quark': - log.info('Notifications D-Bus connection failed: %s', - e.message) - else: - raise - else: - log.debug('Notifications D-Bus connected') - - log.debug('Connecting to Notifications D-Bus') - Gio.DBusProxy.new_for_bus(Gio.BusType.SESSION, - Gio.DBusProxyFlags.DO_NOT_CONNECT_SIGNALS, - None, - 'org.freedesktop.Notifications', - '/org/freedesktop/Notifications', - 'org.freedesktop.Notifications', - None, on_proxy_ready) + self._detect_dbus_caps()
app.ged.register_event_handler( 'notification', ged.GUI2, self._nec_notification) @@ -107,6 +86,30 @@ class Notification: 'our-show', ged.GUI2, self._nec_our_status) app.events.event_removed_subscribe(self._on_event_removed)
+ def _detect_dbus_caps(self): + if sys.platform in ('win32', 'darwin'): + return + + def on_proxy_ready(_source, res, _data=None): + try: + proxy = Gio.DBusProxy.new_finish(res) + self.daemon_capabilities = proxy.GetCapabilities() + except GLib.Error: + log.exception('Notifications D-Bus connection failed') + else: + self._dbus_available = True + log.info('Notifications D-Bus connected') + + log.info('Connecting to Notifications D-Bus') + Gio.DBusProxy.new_for_bus(Gio.BusType.SESSION, + Gio.DBusProxyFlags.DO_NOT_CONNECT_SIGNALS, + None, + 'org.freedesktop.Notifications', + '/org/freedesktop/Notifications', + 'org.freedesktop.Notifications', + None, + on_proxy_ready) + def _nec_notification(self, obj): if obj.do_popup: icon_name = self._get_icon_name(obj) @@ -170,6 +173,9 @@ class Notification: app.interface.roster.popup_notification_windows.append(instance) return
+ if not self._dbus_available: + return + scale = gtkgui_helpers.get_monitor_scale_factor() icon_pixbuf = gtkgui_helpers.gtk_icon_theme.load_icon_for_scale( icon_name, 48, scale, 0) @@ -220,8 +226,9 @@ class Notification: app.app.send_notification(notif_id, notification)
def withdraw(self, *args): - if sys.platform != 'win32': - app.app.withdraw_notification(self._id(*args)) + if not self._dbus_available: + return + app.app.withdraw_notification(self._id(*args))
def _id(self, *args): return ','.join(args)
===================================== gajim/plugins/pluginmanager.py ===================================== @@ -406,9 +406,9 @@ class PluginManager(metaclass=Singleton): return for con in app.connections.values(): for module in plugin.modules: - instance, name = module.get_instance(con) if not module.zeroconf and con.name == 'Local': continue + instance, name = module.get_instance(con) modules.register_single(con, instance, name)
# If handlers have been registered, register the @@ -558,9 +558,9 @@ class PluginManager(metaclass=Singleton): return
for module in plugin.modules: - instance, name = module.get_instance(con) if not module.zeroconf and con.name == 'Local': continue + instance, name = module.get_instance(con) modules.register_single(con, instance, name)
def _plugin_is_active_in_global_config(self, plugin):
===================================== gajim/roster_window.py ===================================== @@ -2501,8 +2501,11 @@ class RosterWindow: self.send_pep(acct, pep_dict)
def on_continue2(message, pep_dict): + if 'file_transfers' not in app.interface.instances: + on_continue3(message, pep_dict) + return # check if there is an active file transfer - from gajim.common.protocol.bytestream import (is_transfer_active) + from gajim.common.protocol.bytestream import is_transfer_active files_props = app.interface.instances['file_transfers'].\ files_props transfer_active = False
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/c0178db779d8a6f25f986b7609174b3672...