From b96cb2ee2ba9f046c0a41f2effb55fc805c78e55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Tue, 17 Oct 2017 23:35:19 +0200 Subject: [PATCH] [rostertweaks] Fix some Bugs - pylint/pep8 - Fix show/hide menubar - Fix send status - Update glade file to Gtk 3.18 --- roster_tweaks/config_dialog.ui | 50 +++++++++++------- roster_tweaks/roster_tweaks.py | 93 +++++++++++++++------------------- 2 files changed, 71 insertions(+), 72 deletions(-) diff --git a/roster_tweaks/config_dialog.ui b/roster_tweaks/config_dialog.ui index 5b3e961..dd91778 100644 --- a/roster_tweaks/config_dialog.ui +++ b/roster_tweaks/config_dialog.ui @@ -1,11 +1,13 @@ - + + - - + + False - + True + False 9 vertical 4 @@ -14,13 +16,14 @@ Hide status combobox True False - False False + False True - + False + True 0 @@ -29,13 +32,14 @@ Use Ctrl +M to hide/show menu True False - False False + False True - + False + True 1 @@ -44,13 +48,14 @@ Show quick-change status field True False - False False + False True - + False + True 2 @@ -59,13 +64,14 @@ Always show contacts status substrings True False - False False + False True - + False + True 3 @@ -73,17 +79,21 @@ + False - + True + False True True - - + + + False + True 0 @@ -93,12 +103,13 @@ False True none - + True + False gtk-stop - 1 + 1 @@ -114,12 +125,13 @@ False True none - + True + False gtk-stop - 1 + 1 diff --git a/roster_tweaks/roster_tweaks.py b/roster_tweaks/roster_tweaks.py index a0df330..f9e9e05 100644 --- a/roster_tweaks/roster_tweaks.py +++ b/roster_tweaks/roster_tweaks.py @@ -3,55 +3,48 @@ from gi.repository import Pango from gi.repository import Gtk from gi.repository import Gdk -from gi.repository import GObject +from gi.repository import GLib -from gajim.common import app, ged, helpers, pep +from gajim.common import app, ged, helpers from gajim.plugins import GajimPlugin -from gajim.plugins.helpers import log_calls from gajim.plugins.gui import GajimPluginConfigDialog from gajim.dialogs import ChangeActivityDialog, ChangeMoodDialog from gajim import gtkgui_helpers class RosterTweaksPlugin(GajimPlugin): - - @log_calls('RosterTweaksPlugin') def init(self): - self.description = _('Allows user to tweak roster window appearance ' - '(eg. make it compact).\nBased on ticket #3340:\n' - 'http://trac.gajim.org/ticket/3340.\n' - 'Added ability to quickly change the status message ' - 'to all connected accounts.\n' - 'Based on ticket #5085:\n' - 'http://trac.gajim.org/ticket/5085.') + self.description = _( + 'Allows user to tweak roster window appearance ' + '(eg. make it compact).') self.config_default_values = {'hide_status_combo': (False, ''), 'use_ctr_m': (False, ''), 'menu_visible': (True, ''), 'quick_status': (False, ''), - 'contact_status_subs': (False, ''),} + 'contact_status_subs': (False, ''), } self.events_handlers = {'our-show': (ged.GUI2, self.our_show), 'pep-received': (ged.GUI2, self.pep_received)} self.gui_extension_points = { - 'roster_draw_contact': (self.roster_draw_contact, - self.disconnect_roster_draw_contact),} + 'roster_draw_contact': (self.roster_draw_contact, + self.disconnect_roster_draw_contact), } self.roster = app.interface.roster self.config_dialog = RosterTweaksPluginConfigDialog(self) - def roster_draw_contact(self, roster,jid, account, contact): + def roster_draw_contact(self, roster, jid, account, contact): self.connected = True if not self.active: return if not self.config['contact_status_subs']: return - child_iters = roster._get_contact_iter(jid, account, contact, - roster.model) + child_iters = roster._get_contact_iter( + jid, account, contact, roster.model) if not child_iters: return name = roster.model[child_iters[0]][1] if '\n