Commit b48e4619 authored by Dicson's avatar Dicson

QuickRepliesPlugin,GuiForMePlugin.change buttons state when the status has changed

parent 1e62bf73
......@@ -41,7 +41,8 @@ class GuiForMe(GajimPlugin):
for base in self.controls:
if base.chat_control != chat_control:
continue
base.button.set_sensitive(chat_control.msg_textview.get_sensitive())
base.button.set_sensitive(chat_control.contact.show != 'offline' \
and gajim.connections[chat_control.account].connected > 0)
class Base(object):
......
import gtk
import gtkgui_helpers
from common import gajim
from plugins import GajimPlugin
from plugins.gui import GajimPluginConfigDialog
......@@ -37,8 +38,8 @@ class QuickRepliesPlugin(GajimPlugin):
def connect_with_chat_control(self, chat_control):
self.chat_control = chat_control
control = Base(self, self.chat_control)
self.controls.append(control)
base = Base(self, chat_control)
self.controls.append(base)
@log_calls('QuickRepliesPlugin')
def disconnect_from_chat_control(self, chat_control):
......@@ -47,12 +48,13 @@ class QuickRepliesPlugin(GajimPlugin):
control.disconnect_from_chat_control()
self.controls = []
@log_calls('GuiForMePlugin')
@log_calls('QuickRepliesPlugin')
def update_button_state(self, chat_control):
for base in self.controls:
if base.chat_control != chat_control:
continue
base.button.set_sensitive(chat_control.msg_textview.get_sensitive())
base.button.set_sensitive(chat_control.contact.show != 'offline' \
and gajim.connections[chat_control.account].connected > 0)
class Base(object):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment