Changeset 77

Show
Ignore:
Timestamp:
11/29/07 17:46:47
Author:
slee
Message:

doc refresh

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • action_groups/trunk/ActionBrowser.py

    r76 r77  
    3232    plugin_name = 'Actions Browser' 
    3333  else: 
     34    node = None 
    3435    __gsignals__ = {'switch-down' :  
    3536                    (gobject.SIGNAL_RUN_FIRST, 
     
    104105  def _onExamine(self, button): 
    105106    acc = self.groups_tree.get_selected_acc() 
    106     if acc is not None
     107    if acc is not None and self.node is not None
    107108      self.node.update(acc) 
    108109 
     
    283284        else: 
    284285          acc.doAction() 
     286 
    285287      if acc.isHyperlink(): 
    286288        # need to refresh - this is heavy handed 
    287289        iter = model.iter_parent_with_role(iter, pyatspi.ROLE_DOCUMENT_FRAME) 
    288         path = model.get_path(iter
    289         acc = model[model.get_iter_root()][ActionModel.COL_ACC] 
     290        acc = model.getRootAcc(
     291        path = model.get_path(iter) # assume nothing changes before 
    290292        self.set_top_acc(acc) 
    291293        selection = self.get_selection() 
     294        print 'zzz' + str(path) 
     295        model.popToPath(path) 
     296        self.expandToPath(path) 
    292297        selection.select_path(path) 
    293  
    294298           
    295299    elif acc.isSelectable(): 
    296300      acc.toggleSectable() 
    297301              
    298     if acc.is_group:  
     302    if getattr(acc, 'is_group', False) and acc.is_group: 
    299303      if self.row_expanded(path): 
    300304        if acc.getRole() == pyatspi.ROLE_MENU: 
     
    306310        self.expand_row(path, False) 
    307311        self.next() 
     312 
     313  def expandToPath(self, path): 
     314    for i in xrange(1, len(path)): 
     315      self.expand_row(path[:i], False) 
    308316 
    309317class MessageBox(): 
  • action_groups/trunk/ActionModel.py

    r76 r77  
    9494  def __init__(self, root_acc): 
    9595    gtk.TreeStore.__init__(self, str, str, object, bool, bool) 
    96     self.root = root_acc 
     96    self.root_acc = root_acc 
     97 
     98  def getRootAcc(self): 
     99    return self.root_acc 
    97100 
    98101  def addSubTree(self, acc, parent=None): 
     
    106109    t = time() 
    107110    if iter is None: 
    108       parent_acc = self.root 
     111      parent_acc = self.root_acc 
    109112    else: 
    110113      parent_acc = self[iter][self.COL_ACC] 
     
    118121    t = time() - t 
    119122    print 'Populated level in', t 
     123 
     124  def popToPath(self, path): 
     125    for i in xrange(1, len(path)): 
     126      if not self[path[:i]][self.COL_FILLED]: 
     127        self.popLevel(self.get_iter(path[:i])) 
    120128 
    121129  def makeExpandable(self, iter):