add new gui extension point so that plugins can update toolbar buttons status.

This commit is contained in:
Yann Leboulanger 2010-10-29 22:13:12 +02:00
parent 58feae6cee
commit cdf3918262
1 changed files with 17 additions and 3 deletions

View File

@ -159,6 +159,14 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
gajim.plugin_manager.gui_extension_point('chat_control_base_draw_banner', gajim.plugin_manager.gui_extension_point('chat_control_base_draw_banner',
self) self)
def update_toolbar(self):
"""
update state of buttons in toolbar
"""
self._update_toolbar()
gajim.plugin_manager.gui_extension_point(
'chat_control_base_update_toolbar', self)
def draw_banner_text(self): def draw_banner_text(self):
""" """
Derived types SHOULD implement this Derived types SHOULD implement this
@ -184,8 +192,14 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
""" """
pass pass
def _update_toolbar(self):
"""
Derived types MAY implement this
"""
pass
def handle_message_textview_mykey_press(self, widget, event_keyval, def handle_message_textview_mykey_press(self, widget, event_keyval,
event_keymod): event_keymod):
""" """
Derives types SHOULD implement this, rather than connection to the even Derives types SHOULD implement this, rather than connection to the even
itself itself
@ -1533,11 +1547,11 @@ class ChatControl(ChatControlBase):
self.restore_conversation() self.restore_conversation()
self.msg_textview.grab_focus() self.msg_textview.grab_focus()
# PluginSystem: adding GUI extension point for this ChatControl # PluginSystem: adding GUI extension point for this ChatControl
# instance object # instance object
gajim.plugin_manager.gui_extension_point('chat_control', self) gajim.plugin_manager.gui_extension_point('chat_control', self)
def update_toolbar(self): def _update_toolbar(self):
# Formatting # Formatting
if self.contact.supports(NS_XHTML_IM) and not self.gpg_is_active: if self.contact.supports(NS_XHTML_IM) and not self.gpg_is_active:
self._formattings_button.set_sensitive(True) self._formattings_button.set_sensitive(True)