orca r4607 - in trunk: . src/orca



Author: wwalker
Date: Thu Feb 26 18:12:30 2009
New Revision: 4607
URL: http://svn.gnome.org/viewvc/orca?rev=4607&view=rev

Log:
Fix for bug #572215 - Opening preferences launches magnifier


Modified:
   trunk/ChangeLog
   trunk/src/orca/mag.py
   trunk/src/orca/orca_gui_prefs.py

Modified: trunk/src/orca/mag.py
==============================================================================
--- trunk/src/orca/mag.py	(original)
+++ trunk/src/orca/mag.py	Thu Feb 26 18:12:30 2009
@@ -470,15 +470,14 @@
     # Depends upon new functionality in gnome-mag, so just catch the 
     # exception if this functionality isn't there.
     #
-    try:
-        hideCursor = restore.get('magHideCursor', settings.magHideCursor)
-        if hideCursor and \
-           _fullScreenCapable and \
-           _magnifier.SourceDisplay == _magnifier.TargetDisplay and \
-           position == settings.MAG_ZOOMER_TYPE_FULL_SCREEN:
-            _magnifier.hideCursor()
-    except:
-        pass
+    hideCursor = restore.get('magHideCursor', settings.magHideCursor)
+    if hideCursor \
+       and _fullScreenCapable \
+       and _magnifier.SourceDisplay == _magnifier.TargetDisplay \
+       and position == settings.MAG_ZOOMER_TYPE_FULL_SCREEN:
+        hideSystemPointer(True)
+    else:
+        hideSystemPointer(False)
 
     _magnifierPBag = _magnifier.getProperties()
     sdb = _magnifierPBag.getValue("source-display-bounds").value()
@@ -1004,6 +1003,7 @@
     # See http://bugzilla.gnome.org/show_bug.cgi?id=375396.
     #
     try:
+        hideSystemPointer(False)
         _magnifier.clearAllZoomRegions()
         _magnifier.dispose()
     except:
@@ -1392,19 +1392,13 @@
     if updateScreen:
         _zoomer.markDirty(_roi)
 
-def setSystemPointer(hidePointer):
+def hideSystemPointer(hidePointer):
     """Hide or show the system pointer.
 
     Arguments:
     -hidePointer: If True, hide the system pointer, otherwise show it.
     """
 
-    global _magnifier
-
-    if not _initialized:
-        _magnifier = bonobo.get_object("OAFIID:GNOME_Magnifier_Magnifier:0.9",
-                                       "GNOME/Magnifier/Magnifier")
-
     # Depends upon new functionality in gnome-mag, so just catch the
     # exception if this functionality isn't there.
     #
@@ -1414,7 +1408,7 @@
         else:
             _magnifier.showCursor()
     except:
-        pass
+        debug.printException(debug.LEVEL_FINEST)
 
 def isFullScreenCapable():
     """Returns True if we are capable of doing full screen (i.e. whether

Modified: trunk/src/orca/orca_gui_prefs.py
==============================================================================
--- trunk/src/orca/orca_gui_prefs.py	(original)
+++ trunk/src/orca/orca_gui_prefs.py	Thu Feb 26 18:12:30 2009
@@ -1784,18 +1784,6 @@
         self.get_widget("magZoomerCustomPositionTable").\
                 set_sensitive(zoomerPref == settings.MAG_ZOOMER_TYPE_CUSTOM)
 
-        # If the Zoomer settings position is full screen, and we are full
-        # screen capable and we are capable of hiding or showing the system
-        # pointer, then show the Hide system cursor checkbox.
-        #
-        isFullScreen = (zoomerPref == settings.MAG_ZOOMER_TYPE_FULL_SCREEN)
-        try:
-            showCheckbox = mag.isFullScreenCapable() and isFullScreen
-            mag.setSystemPointer(False)
-        except:
-            showCheckbox = False
-        self.get_widget("magHideCursorCheckButton").set_sensitive(showCheckbox)
-
         # Populate the zoomer spin buttons based on the size of the target
         # display.
         #
@@ -3013,6 +3001,15 @@
         if self.enableLiveUpdating and widget.is_focus():
             if enable:
                 mag.init()
+                # If the Zoomer settings position is full screen, and
+                # we are full screen capable and we are capable of
+                # hiding or showing the system pointer, then show the
+                # Hide system cursor checkbox.
+                #
+                isFullScreen = (self.prefsDict["magZoomerType"] \
+                                == settings.MAG_ZOOMER_TYPE_FULL_SCREEN)
+                self.get_widget("magHideCursorCheckButton").set_sensitive(
+                    mag.isFullScreenCapable() and isFullScreen)
             else:
                 mag.shutdown()
         self.prefsDict["enableMagnifier"] = enable
@@ -3205,12 +3202,8 @@
         # pointer, then show the Hide system cursor checkbox.
         #
         isFullScreen = (zoomerType == settings.MAG_ZOOMER_TYPE_FULL_SCREEN)
-        try:
-            showCheckbox = mag.isFullScreenCapable() and isFullScreen
-            mag.setSystemPointer(False)
-        except:
-            showCheckbox = False
-        self.get_widget("magHideCursorCheckButton").set_sensitive(showCheckbox)
+        self.get_widget("magHideCursorCheckButton").set_sensitive(
+            mag.isFullScreenCapable() and isFullScreen)
 
         # Also if it's not full screen, then automatically clear the 
         # 'hide cursor' preference and check box.
@@ -3222,11 +3215,6 @@
         if not self.enableLiveUpdating:
             return
 
-        try:
-            mag.setSystemPointer(self.prefsDict["magHideCursor"])
-        except:
-            pass
-
         if zoomerType == settings.MAG_ZOOMER_TYPE_CUSTOM:
             top = \
                 self.get_widget("magZoomerTopSpinButton").get_value_as_int()
@@ -3257,7 +3245,7 @@
         self.prefsDict["magHideCursor"] = checked
 
         if self.enableLiveUpdating:
-            mag.setSystemPointer(checked)
+            mag.hideSystemPointer(checked)
 
     def magZoomerTopValueChanged(self, widget):
         """Signal handler for the "value_changed" signal for the



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]