accerciser r653 - in trunk: . help/C plugins src src/lib/accerciser src/lib/accerciser/plugin



Author: eitani
Date: Fri Oct 10 23:13:45 2008
New Revision: 653
URL: http://svn.gnome.org/viewvc/accerciser?rev=653&view=rev

Log:
        * src/lib/accerciser/i18n.py.in:
        * src/lib/accerciser/plugin/plugin_manager.py:
        * src/lib/accerciser/ui_manager.py: Added proper context to the term
        'View' with the Q_ thing. Thanks Wouter Bolsterlee! Bug #520296.

        * src/lib/accerciser/node.py: When a node is updated to desktop,
        * don't
        highlight the entire desktop, it get's annoying.

        * plugins/event_monitor.py: Disable event monitoring if the event we
        are listening for disappears.

        * plugins/interface_view.py: Catch exceptions when getting states
        during state changes, they could be defunct state, which means the
        object is dead.

        * src/accerciser.in: Set process name to 'accerciser'. Bug #555416.

        * configure.in: Bumped version to 1.5.1

        * help/C/accerciser.xml: Changed "left plugin display area" to
        * "right
        plugin display area". Bug #555108. Thanks Lucas Lommer!

Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/help/C/accerciser.xml
   trunk/plugins/event_monitor.py
   trunk/plugins/interface_view.py
   trunk/src/accerciser.in
   trunk/src/lib/accerciser/i18n.py.in
   trunk/src/lib/accerciser/node.py
   trunk/src/lib/accerciser/plugin/plugin_manager.py
   trunk/src/lib/accerciser/tools.py
   trunk/src/lib/accerciser/ui_manager.py

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Fri Oct 10 23:13:45 2008
@@ -1,4 +1,4 @@
-AC_INIT(Accerciser, 1.4.0, eitan ascender com, accerciser)
+AC_INIT(Accerciser, 1.5.1, eitan ascender com, accerciser)
 AC_CONFIG_SRCDIR(src/accerciser.in)
 AM_INIT_AUTOMAKE
 AM_MAINTAINER_MODE

Modified: trunk/help/C/accerciser.xml
==============================================================================
--- trunk/help/C/accerciser.xml	(original)
+++ trunk/help/C/accerciser.xml	Fri Oct 10 23:13:45 2008
@@ -193,7 +193,7 @@
             <textobject> 
               <phrase>
 				Shows &app; main window. Contains title bar, menu bar,
-				accessible tree , left plugin display area, and bottom plugin
+				accessible tree , right plugin display area, and bottom plugin
 				display area. The menu bar contains File, Edit, Bookmarks, 
 				View, and Help menus.
 			  </phrase> 

Modified: trunk/plugins/event_monitor.py
==============================================================================
--- trunk/plugins/event_monitor.py	(original)
+++ trunk/plugins/event_monitor.py	Fri Oct 10 23:13:45 2008
@@ -79,6 +79,8 @@
 
     self.listen_list = []
 
+    self.node.connect('accessible-changed', self._onNodeUpdated)
+
     self.main_xml.signal_autoconnect(self)
     self.show_all()
 
@@ -89,6 +91,11 @@
   def _onClearlog(self):
     self.monitor_buffer.set_text('')
 
+  def _onNodeUpdated(self, node, acc):
+    if acc == node.desktop and \
+          self.source_filter in ('source_app', 'source_acc'):
+      self.monitor_toggle.set_active(False)
+
   def _popEventsModel(self):
     '''
     Populate the model for the event types tree view. Uses a constant
@@ -517,10 +524,9 @@
     @rtype: boolean
     '''
     if self.source_filter == 'source_app':
-      if (hasattr(event.source, 'getApplication') and
-          hasattr(self.acc, 'getApplication')):
+      try:
         return event.source.getApplication() == self.acc.getApplication()
-      else:
+      except:
         return False
     elif self.source_filter == 'source_acc':
       return event.source == self.acc

Modified: trunk/plugins/interface_view.py
==============================================================================
--- trunk/plugins/interface_view.py	(original)
+++ trunk/plugins/interface_view.py	Fri Oct 10 23:13:45 2008
@@ -420,8 +420,12 @@
     '''
     if self.node.acc == event.source:
       self.states_model.clear()
-      states = [pyatspi.stateToString(s) for s in \
-                  self.node.acc.getState().getStates()]
+      try:
+        states = [pyatspi.stateToString(s) for s in \
+                    self.node.acc.getState().getStates()]
+      except LookupError:
+        # Maybe we got a defunct state, in which case the object is diseased.
+        states = []
       states.sort()
       map(self.states_model.append, [[state] for state in states])        
 

Modified: trunk/src/accerciser.in
==============================================================================
--- trunk/src/accerciser.in	(original)
+++ trunk/src/accerciser.in	Fri Oct 10 23:13:45 2008
@@ -31,7 +31,8 @@
 import gnome
 # make this program accessible
 props = { gnome.PARAM_APP_DATADIR : os.path.join(sys.prefix, 'share')}
-gnome.program_init('accerciser', '@VERSION@', properties=props)
+gnome.program_init('accerciser', '@VERSION@', 
+                   properties=props, argv=['accerciser'] + sys.argv[1:])
 
 import gtk
 # initialize threads

Modified: trunk/src/lib/accerciser/i18n.py.in
==============================================================================
--- trunk/src/lib/accerciser/i18n.py.in	(original)
+++ trunk/src/lib/accerciser/i18n.py.in	Fri Oct 10 23:13:45 2008
@@ -60,5 +60,22 @@
 DOMAIN = '@GETTEXT_PACKAGE@'
 # build a default instance to the LSR domain and locale directory
 _ = bind(DOMAIN, LOCALE_DIR)
+
+def Q_(s):
+  '''Provide qualified translatable strings.  Some strings translate to
+  more than one string in another locale.  We provide a convention to
+  provide contextual information for the string so that translators can
+  do the right thing: we embed a '|' character in the string to be
+  translated.  The string before the '|' provides the context, and the
+  string after the '|' provides the string to translate.  For example:
+  'radiobutton|selected' and 'text|selected' are used to provide context
+  for the word 'selected'.
+  
+  We need to handle the case where the string has not been translated,
+  however, and we do so by stripping off the contextual information.
+
+  Plagiarized from Orca'''
+  return _(s).split('|', 1)[-1]
+
 # allow gettext to extract the string, but it should not be translated inline.
 N_ = lambda string: string

Modified: trunk/src/lib/accerciser/node.py
==============================================================================
--- trunk/src/lib/accerciser/node.py	(original)
+++ trunk/src/lib/accerciser/node.py	Fri Oct 10 23:13:45 2008
@@ -92,9 +92,11 @@
       if isinstance(i, pyatspi.Accessibility.Component):
         self.extents = i.getExtents(pyatspi.DESKTOP_COORDS)
     self.tree_path = None
-    self.highlight()
-    self.emit('accessible-changed', acc)
-  
+    if acc != self.desktop:
+        # Don't highlight the entire desktop, it gets annoying.
+        self.highlight()
+    self.emit('accessible-changed', acc)  
+
   def updateToPath(self, app_name, path):
     '''
     Update the node with a new accessible by providing a tree path 

Modified: trunk/src/lib/accerciser/plugin/plugin_manager.py
==============================================================================
--- trunk/src/lib/accerciser/plugin/plugin_manager.py	(original)
+++ trunk/src/lib/accerciser/plugin/plugin_manager.py	Fri Oct 10 23:13:45 2008
@@ -22,7 +22,7 @@
 import imp
 import traceback
 import gconf
-from accerciser.i18n import _, N_
+from accerciser.i18n import _, N_, Q_
 
 GCONF_PLUGIN_DISABLED = '/apps/accerciser/disabled_plugins'      
 
@@ -375,7 +375,7 @@
       # Translators: This is the viewport in which the plugin appears,
       # it is a noun.
       # 
-      tvc = gtk.TreeViewColumn(_('View'))
+      tvc = gtk.TreeViewColumn(Q_('viewport|View'))
       tvc.pack_start(crc, False)
       tvc.set_cell_data_func(crc, self._viewNameDataFunc)
       crc.set_property('editable', True)

Modified: trunk/src/lib/accerciser/tools.py
==============================================================================
--- trunk/src/lib/accerciser/tools.py	(original)
+++ trunk/src/lib/accerciser/tools.py	Fri Oct 10 23:13:45 2008
@@ -46,14 +46,16 @@
       app = acc.getApplication()
     except Exception, e:
       return False
-    if not app or not hasattr(app, 'id'):
+    try:
+      app_id = app.id
+    except:
       return False
     if hasattr(self,'my_app_id'):
-      if self.my_app_id == app.id:
+      if self.my_app_id == app_id:
         return True
     else:
       if app.description == str(os.getpid()):
-        self.my_app_id = app.id
+        self.my_app_id = app_id
         return True
     return False
   

Modified: trunk/src/lib/accerciser/ui_manager.py
==============================================================================
--- trunk/src/lib/accerciser/ui_manager.py	(original)
+++ trunk/src/lib/accerciser/ui_manager.py	Fri Oct 10 23:13:45 2008
@@ -12,7 +12,7 @@
 '''
 
 import gtk
-from i18n import _, N_
+from i18n import _, N_, Q_
 
 menu_actions = gtk.ActionGroup('MenuActions')
 
@@ -20,7 +20,7 @@
     ('File', None, _('_File')),
     ('Edit', None, _('_Edit')),
     ('Bookmarks', None, _('_Bookmarks')),
-    ('View', None, _('_View')),
+    ('View', None, Q_('menu|_View')),
     ('Help', None, _('_Help'))])
 
 ui_xml = '''



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