1. Yuya Nishihara
  2. thg-work

Commits

Yuya Nishihara  committed f52f9f2 Obsolete Draft

filectxactions: add accessor to look up QAction instance by name

It will be used by revdetails and filedialogs to build its own menu.

  • Participants
  • Parent commits a8a4567
  • Successor commits dac4d02
  • Branches default

Comments (0)

Files changed (1)

File tortoisehg/hgqt/filectxactions.py

View file
         """List of the actions; The owner widget should register them"""
         return self._actions.values()
 
+    def action(self, name):
+        return self._actions[name]
+
     def createMenu(self, parent=None):
         """New menu for the current selection if available; otherwise None"""
         if self._curfd.isNull():
         contextmenu = QMenu(parent)
         for act in _actionsbytype[key]:
             if act:
-                contextmenu.addAction(self._actions[act])
+                contextmenu.addAction(self.action(act))
             else:
                 contextmenu.addSeparator()
         return contextmenu