diff options
author | Mateusz Biliński <mateusz.bilinski@gmail.com> | 2008-08-03 17:29:11 +0400 |
---|---|---|
committer | Mateusz Biliński <mateusz.bilinski@gmail.com> | 2008-08-03 17:29:11 +0400 |
commit | 16ac65e58b12a6e1cd84ea72b3e764a93c8ef27b (patch) | |
tree | 83db5f898d178c92f150c57a8bb48c0a5f215510 /plugins | |
parent | 5cce0a8ca9ae1fcca74feee322bc4de966a797e8 (diff) |
Improvements to GUI extension points handling - added method to remove these from PluginManager (memory optimization).
Removed logging from most of the code.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/acronyms_expander.py | 17 | ||||
-rw-r--r-- | plugins/banner_tweaks/plugin.py | 1 | ||||
-rw-r--r-- | plugins/length_notifier/config_dialog.glade | 152 | ||||
-rw-r--r-- | plugins/length_notifier/length_notifier.py | 7 | ||||
-rw-r--r-- | plugins/roster_buttons/plugin.py | 5 |
5 files changed, 85 insertions, 97 deletions
diff --git a/plugins/acronyms_expander.py b/plugins/acronyms_expander.py index a575fe555..6dec95614 100644 --- a/plugins/acronyms_expander.py +++ b/plugins/acronyms_expander.py @@ -38,11 +38,8 @@ class AcronymsExpanderPlugin(GajimPlugin): description = u'''Replaces acronyms (or other strings) with given expansions/substitutes.''' authors = [u'Mateusz Biliński <mateusz@bilinski.it>'] homepage = u'http://blog.bilinski.it' - - #@log_calls('AcronymsExpanderPlugin') - #def __init__(self): - #super(AcronymsExpanderPlugin, self).__init__() + @log_calls('AcronymsExpanderPlugin') def init(self): self.config_dialog = None @@ -71,20 +68,20 @@ class AcronymsExpanderPlugin(GajimPlugin): ACRONYMS = self.config['ACRONYMS'] INVOKER = self.config['INVOKER'] t = tb.get_text(tb.get_start_iter(), tb.get_end_iter()) - log.debug('%s %d'%(t, len(t))) + #log.debug('%s %d'%(t, len(t))) if t and t[-1] == INVOKER: - log.debug("changing msg text") + #log.debug("changing msg text") base,sep,head=t[:-1].rpartition(INVOKER) - log.debug('%s | %s | %s'%(base, sep, head)) + #log.debug('%s | %s | %s'%(base, sep, head)) if head in ACRONYMS: head = ACRONYMS[head] log.debug("head: %s"%(head)) t = "".join((base, sep, head, INVOKER)) - log.debug("turning off notify") + #log.debug("turning off notify") tb.freeze_notify() - log.debug("setting text: '%s'"%(t)) + #log.debug("setting text: '%s'"%(t)) tb.set_text(t) - log.debug("turning on notify") + #log.debug("turning on notify") tb.thaw_notify() @log_calls('AcronymsExpanderPlugin') diff --git a/plugins/banner_tweaks/plugin.py b/plugins/banner_tweaks/plugin.py index ee5cf2500..ba059143e 100644 --- a/plugins/banner_tweaks/plugin.py +++ b/plugins/banner_tweaks/plugin.py @@ -94,7 +94,6 @@ http://trac.gajim.org/attachment/ticket/4133''' if self.config['show_banner_resource'] or self.config['banner_small_fonts']: banner_name_label = chat_control.xml.get_widget('banner_name_label') label_text = banner_name_label.get_label() - log.debug('label_text = "%s"'%(label_text)) contact = chat_control.contact jid = contact.jid diff --git a/plugins/length_notifier/config_dialog.glade b/plugins/length_notifier/config_dialog.glade index 0267bb184..be20bc638 100644 --- a/plugins/length_notifier/config_dialog.glade +++ b/plugins/length_notifier/config_dialog.glade @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> -<!--Generated with glade3 3.4.5 on Tue Jul 29 19:58:18 2008 --> +<!--Generated with glade3 3.4.5 on Sun Aug 3 13:57:25 2008 --> <glade-interface> <widget class="GtkWindow" id="window1"> <child> @@ -12,40 +12,58 @@ <property name="column_spacing">7</property> <property name="row_spacing">5</property> <child> - <widget class="GtkHBox" id="hbox2"> + <widget class="GtkLabel" id="label1"> <property name="visible">True</property> - <child> - <widget class="GtkSpinButton" id="message_length_spinbutton"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip" translatable="yes">Message length at which notification is invoked.</property> - <property name="width_chars">6</property> - <property name="adjustment">0 0 999999 1 10 10</property> - <property name="snap_to_ticks">True</property> - <property name="numeric">True</property> - <signal name="value_changed" handler="on_message_length_spinbutton_value_changed"/> - </widget> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - <child> - <widget class="GtkAlignment" id="alignment2"> - <property name="visible">True</property> - <child> - <placeholder/> - </child> - </widget> - <packing> - <property name="position">1</property> - </packing> - </child> + <property name="tooltip" translatable="yes">Message length at which notification is invoked.</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Message length:</property> + </widget> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="y_options">GTK_FILL</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Background color of text entry field in chat window when notification is invoked.</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Notification color:</property> + </widget> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options">GTK_FILL</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">JabberIDs that plugin should be used with (eg. restrict only to one microblogging bot). Use comma (without space) as separator. If empty plugin is used with every JID. </property> + <property name="xalign">0</property> + <property name="label" translatable="yes">JabberIDs to include:</property> + </widget> + <packing> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options">GTK_FILL</property> + </packing> + </child> + <child> + <widget class="GtkEntry" id="jids_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="tooltip" translatable="yes">JabberIDs that plugin should be used with (eg. restrict only to one microblogging bot). Use comma (without space) as separator. If empty plugin is used with every JID. </property> + <signal name="changed" handler="on_jids_entry_changed"/> + <signal name="editing_done" handler="on_jids_entry_editing_done"/> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="x_options">GTK_FILL</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> <property name="y_options">GTK_FILL</property> </packing> </child> @@ -91,57 +109,39 @@ </packing> </child> <child> - <widget class="GtkEntry" id="jids_entry"> + <widget class="GtkHBox" id="hbox2"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip" translatable="yes">JabberIDs that plugin should be used with (eg. restrict only to one microblogging bot). If empty plugin is used with every JID. [not implemented]</property> - <signal name="changed" handler="on_jids_entry_changed"/> - <signal name="editing_done" handler="on_jids_entry_editing_done"/> + <child> + <widget class="GtkSpinButton" id="message_length_spinbutton"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="tooltip" translatable="yes">Message length at which notification is invoked.</property> + <property name="width_chars">6</property> + <property name="adjustment">0 0 999999 1 10 10</property> + <property name="snap_to_ticks">True</property> + <property name="numeric">True</property> + <signal name="value_changed" handler="on_message_length_spinbutton_value_changed"/> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + <child> + <widget class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_options">GTK_FILL</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label3"> - <property name="visible">True</property> - <property name="tooltip" translatable="yes">JabberIDs that plugin should be used with (eg. restrict only to one microblogging bot). If empty plugin is used with every JID. [not implemented]</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">JabberIDs to include:</property> - </widget> - <packing> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options">GTK_FILL</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label2"> - <property name="visible">True</property> - <property name="tooltip" translatable="yes">Background color of text entry field in chat window when notification is invoked.</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Notification color:</property> - </widget> - <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">GTK_FILL</property> - <property name="y_options">GTK_FILL</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label1"> - <property name="visible">True</property> - <property name="tooltip" translatable="yes">Message length at which notification is invoked.</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Message length:</property> - </widget> - <packing> <property name="x_options">GTK_FILL</property> <property name="y_options">GTK_FILL</property> </packing> diff --git a/plugins/length_notifier/length_notifier.py b/plugins/length_notifier/length_notifier.py index e9e5fbcd5..c8b45a284 100644 --- a/plugins/length_notifier/length_notifier.py +++ b/plugins/length_notifier/length_notifier.py @@ -40,10 +40,6 @@ class LengthNotifierPlugin(GajimPlugin): description = u'''Highlights message entry field in chat window when given length of message is exceeded.''' authors = [u'Mateusz Biliński <mateusz@bilinski.it>'] homepage = u'http://blog.bilinski.it' - - #@log_calls('LengthNotifierPlugin') - #def __init__(self): - #super(LengthNotifierPlugin, self).__init__() @log_calls('LengthNotifierPlugin') def init(self): @@ -107,7 +103,8 @@ class LengthNotifierPlugin(GajimPlugin): if d['prev_color']: tv.modify_base(gtk.STATE_NORMAL, d['prev_color']) except AttributeError, error: - log.debug('Length Notifier Plugin was (probably) never connected with this chat window.\n Error: %s' % (error)) + pass + #log.debug('Length Notifier Plugin was (probably) never connected with this chat window.\n Error: %s' % (error)) @log_calls('LengthNotifierPlugin') def jid_is_ok(self, jid): diff --git a/plugins/roster_buttons/plugin.py b/plugins/roster_buttons/plugin.py index a1aa29482..a7ebb7d55 100644 --- a/plugins/roster_buttons/plugin.py +++ b/plugins/roster_buttons/plugin.py @@ -40,14 +40,9 @@ class RosterButtonsPlugin(GajimPlugin): description = u'''Adds quick action buttons to roster window.''' authors = [u'Mateusz Biliński <mateusz@bilinski.it>'] homepage = u'http://blog.bilinski.it' - - #@log_calls('RosterButtonsPlugin') - #def __init__(self): - #super(RosterButtonsPlugin, self).__init__() @log_calls('RosterButtonsPlugin') def init(self): - #log.debug('self.__path__==%s'%(self.__path__)) self.GLADE_FILE_PATH = self.local_file_path('roster_buttons.glade') self.roster_vbox = gajim.interface.roster.xml.get_widget('roster_vbox2') |