Sadly, timeout_add_seconds is only availaible since gtk 2.14. It's quite recent. I have 2.10.
Reverting [9324]. Reopen #3734.
This commit is contained in:
parent
ad3935d9e9
commit
894e752292
|
@ -1134,9 +1134,9 @@ class ChatControl(ChatControlBase):
|
||||||
self.mouse_over_in_last_30_secs = True
|
self.mouse_over_in_last_30_secs = True
|
||||||
|
|
||||||
def _schedule_activity_timers(self):
|
def _schedule_activity_timers(self):
|
||||||
self.possible_paused_timeout_id = gobject.timeout_add_seconds(5,
|
self.possible_paused_timeout_id = gobject.timeout_add(5000,
|
||||||
self.check_for_possible_paused_chatstate, None)
|
self.check_for_possible_paused_chatstate, None)
|
||||||
self.possible_inactive_timeout_id = gobject.timeout_add_seconds(30,
|
self.possible_inactive_timeout_id = gobject.timeout_add(30000,
|
||||||
self.check_for_possible_inactive_chatstate, None)
|
self.check_for_possible_inactive_chatstate, None)
|
||||||
|
|
||||||
def update_ui(self):
|
def update_ui(self):
|
||||||
|
|
|
@ -277,7 +277,7 @@ class ConnectionZeroconf(ConnectionHandlersZeroconf):
|
||||||
|
|
||||||
# refresh all contacts data every five seconds
|
# refresh all contacts data every five seconds
|
||||||
self.call_resolve_timeout = True
|
self.call_resolve_timeout = True
|
||||||
gobject.timeout_add_seconds(5, self._on_resolve_timeout)
|
gobject.timeout_add(5000, self._on_resolve_timeout)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def disconnect(self, on_purpose = False):
|
def disconnect(self, on_purpose = False):
|
||||||
|
|
|
@ -1942,8 +1942,8 @@ class PopupNotificationWindow:
|
||||||
|
|
||||||
xml.signal_autoconnect(self)
|
xml.signal_autoconnect(self)
|
||||||
self.window.show_all()
|
self.window.show_all()
|
||||||
timeout = gajim.config.get('notification_timeout')
|
timeout = gajim.config.get('notification_timeout') * 1000 # make it ms
|
||||||
gobject.timeout_add_seconds(timeout, self.on_timeout)
|
gobject.timeout_add(timeout, self.on_timeout)
|
||||||
|
|
||||||
def on_close_button_clicked(self, widget):
|
def on_close_button_clicked(self, widget):
|
||||||
self.adjust_height_and_move_popup_notification_windows()
|
self.adjust_height_and_move_popup_notification_windows()
|
||||||
|
|
|
@ -152,7 +152,7 @@ class CacheDictionary:
|
||||||
if item.source:
|
if item.source:
|
||||||
gobject.source_remove(item.source)
|
gobject.source_remove(item.source)
|
||||||
if self.lifetime:
|
if self.lifetime:
|
||||||
source = gobject.timeout_add_seconds(self.lifetime/1000, self._expire_timeout, key)
|
source = gobject.timeout_add(self.lifetime, self._expire_timeout, key)
|
||||||
item.source = source
|
item.source = source
|
||||||
|
|
||||||
def __getitem__(self, key):
|
def __getitem__(self, key):
|
||||||
|
@ -1364,12 +1364,12 @@ class ToplevelAgentBrowser(AgentBrowser):
|
||||||
fraction = float(self._progress) / float(self._total_items)
|
fraction = float(self._progress) / float(self._total_items)
|
||||||
if self._progress >= self._total_items:
|
if self._progress >= self._total_items:
|
||||||
# We show the progressbar for just a bit before hiding it.
|
# We show the progressbar for just a bit before hiding it.
|
||||||
id = gobject.timeout_add_seconds(2, self._hide_progressbar_cb)
|
id = gobject.timeout_add(1500, self._hide_progressbar_cb)
|
||||||
self._progressbar_sourceid = id
|
self._progressbar_sourceid = id
|
||||||
else:
|
else:
|
||||||
self.window.progressbar.show()
|
self.window.progressbar.show()
|
||||||
# Hide the progressbar if we're timing out anyways. (20 secs)
|
# Hide the progressbar if we're timing out anyways. (20 secs)
|
||||||
id = gobject.timeout_add_seconds(20, self._hide_progressbar_cb)
|
id = gobject.timeout_add(20000, self._hide_progressbar_cb)
|
||||||
self._progressbar_sourceid = id
|
self._progressbar_sourceid = id
|
||||||
self.window.progressbar.set_fraction(fraction)
|
self.window.progressbar.set_fraction(fraction)
|
||||||
|
|
||||||
|
|
12
src/gajim.py
12
src/gajim.py
|
@ -533,7 +533,7 @@ class Interface:
|
||||||
# we stop blocking notifications of any kind
|
# we stop blocking notifications of any kind
|
||||||
# this prevents from getting the roster items as 'just signed in'
|
# this prevents from getting the roster items as 'just signed in'
|
||||||
# contacts. 30 seconds should be enough time
|
# contacts. 30 seconds should be enough time
|
||||||
gobject.timeout_add_seconds(30, self.unblock_signed_in_notifications, account)
|
gobject.timeout_add(30000, self.unblock_signed_in_notifications, account)
|
||||||
# sensitivity for this menuitem
|
# sensitivity for this menuitem
|
||||||
model[self.roster.status_message_menuitem_iter][3] = True
|
model[self.roster.status_message_menuitem_iter][3] = True
|
||||||
|
|
||||||
|
@ -648,7 +648,7 @@ class Interface:
|
||||||
gajim.newly_added[account].append(contact1.jid)
|
gajim.newly_added[account].append(contact1.jid)
|
||||||
if contact1.jid in gajim.to_be_removed[account]:
|
if contact1.jid in gajim.to_be_removed[account]:
|
||||||
gajim.to_be_removed[account].remove(contact1.jid)
|
gajim.to_be_removed[account].remove(contact1.jid)
|
||||||
gobject.timeout_add_seconds(5, self.roster.remove_newly_added,
|
gobject.timeout_add(5000, self.roster.remove_newly_added,
|
||||||
contact1.jid, account)
|
contact1.jid, account)
|
||||||
elif old_show > 1 and new_show == 0 and gajim.connections[account].\
|
elif old_show > 1 and new_show == 0 and gajim.connections[account].\
|
||||||
connected > 1:
|
connected > 1:
|
||||||
|
@ -657,7 +657,7 @@ class Interface:
|
||||||
if contact1.jid in gajim.newly_added[account]:
|
if contact1.jid in gajim.newly_added[account]:
|
||||||
gajim.newly_added[account].remove(contact1.jid)
|
gajim.newly_added[account].remove(contact1.jid)
|
||||||
self.roster.draw_contact(contact1.jid, account)
|
self.roster.draw_contact(contact1.jid, account)
|
||||||
gobject.timeout_add_seconds(5, self.roster.really_remove_contact,
|
gobject.timeout_add(5000, self.roster.really_remove_contact,
|
||||||
contact1, account)
|
contact1, account)
|
||||||
contact1.show = array[1]
|
contact1.show = array[1]
|
||||||
contact1.status = status_message
|
contact1.status = status_message
|
||||||
|
@ -684,7 +684,7 @@ class Interface:
|
||||||
# for 30s
|
# for 30s
|
||||||
account_ji = account + '/' + ji
|
account_ji = account + '/' + ji
|
||||||
gajim.block_signed_in_notifications[account_ji] = True
|
gajim.block_signed_in_notifications[account_ji] = True
|
||||||
gobject.timeout_add_seconds(30, self.unblock_signed_in_notifications,
|
gobject.timeout_add(30000, self.unblock_signed_in_notifications,
|
||||||
account_ji)
|
account_ji)
|
||||||
locations = (self.instances, self.instances[account])
|
locations = (self.instances, self.instances[account])
|
||||||
for location in locations:
|
for location in locations:
|
||||||
|
@ -2948,8 +2948,8 @@ class Interface:
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
gobject.timeout_add(200, self.process_connections)
|
gobject.timeout_add(200, self.process_connections)
|
||||||
else:
|
else:
|
||||||
gobject.timeout_add_seconds(2, self.process_connections)
|
gobject.timeout_add(2000, self.process_connections)
|
||||||
gobject.timeout_add_seconds(10, self.read_sleepy)
|
gobject.timeout_add(10000, self.read_sleepy)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
def sigint_cb(num, stack):
|
def sigint_cb(num, stack):
|
||||||
|
|
|
@ -87,13 +87,13 @@ class MusicTrackListener(gobject.GObject):
|
||||||
self.current_banshee_title = ''
|
self.current_banshee_title = ''
|
||||||
self.banshee_paused_before = False
|
self.banshee_paused_before = False
|
||||||
self.banshee_is_here = False
|
self.banshee_is_here = False
|
||||||
gobject.timeout_add_seconds(10, self._check_if_banshee_bus)
|
gobject.timeout_add(10000, self._check_if_banshee_bus)
|
||||||
if self.dubus_methods.NameHasOwner('org.gnome.Banshee'):
|
if self.dubus_methods.NameHasOwner('org.gnome.Banshee'):
|
||||||
self._get_banshee_bus()
|
self._get_banshee_bus()
|
||||||
self.banshee_is_here = True
|
self.banshee_is_here = True
|
||||||
# Otherwise, it opens Banshee!
|
# Otherwise, it opens Banshee!
|
||||||
self.banshee_props ={}
|
self.banshee_props ={}
|
||||||
gobject.timeout_add_seconds(1, self._banshee_check_track_status)
|
gobject.timeout_add(1000, self._banshee_check_track_status)
|
||||||
|
|
||||||
def _check_if_banshee_bus(self):
|
def _check_if_banshee_bus(self):
|
||||||
if self.dubus_methods.NameHasOwner('org.gnome.Banshee'):
|
if self.dubus_methods.NameHasOwner('org.gnome.Banshee'):
|
||||||
|
|
|
@ -248,7 +248,7 @@ class ProfileWindow:
|
||||||
self.statusbar.remove(self.context_id, self.message_id)
|
self.statusbar.remove(self.context_id, self.message_id)
|
||||||
self.message_id = self.statusbar.push(self.context_id,
|
self.message_id = self.statusbar.push(self.context_id,
|
||||||
_('Information received'))
|
_('Information received'))
|
||||||
self.remove_statusbar_timeout_id = gobject.timeout_add_seconds(3,
|
self.remove_statusbar_timeout_id = gobject.timeout_add(3000,
|
||||||
self.remove_statusbar, self.message_id)
|
self.remove_statusbar, self.message_id)
|
||||||
gobject.source_remove(self.update_progressbar_timeout_id)
|
gobject.source_remove(self.update_progressbar_timeout_id)
|
||||||
self.progressbar.hide()
|
self.progressbar.hide()
|
||||||
|
@ -344,7 +344,7 @@ class ProfileWindow:
|
||||||
self.statusbar.remove(self.context_id, self.message_id)
|
self.statusbar.remove(self.context_id, self.message_id)
|
||||||
self.message_id = self.statusbar.push(self.context_id,
|
self.message_id = self.statusbar.push(self.context_id,
|
||||||
_('Information NOT published'))
|
_('Information NOT published'))
|
||||||
self.remove_statusbar_timeout_id = gobject.timeout_add_seconds(3,
|
self.remove_statusbar_timeout_id = gobject.timeout_add(3000,
|
||||||
self.remove_statusbar, self.message_id)
|
self.remove_statusbar, self.message_id)
|
||||||
if self.update_progressbar_timeout_id is not None:
|
if self.update_progressbar_timeout_id is not None:
|
||||||
gobject.source_remove(self.update_progressbar_timeout_id)
|
gobject.source_remove(self.update_progressbar_timeout_id)
|
||||||
|
|
|
@ -5620,10 +5620,10 @@ class RosterWindow:
|
||||||
## accounts has no effect until they are connected.
|
## accounts has no effect until they are connected.
|
||||||
st = gajim.config.get('set_status_msg_from_current_music_track')
|
st = gajim.config.get('set_status_msg_from_current_music_track')
|
||||||
if st:
|
if st:
|
||||||
gobject.timeout_add_seconds(1,
|
gobject.timeout_add(1000,
|
||||||
self.enable_syncing_status_msg_from_current_music_track, st)
|
self.enable_syncing_status_msg_from_current_music_track, st)
|
||||||
else:
|
else:
|
||||||
gobject.timeout_add_seconds(1,
|
gobject.timeout_add(1000,
|
||||||
self.enable_syncing_status_msg_from_lastfm,
|
self.enable_syncing_status_msg_from_lastfm,
|
||||||
gajim.config.get('set_status_msg_from_lastfm'))
|
gajim.config.get('set_status_msg_from_lastfm'))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue