Changeset 124

Show
Ignore:
Timestamp:
01/17/08 14:58:23
Author:
slee
Message:

GAIL fixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • inapp/trunk/ChangeLog

    r122 r124  
    1 2008-01-16  r122 SteveLee  <steve@fullmeasure.co.uk> 
     12008-01-16  r122-3 SteveLee  <steve@fullmeasure.co.uk> 
    22 
     3        * gail fixes 
    34  * improved highlight 
    45 
  • inapp/trunk/src/jambu/AccDecorator.py

    r113 r124  
    3838    return getattr(self._acc, attrib) 
    3939 
     40  def __eq__(self, other): 
     41    #do default comparison 
     42    if other is None: 
     43      return False 
     44    assert isinstance(other, self.__class__) 
     45    return self._acc == other._acc 
     46 
     47  def __ne__(self, other): 
     48    return not self.__eq__(other) 
     49   
    4050  # now the 'real' functions 
    4151  def hasStates(self, *states): 
  • inapp/trunk/src/jambu/ActionTree.py

    r116 r124  
    8282 
    8383  def get_acc_from_iter(self, iter): 
     84    if iter is None: 
     85      return None 
    8486    return self.get_acc_from_path(self.get_model().get_path(iter)) 
    8587                            
     
    179181 
    180182    if event.type == 'focus:' and \ 
    181         not (AccDecorator(source_acc.parent).hasRoleIn(pyatspi.ROLE_MENU, pyatspi.ROLE_MENU_ITEM)): 
     183       not (AccDecorator(source_acc.parent).hasRoleIn(pyatspi.ROLE_MENU, pyatspi.ROLE_MENU_ITEM)) \ 
     184       and source_acc != self.get_selected_acc(): 
    182185#        not (source_acc.hasRoleIn(pyatspi.ROLE_MENU, pyatspi.ROLE_MENU_ITEM, 
    183186#                                    pyatspi.ROLE_RADIO_MENU_ITEM, pyatspi.ROLE_CHECK_MENU_ITEM)): 
     
    196199      except LookupError: 
    197200        root = None 
     201      if top is None or top <> root: 
    198202      # for some reason they are not always the same accessible  
    199203      # even though we expect them to be compared by hash 
    200204      # perhaps state changes as default hash is probably on memory image 
    201       if top is not None and \ 
    202          (root is None or not(top.getRole() == root.getRole() and top.name == root.name)): 
     205#      if top is not None and \ 
     206#         (root is None or not(top.getRole() == root.getRole() and top.name == root.name)): 
    203207        WindowActivateMessage(top).send() 
    204208         
     
    351355      print 'gk: click' 
    352356      self.generateClick(acc) 
    353      
     357 
    354358    elif acc.isSelectable(): 
    355359      # moz location auto compelete - no parent 
    356360      print 'sel' 
     361      is_gecko = acc.hasToolkitIn('Gecko') 
    357362      if acc.hasRoleIn(pyatspi.ROLE_MENU_ITEM): 
    358363        if not self.row_expanded(path): 
     
    360365        elif self.row_expanded(path): 
    361366          print '!!! Escape' 
    362           sendKeyCombination('Escape', '')          
    363       elif acc.hasRoleIn(pyatspi.ROLE_MENU) or acc.is_interactive: 
     367          sendKeyCombination('Escape', '') 
     368        elif is_gecko and \ 
     369             acc.hasRoleIn(pyatspi.ROLE_MENU) or acc.is_interactive: 
    364370          acc.doAction() 
    365       elif acc.hasRoleIn(pyatspi.ROLE_CHECK_MENU_ITEM, pyatspi.ROLE_RADIO_MENU_ITEM): 
     371        elif is_gecko and \ 
     372             acc.hasRoleIn(pyatspi.ROLE_CHECK_MENU_ITEM, pyatspi.ROLE_RADIO_MENU_ITEM): 
    366373          acc.toggleSectable() 
    367374          acc.doAction() 
    368       elif acc.hasRoleIn(pyatspi.ROLE_PAGE_TAB): 
    369         acc.toggleSectable() 
    370         self._do_actionGroup(iter) # race condition? 
     375        elif is_gecko and \ 
     376             acc.hasRoleIn(pyatspi.ROLE_PAGE_TAB): 
     377          acc.toggleSectable() 
     378          self._do_actionGroup(iter) # race condition? 
    371379      else: 
    372380        acc.toggleSectable()