New gui_extension_point added. Do not use all args in remove_gui_extension_point() to identify elements to be removed. Use only first one

This commit is contained in:
Denis Fomin 2011-09-26 20:47:33 +03:00
parent 3a3c40f07c
commit 2e648d06be
3 changed files with 21 additions and 4 deletions

View File

@ -522,8 +522,12 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
super(ChatControlBase, self).shutdown()
# PluginSystem: removing GUI extension points connected with ChatControlBase
# instance object
gajim.plugin_manager.remove_gui_extension_point('chat_control_base', self)
gajim.plugin_manager.remove_gui_extension_point('chat_control_base_draw_banner', self)
gajim.plugin_manager.remove_gui_extension_point('chat_control_base',
self)
gajim.plugin_manager.remove_gui_extension_point(
'chat_control_base_draw_banner', self)
gajim.plugin_manager.remove_gui_extension_point('print_special_text',
self)
gajim.ged.remove_event_handler('our-show', ged.GUI1,
self._nec_our_status)

View File

@ -1039,6 +1039,15 @@ class ConversationTextview(gobject.GObject):
Is called by detect_and_print_special_text and prints special text
(emots, links, formatting)
"""
# PluginSystem: adding GUI extension point for ConversationTextview
self.plugin_modified = False
gajim.plugin_manager.gui_extension_point('print_special_text', self,
special_text, other_tags, graphics)
if self.plugin_modified:
return
tags = []
use_other_tags = True
text_is_valid_uri = False

View File

@ -215,9 +215,13 @@ class PluginManager(object):
extension point name) to identify element to be removed.
:type args: tuple
'''
if gui_extpoint_name in self.gui_extension_points:
self.gui_extension_points[gui_extpoint_name].remove(args)
extension_points = list(self.gui_extension_points[gui_extpoint_name])
for ext_point in extension_points:
if args[0] in ext_point:
self.gui_extension_points[gui_extpoint_name].remove(
ext_point)
@log_calls('PluginManager')
def _add_gui_extension_point_call_to_list(self, gui_extpoint_name, *args):