GObject -> GLib

This commit is contained in:
Yann Leboulanger 2013-07-29 18:35:49 +02:00
parent 3bd8c6e144
commit 137ae2b54a
8 changed files with 30 additions and 27 deletions

View File

@ -35,7 +35,7 @@ commands as a frontend.
from subprocess import Popen, PIPE
from os.path import expanduser
from gi.repository import GObject
from gi.repository import GLib
from ..framework import CommandContainer, command, doc
from .hosts import *
@ -64,7 +64,7 @@ class Execute(CommandContainer):
@classmethod
def monitor(cls, processor, popen):
poller = cls.poller(processor, popen)
GObject.timeout_add(cls.POLL_INTERVAL, next, poller)
GLib.timeout_add(cls.POLL_INTERVAL, next, poller)
@classmethod
def poller(cls, processor, popen):

View File

@ -30,7 +30,7 @@
import socket
import base64
from gi.repository import GObject
from gi.repository import GLib
import time
import nbxmpp
@ -442,7 +442,7 @@ class ConnectionSocks5Bytestream(ConnectionBytestream):
def cleanup_gupnp():
if self.no_gupnp_reply_id:
GObject.source_remove(self.no_gupnp_reply_id)
GLib.source_remove(self.no_gupnp_reply_id)
self.no_gupnp_reply_id = 0
gajim.gupnp_igd.disconnect(self.ok_id)
gajim.gupnp_igd.disconnect(self.fail_id)
@ -482,7 +482,7 @@ class ConnectionSocks5Bytestream(ConnectionBytestream):
self.fail_id = gajim.gupnp_igd.connect('error-mapping-port', fail)
port = gajim.config.get('file_transfers_port')
self.no_gupnp_reply_id = GObject.timeout_add_seconds(10, no_upnp_reply)
self.no_gupnp_reply_id = GLib.timeout_add_seconds(10, no_upnp_reply)
gajim.gupnp_igd.add_port('TCP', 0, my_ip, port, 3600,
'Gajim file transfer')

View File

@ -39,7 +39,7 @@ import signal
if os.name != 'nt':
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
import getpass
from gi.repository import GObject
from gi.repository import GLib
from common.connection import CommonConnection
from common import gajim
@ -239,7 +239,7 @@ class ConnectionZeroconf(CommonConnection, ConnectionHandlersZeroconf):
# refresh all contacts data every five seconds
self.call_resolve_timeout = True
GObject.timeout_add_seconds(5, self._on_resolve_timeout)
GLib.timeout_add_seconds(5, self._on_resolve_timeout)
return True
def disconnect(self, on_purpose=False):

View File

@ -29,6 +29,7 @@ from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GdkPixbuf
from gi.repository import GObject
from gi.repository import GLib
import base64
import gtkgui_helpers
@ -640,7 +641,7 @@ class SingleForm(Gtk.Table, object):
dialogs.ErrorDialog(
_('Jabber ID already in list'),
_('The Jabber ID you entered is already in the list. Choose another one.'))
GObject.idle_add(treeview.set_cursor, path)
GLib.idle_add(treeview.set_cursor, path)
return
model[path][0]=newtext

View File

@ -27,7 +27,7 @@
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GObject
from gi.repository import GLib
import time
import calendar
@ -120,7 +120,7 @@ class HistoryWindow:
# This will load history too
task = self._fill_completion_dict()
GObject.idle_add(next, task)
GLib.idle_add(next, task)
if jid:
self.jid_entry.set_text(jid)
@ -634,7 +634,7 @@ class HistoryWindow:
self.jid_entry.set_text(jid)
if account and account not in self.accounts_seen_online:
# Update dict to not only show bare jid
GObject.idle_add(next, self._fill_completion_dict())
GLib.idle_add(next, self._fill_completion_dict())
else:
# Only in that case because it's called by self._fill_completion_dict()
# otherwise

View File

@ -44,6 +44,7 @@ is available at U{http://www.opensource.org/licenses/bsd-license.php}
from gi.repository import Gtk
from gi.repository import GObject
from gi.repository import GLib
import re
import sys
import os
@ -367,7 +368,7 @@ class ConsoleView(Gtk.TextView):
self.connect('key-press-event', self.onKeyPress)
def write(self, text, editable=False):
GObject.idle_add(self._write, text, editable)
GLib.idle_add(self._write, text, editable)
def _write(self, text, editable=False):
"""
@ -401,7 +402,7 @@ class ConsoleView(Gtk.TextView):
def showPrompt(self, prompt):
GObject.idle_add(self._showPrompt, prompt)
GLib.idle_add(self._showPrompt, prompt)
def _showPrompt(self, prompt):
"""
@ -415,7 +416,7 @@ class ConsoleView(Gtk.TextView):
self.text_buffer.get_end_iter())
def changeLine(self, text):
GObject.idle_add(self._changeLine, text)
GLib.idle_add(self._changeLine, text)
def _changeLine(self, text):
"""
@ -442,7 +443,7 @@ class ConsoleView(Gtk.TextView):
return rv
def showReturned(self, text):
GObject.idle_add(self._showReturned, text)
GLib.idle_add(self._showReturned, text)
def _showReturned(self, text):
"""

View File

@ -26,6 +26,7 @@ import gc
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GObject
from gi.repository import GLib
from gi.repository import Pango
import gtkgui_helpers
@ -284,7 +285,7 @@ class MessageTextView(Gtk.TextView):
return None
def destroy(self):
GObject.idle_add(gc.collect)
GLib.idle_add(gc.collect)
def clear(self, widget = None):
"""

View File

@ -26,7 +26,7 @@
## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
##
from gi.repository import GObject
from gi.repository import GLib
from gi.repository import Gtk
import os
import base64
@ -559,8 +559,8 @@ class SignalObject(dbus.service.Object):
if account not in gajim.connections:
return DBUS_BOOLEAN(False)
status = gajim.SHOW_LIST[gajim.connections[account].connected]
GObject.idle_add(gajim.interface.roster.send_status, account,
status, message)
GLib.idle_add(gajim.interface.roster.send_status, account, status,
message)
else:
# account not specified, so change the status of all accounts
for acc in gajim.contacts.get_accounts():
@ -573,8 +573,8 @@ class SignalObject(dbus.service.Object):
if acc not in gajim.connections:
continue
status_ = gajim.SHOW_LIST[gajim.connections[acc].connected]
GObject.idle_add(gajim.interface.roster.send_status, acc,
status_, message)
GLib.idle_add(gajim.interface.roster.send_status, acc, status_,
message)
return DBUS_BOOLEAN(False)
@dbus.service.method(INTERFACE, in_signature='ss', out_signature='')
@ -587,8 +587,8 @@ class SignalObject(dbus.service.Object):
gajim.config.set_per('accounts', account, 'priority', prio)
show = gajim.SHOW_LIST[gajim.connections[account].connected]
status = gajim.connections[account].status
GObject.idle_add(gajim.connections[account].change_status, show,
status)
GLib.idle_add(gajim.connections[account].change_status, show,
status)
else:
# account not specified, so change prio of all accounts
for acc in gajim.contacts.get_accounts():
@ -600,8 +600,8 @@ class SignalObject(dbus.service.Object):
gajim.config.set_per('accounts', acc, 'priority', prio)
show = gajim.SHOW_LIST[gajim.connections[acc].connected]
status = gajim.connections[acc].status
GObject.idle_add(gajim.connections[acc].change_status, show,
status)
GLib.idle_add(gajim.connections[acc].change_status, show,
status)
@dbus.service.method(INTERFACE, in_signature='', out_signature='')
def show_next_pending_event(self):
@ -693,7 +693,7 @@ class SignalObject(dbus.service.Object):
"""
win = gajim.interface.roster.window
if win.get_property('visible'):
GObject.idle_add(win.hide)
GLib.idle_add(win.hide)
else:
win.present()
# preserve the 'steal focus preservation'
@ -723,7 +723,7 @@ class SignalObject(dbus.service.Object):
win = gajim.ipython_window
if win:
if win.window.is_visible():
GObject.idle_add(win.hide)
GLib.idle_add(win.hide)
else:
win.show_all()
win.present()