now sensitivity on/off for change status menuitem works ok
This commit is contained in:
parent
fbc668841e
commit
f5089a8c69
2 changed files with 21 additions and 19 deletions
12
src/gajim.py
12
src/gajim.py
|
@ -230,16 +230,20 @@ class Interface:
|
||||||
def allow_notif(self, account):
|
def allow_notif(self, account):
|
||||||
gajim.allow_notifications[account] = True
|
gajim.allow_notifications[account] = True
|
||||||
|
|
||||||
|
|
||||||
def handle_event_status(self, account, status): # OUR status
|
def handle_event_status(self, account, status): # OUR status
|
||||||
#('STATUS', account, status)
|
#('STATUS', account, status)
|
||||||
if status != 'offline':
|
model = self.roster.status_combobox.get_model()
|
||||||
gobject.timeout_add(30000, self.allow_notif, account)
|
if status == 'offline':
|
||||||
else:
|
model[self.roster.status_message_menuitem_iter][3] = False # sensitivity for this menuitem
|
||||||
gajim.allow_notifications[account] = False
|
gajim.allow_notifications[account] = False
|
||||||
# we are disconnected from all gc
|
# we are disconnected from all gc
|
||||||
for room_jid in gajim.gc_connected[account]:
|
for room_jid in gajim.gc_connected[account]:
|
||||||
if self.windows[account]['gc'].has_key(room_jid):
|
if self.windows[account]['gc'].has_key(room_jid):
|
||||||
self.windows[account]['gc'][room_jid].got_disconnected(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)
|
self.roster.on_status_changed(account, status)
|
||||||
if self.remote and self.remote.is_enabled():
|
if self.remote and self.remote.is_enabled():
|
||||||
self.remote.raise_signal('AccountPresence', (status, account))
|
self.remote.raise_signal('AccountPresence', (status, account))
|
||||||
|
@ -266,7 +270,7 @@ class Interface:
|
||||||
ji = jid.replace('@', '')
|
ji = jid.replace('@', '')
|
||||||
else:
|
else:
|
||||||
ji = jid
|
ji = jid
|
||||||
#Update user
|
# Update contact
|
||||||
if gajim.contacts[account].has_key(ji):
|
if gajim.contacts[account].has_key(ji):
|
||||||
luser = gajim.contacts[account][ji]
|
luser = gajim.contacts[account][ji]
|
||||||
user1 = None
|
user1 = None
|
||||||
|
|
|
@ -1437,7 +1437,7 @@ _('If "%s" accepts this request you will know his status.') %jid)
|
||||||
if not gajim.config.get_per('accounts', acct,
|
if not gajim.config.get_per('accounts', acct,
|
||||||
'sync_with_global_status'):
|
'sync_with_global_status'):
|
||||||
continue
|
continue
|
||||||
# We're going ti change our status to invisible
|
# We're going to change our status to invisible
|
||||||
if self.connected_rooms(acct):
|
if self.connected_rooms(acct):
|
||||||
bug_user = True
|
bug_user = True
|
||||||
break
|
break
|
||||||
|
@ -1454,13 +1454,10 @@ _('If "%s" accepts this request you will know his status.') %jid)
|
||||||
for acct in accounts:
|
for acct in accounts:
|
||||||
if not gajim.config.get_per('accounts', acct, 'sync_with_global_status'):
|
if not gajim.config.get_per('accounts', acct, 'sync_with_global_status'):
|
||||||
continue
|
continue
|
||||||
# FIXME: not here why?
|
# we are connected or we want to connect
|
||||||
if not one_connected or gajim.connections[acct].connected > 1:
|
if not one_connected or gajim.connections[acct].connected > 1:
|
||||||
self.send_status(acct, status, message)
|
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):
|
def update_status_comboxbox(self):
|
||||||
# table to change index in plugin.connected to index in combobox
|
# 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}
|
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'):
|
if self.plugin.windows[account].has_key('join_gc'):
|
||||||
self.plugin.windows[account]['join_gc'].window.present()
|
self.plugin.windows[account]['join_gc'].window.present()
|
||||||
else:
|
else:
|
||||||
#FIXME: Why this try/except?
|
# c http://nkour.blogspot.com/2005/05/pythons-init-return-none-doesnt-return.html
|
||||||
try:
|
try:
|
||||||
self.plugin.windows[account]['join_gc'] = dialogs.JoinGroupchatWindow(self.plugin, account)
|
self.plugin.windows[account]['join_gc'] = dialogs.JoinGroupchatWindow(self.plugin, account)
|
||||||
except RuntimeError:
|
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'):
|
if self.plugin.windows[account].has_key('disco'):
|
||||||
self.plugin.windows[account]['disco'].window.present()
|
self.plugin.windows[account]['disco'].window.present()
|
||||||
else:
|
else:
|
||||||
|
# c http://nkour.blogspot.com/2005/05/pythons-init-return-none-doesnt-return.html
|
||||||
try:
|
try:
|
||||||
self.plugin.windows[account]['disco'] = \
|
self.plugin.windows[account]['disco'] = \
|
||||||
config.ServiceDiscoveryWindow(self.plugin, account)
|
config.ServiceDiscoveryWindow(self.plugin, account)
|
||||||
|
|
Loading…
Add table
Reference in a new issue