[orca] Replace deprecated GObject functions with their GLib equivalents
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Replace deprecated GObject functions with their GLib equivalents
- Date: Tue, 20 Nov 2012 02:39:13 +0000 (UTC)
commit 5814ff698154c0e387414b2e0b6f5ad80814aa1f
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Mon Nov 19 21:39:00 2012 -0500
Replace deprecated GObject functions with their GLib equivalents
src/orca/braille.py | 5 +++--
src/orca/event_manager.py | 4 ++--
src/orca/liveregions.py | 4 ++--
src/orca/mouse_review.py | 10 +++++-----
src/orca/orca_gui_prefs.py | 3 ++-
src/orca/orca_gui_splash.py | 4 ++--
src/orca/scripts/apps/gnome-search-tool/script.py | 3 ++-
src/orca/speechdispatcherfactory.py | 8 ++++----
8 files changed, 22 insertions(+), 19 deletions(-)
---
diff --git a/src/orca/braille.py b/src/orca/braille.py
index 1866ef3..5899fe3 100644
--- a/src/orca/braille.py
+++ b/src/orca/braille.py
@@ -37,6 +37,7 @@ log = logging.getLogger("braille")
import signal
import os
+from gi.repository import GLib
from gi.repository import GObject
GObject.threads_init()
@@ -1478,7 +1479,7 @@ def resetFlashTimer():
if _flashEventSourceId > 0:
GObject.source_remove(_flashEventSourceId)
flashTime = _saved[3]
- _flashEventSourceId = GObject.timeout_add(flashTime, _flashCallback)
+ _flashEventSourceId = GLib.timeout_add(flashTime, _flashCallback)
def _initFlash(flashTime):
"""Sets up the state needed to flash a message or clears any existing
@@ -1503,7 +1504,7 @@ def _initFlash(flashTime):
_saved = (_lines, _regionWithFocus, viewport, flashTime)
if flashTime > 0:
- _flashEventSourceId = GObject.timeout_add(flashTime, _flashCallback)
+ _flashEventSourceId = GLib.timeout_add(flashTime, _flashCallback)
elif flashTime < 0:
_flashEventSourceId = -666
diff --git a/src/orca/event_manager.py b/src/orca/event_manager.py
index f2a263c..38e614b 100644
--- a/src/orca/event_manager.py
+++ b/src/orca/event_manager.py
@@ -24,7 +24,7 @@ __date__ = "$Date$"
__copyright__ = "Copyright (c) 2011. Orca Team."
__license__ = "LGPL"
-from gi.repository import GObject
+from gi.repository import GLib
import pyatspi
import queue
import threading
@@ -109,7 +109,7 @@ class EventManager:
if asyncMode and not self._gidleId:
if settings.gilSleepTime:
time.sleep(settings.gilSleepTime)
- self._gidleId = GObject.idle_add(self._dequeue)
+ self._gidleId = GLib.idle_add(self._dequeue)
if debugging:
debug.println(debug.LEVEL_ALL, " releasing lock...")
diff --git a/src/orca/liveregions.py b/src/orca/liveregions.py
index 6a58bf2..1f6017c 100644
--- a/src/orca/liveregions.py
+++ b/src/orca/liveregions.py
@@ -1,5 +1,5 @@
import bisect
-from gi.repository import GObject
+from gi.repository import GLib
from . import orca_state
import pyatspi
from . import speech
@@ -182,7 +182,7 @@ class LiveRegionManager:
message = self._getMessage(event)
if message:
if len(self.msg_queue) == 0:
- GObject.timeout_add(100, self.pumpMessages)
+ GLib.timeout_add(100, self.pumpMessages)
self.msg_queue.enqueue(message, politeness, event.source)
def pumpMessages(self):
diff --git a/src/orca/mouse_review.py b/src/orca/mouse_review.py
index 0c7ec0e..12b39ff 100644
--- a/src/orca/mouse_review.py
+++ b/src/orca/mouse_review.py
@@ -37,7 +37,7 @@ except:
import pyatspi
from gi.repository import Gdk
-from gi.repository import GObject
+from gi.repository import GLib
from . import event_manager
from . import script_manager
@@ -184,10 +184,10 @@ class MouseReviewer:
- event: The event we recieved.
"""
if settings.mouseDwellDelay:
- GObject.timeout_add(settings.mouseDwellDelay,
- self._mouseDwellTimeout,
- event.detail1,
- event.detail2)
+ GLib.timeout_add(settings.mouseDwellDelay,
+ self._mouseDwellTimeout,
+ event.detail1,
+ event.detail2)
else:
self._mouseDwellTimeout(event.detail1, event.detail2)
diff --git a/src/orca/orca_gui_prefs.py b/src/orca/orca_gui_prefs.py
index bf11d7f..9a37d9e 100644
--- a/src/orca/orca_gui_prefs.py
+++ b/src/orca/orca_gui_prefs.py
@@ -28,6 +28,7 @@ __license__ = "LGPL"
import os
import sys
from gi.repository import Gdk
+from gi.repository import GLib
from gi.repository import Gtk
from gi.repository import GObject
from gi.repository import Pango
@@ -2872,7 +2873,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
#
msg = _("The key entered is already bound to %s") % description
delay = int(1000 * settings.doubleClickTimeout)
- GObject.timeout_add(delay, self._presentMessage, msg)
+ GLib.timeout_add(delay, self._presentMessage, msg)
else:
# Translators: this is a spoken prompt letting the user know Orca
# know Orca has recorded a new key combination (e.g., Alt+Ctrl+g)
diff --git a/src/orca/orca_gui_splash.py b/src/orca/orca_gui_splash.py
index 6b6e2be..c17fec0 100644
--- a/src/orca/orca_gui_splash.py
+++ b/src/orca/orca_gui_splash.py
@@ -30,7 +30,7 @@ import sys
from . import debug
from gi.repository import Gdk
from gi.repository import Gtk
-from gi.repository import GObject
+from gi.repository import GLib
import locale
from . import orca_state
@@ -82,7 +82,7 @@ class OrcaSplashGUI(Gtk.Window):
self.grab_focus()
self.show_all()
- GObject.timeout_add(3000, self.hideGUI)
+ GLib.timeout_add(3000, self.hideGUI)
while Gtk.events_pending():
Gtk.main_iteration()
diff --git a/src/orca/scripts/apps/gnome-search-tool/script.py b/src/orca/scripts/apps/gnome-search-tool/script.py
index 343d020..51e4553 100644
--- a/src/orca/scripts/apps/gnome-search-tool/script.py
+++ b/src/orca/scripts/apps/gnome-search-tool/script.py
@@ -33,6 +33,7 @@ from orca.orca_i18n import ngettext # for gettext support
import pyatspi
import time
+from gi.repository import GLib
from gi.repository import GObject
GObject.threads_init()
@@ -148,7 +149,7 @@ class Script(default.Script):
frame, pyatspi.ROLE_TABLE)
self.fileTable = allTables[0]
- GObject.idle_add(self._speakSearching)
+ GLib.idle_add(self._speakSearching)
# Check to see if we have just had an "object:state-changed:showing"
# event for the Find button. If the name is "Find", and one of its
diff --git a/src/orca/speechdispatcherfactory.py b/src/orca/speechdispatcherfactory.py
index dc7e5ef..30f8644 100644
--- a/src/orca/speechdispatcherfactory.py
+++ b/src/orca/speechdispatcherfactory.py
@@ -38,7 +38,7 @@ __author__ = "Tomas Cerha <cerha brailcom org>"
__copyright__ = "Copyright (c) 2006-2008 Brailcom, o.p.s."
__license__ = "LGPL"
-from gi.repository import GObject
+from gi.repository import GLib
import re
from . import chnames
@@ -355,9 +355,9 @@ class SpeechServer(speechserver.SpeechServer):
context.currentOffset = context.startOffset
elif t == speechserver.SayAllContext.COMPLETED:
context.currentOffset = context.endOffset
- GObject.idle_add(orca_callback, context, t)
+ GLib.idle_add(orca_callback, context, t)
if t == speechserver.SayAllContext.COMPLETED:
- GObject.idle_add(self._say_all, iterator, orca_callback)
+ GLib.idle_add(self._say_all, iterator, orca_callback)
self._speak(context.utterance, acss, callback=callback,
event_types=list(self._CALLBACK_TYPE_MAP.keys()))
return False # to indicate, that we don't want to be called again.
@@ -437,7 +437,7 @@ class SpeechServer(speechserver.SpeechServer):
self._speak(utterance, acss)
def sayAll(self, utteranceIterator, progressCallback):
- GObject.idle_add(self._say_all, utteranceIterator, progressCallback)
+ GLib.idle_add(self._say_all, utteranceIterator, progressCallback)
def speakCharacter(self, character, acss=None):
self._apply_acss(acss)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]