now sensitivity on/off for change status menuitem works ok

This commit is contained in:
Nikos Kouremenos 2005-10-10 22:46:28 +00:00
parent fbc668841e
commit f5089a8c69
2 changed files with 21 additions and 19 deletions

View file

@ -230,16 +230,20 @@ class Interface:
def allow_notif(self, account):
gajim.allow_notifications[account] = True
def handle_event_status(self, account, status): # OUR status
#('STATUS', account, status)
if status != 'offline':
gobject.timeout_add(30000, self.allow_notif, account)
else:
model = self.roster.status_combobox.get_model()
if status == 'offline':
model[self.roster.status_message_menuitem_iter][3] = False # sensitivity for this menuitem
gajim.allow_notifications[account] = False
# we are disconnected from all gc
for room_jid in gajim.gc_connected[account]:
if self.windows[account]['gc'].has_key(room_jid):
self.windows[account]['gc'][room_jid].got_disconnected(room_jid)
else:
gobject.timeout_add(30000, self.allow_notif, account)
model[self.roster.status_message_menuitem_iter][3] = True # sensitivity for this menuitem
self.roster.on_status_changed(account, status)
if self.remote and self.remote.is_enabled():
self.remote.raise_signal('AccountPresence', (status, account))
@ -266,7 +270,7 @@ class Interface:
ji = jid.replace('@', '')
else:
ji = jid
#Update user
# Update contact
if gajim.contacts[account].has_key(ji):
luser = gajim.contacts[account][ji]
user1 = None

View file

@ -1437,7 +1437,7 @@ _('If "%s" accepts this request you will know his status.') %jid)
if not gajim.config.get_per('accounts', acct,
'sync_with_global_status'):
continue
# We're going ti change our status to invisible
# We're going to change our status to invisible
if self.connected_rooms(acct):
bug_user = True
break
@ -1454,13 +1454,10 @@ _('If "%s" accepts this request you will know his status.') %jid)
for acct in accounts:
if not gajim.config.get_per('accounts', acct, 'sync_with_global_status'):
continue
# FIXME: not here why?
# we are connected or we want to connect
if not one_connected or gajim.connections[acct].connected > 1:
self.send_status(acct, status, message)
model = self.status_combobox.get_model()
model[self.status_message_menuitem_iter][3] = True # sensitivity for this menuitem
def update_status_comboxbox(self):
# table to change index in plugin.connected to index in combobox
table = {0:9, 1:9, 2:0, 3:1, 4:2, 5:3, 6:4, 7:5}
@ -1645,7 +1642,7 @@ _('If "%s" accepts this request you will know his status.') %jid)
if self.plugin.windows[account].has_key('join_gc'):
self.plugin.windows[account]['join_gc'].window.present()
else:
#FIXME: Why this try/except?
# c http://nkour.blogspot.com/2005/05/pythons-init-return-none-doesnt-return.html
try:
self.plugin.windows[account]['join_gc'] = dialogs.JoinGroupchatWindow(self.plugin, account)
except RuntimeError:
@ -1938,6 +1935,7 @@ _('If "%s" accepts this request you will know his status.') %jid)
if self.plugin.windows[account].has_key('disco'):
self.plugin.windows[account]['disco'].window.present()
else:
# c http://nkour.blogspot.com/2005/05/pythons-init-return-none-doesnt-return.html
try:
self.plugin.windows[account]['disco'] = \
config.ServiceDiscoveryWindow(self.plugin, account)