Commits

André Sintzoff committed a4d8540

qtlib: replace getmenuicon() by geticon() as it is no more platform specific

Comments (0)

Files changed (9)

tortoisehg/hgqt/chunks.py

             ]:
             act = QAction(desc, self)
             if icon:
-                act.setIcon(qtlib.getmenuicon(icon))
+                act.setIcon(qtlib.geticon(icon))
             if key:
                 act.setShortcut(key)
             if tip:

tortoisehg/hgqt/filectxactions.py

             ]:
             act = QAction(desc, self)
             if icon:
-                act.setIcon(qtlib.getmenuicon(icon))
+                act.setIcon(qtlib.geticon(icon))
             if key:
                 act.setShortcut(key)
             if tip:

tortoisehg/hgqt/filedialogs.py

                 a = menu.addAction(_('&Diff Selected Changesets'))
                 a.triggered.connect(self.onVisualDiffRevs)
                 a = menu.addAction(_('Diff Selected &File Revisions'))
-                a.setIcon(qtlib.getmenuicon('visualdiff'))
+                a.setIcon(qtlib.geticon('visualdiff'))
                 a.triggered.connect(self.onVisualDiffFileRevs)
             else:
                 menu = self.dualmenu
         elif self.menu is None:
             self.menu = menu = QMenu(self)
             a = menu.addAction(_('&Diff Changeset to Parent'))
-            a.setIcon(qtlib.getmenuicon('visualdiff'))
+            a.setIcon(qtlib.geticon('visualdiff'))
             a.triggered.connect(self.onVisualDiff)
             a = menu.addAction(_('Diff Changeset to &Local'))
-            a.setIcon(qtlib.getmenuicon('ldiff'))
+            a.setIcon(qtlib.geticon('ldiff'))
             a.triggered.connect(self.onVisualDiffToLocal)
             menu.addSeparator()
             a = menu.addAction(_('Diff &File to Parent'))
-            a.setIcon(qtlib.getmenuicon('visualdiff'))
+            a.setIcon(qtlib.geticon('visualdiff'))
             a.triggered.connect(self.onVisualDiffFile)
             a = menu.addAction(_('Diff File to Lo&cal'))
-            a.setIcon(qtlib.getmenuicon('ldiff'))
+            a.setIcon(qtlib.geticon('ldiff'))
             a.triggered.connect(self.onVisualDiffFileToLocal)
             menu.addSeparator()
             a = menu.addAction(_('&View at Revision'))
-            a.setIcon(qtlib.getmenuicon('view-at-revision'))
+            a.setIcon(qtlib.geticon('view-at-revision'))
             a.triggered.connect(self.onViewFileAtRevision)
             a = menu.addAction(_('&Save at Revision...'))
             a.triggered.connect(self.onSaveFileAtRevision)
             a = menu.addAction(_('&Edit Local'))
-            a.setIcon(qtlib.getmenuicon('edit-file'))
+            a.setIcon(qtlib.geticon('edit-file'))
             a.triggered.connect(self.onEditLocal)
             a = menu.addAction(_('&Revert to Revision...'))
-            a.setIcon(qtlib.getmenuicon('hg-revert'))
+            a.setIcon(qtlib.geticon('hg-revert'))
             a.triggered.connect(self.onRevertFileToRevision)
             menu.addSeparator()
             a = menu.addAction(_('Show Revision &Details'))
-            a.setIcon(qtlib.getmenuicon('hg-log'))
+            a.setIcon(qtlib.geticon('hg-log'))
             a.triggered.connect(self.onShowRevisionDetails)
         else:
             menu = self.menu
         if self.menu is None:
             self.menu = menu = QMenu(self)
             a = menu.addAction(_('&Diff to Parent'))
-            a.setIcon(qtlib.getmenuicon('visualdiff'))
+            a.setIcon(qtlib.geticon('visualdiff'))
             a.triggered.connect(self.onVisualDiff)
             a = menu.addAction(_('Diff to &Local'))
-            a.setIcon(qtlib.getmenuicon('ldiff'))
+            a.setIcon(qtlib.geticon('ldiff'))
             a.triggered.connect(self.onVisualDiffToLocal)
             menu.addSeparator()
             a = menu.addAction(_('Diff &File to Parent'))
-            a.setIcon(qtlib.getmenuicon('visualdiff'))
+            a.setIcon(qtlib.geticon('visualdiff'))
             a.triggered.connect(self.onVisualDiffFile)
             a = menu.addAction(_('Diff File to Lo&cal'))
-            a.setIcon(qtlib.getmenuicon('ldiff'))
+            a.setIcon(qtlib.geticon('ldiff'))
             a.triggered.connect(self.onVisualDiffFileToLocal)
             menu.addSeparator()
             a = menu.addAction(_('&View at Revision'))
-            a.setIcon(qtlib.getmenuicon('view-at-revision'))
+            a.setIcon(qtlib.geticon('view-at-revision'))
             a.triggered.connect(self.onViewFileAtRevision)
             a = menu.addAction(_('&Save at Revision...'))
             a.triggered.connect(self.onSaveFileAtRevision)
             a = menu.addAction(_('&Edit Local'))
-            a.setIcon(qtlib.getmenuicon('edit-file'))
+            a.setIcon(qtlib.geticon('edit-file'))
             a.triggered.connect(self.onEditLocal)
             a = menu.addAction(_('&Revert to Revision...'))
-            a.setIcon(qtlib.getmenuicon('hg-revert'))
+            a.setIcon(qtlib.geticon('hg-revert'))
             a.triggered.connect(self.onRevertFileToRevision)
         self.selection = selection
         self.menu.exec_(point)

tortoisehg/hgqt/qtlib.py

                             or QIcon(':/icons/fallback.svg'))
         return _iconcache[name]
 
-getmenuicon = geticon
-
 
 def getoverlaidicon(base, overlay):
     """Generate an overlaid icon"""

tortoisehg/hgqt/reporegistry.py

         for name, desc, icon, tip, cb in self._action_defs():
             act = self._actions[name]
             if icon:
-                act.setIcon(qtlib.getmenuicon(icon))
+                act.setIcon(qtlib.geticon(icon))
             if tip:
                 act.setStatusTip(tip)
             if cb:

tortoisehg/hgqt/repowidget.py

             if cb:
                 act.triggered.connect(cb)
             if icon:
-                act.setIcon(qtlib.getmenuicon(icon))
+                act.setIcon(qtlib.geticon(icon))
             act.enableFunc = func
             menu.addAction(act)
             items.append(act)
                 continue
             a = QAction(name, self)
             if icon:
-                a.setIcon(qtlib.getmenuicon(icon))
+                a.setIcon(qtlib.geticon(icon))
             a.triggered.connect(cb)
             menu.addAction(a)
 
             act = QAction(name, self)
             act.triggered.connect(cb)
             if icon:
-                act.setIcon(qtlib.getmenuicon(icon))
+                act.setIcon(qtlib.geticon(icon))
             acts.append(act)
             menu.addAction(act)
         self.unappcmenu = menu
                 continue
             a = QAction(name, self)
             if icon:
-                a.setIcon(qtlib.getmenuicon(icon))
+                a.setIcon(qtlib.geticon(icon))
             a.triggered.connect(cb)
             menu.addAction(a)
 
             a = QAction(name, self)
             a.triggered.connect(cb)
             if icon:
-                a.setIcon(qtlib.getmenuicon(icon))
+                a.setIcon(qtlib.geticon(icon))
             menu.addAction(a)
         self.bundlemenu = menu
     def generateOutgoingMenu(self):

tortoisehg/hgqt/sync.py

                     continue
                 act = QAction(text, self)
                 if icon:
-                    act.setIcon(qtlib.getmenuicon(icon))
+                    act.setIcon(qtlib.geticon(icon))
                 act.triggered.connect(cb)
                 acts.append(act)
                 menu.addAction(act)

tortoisehg/hgqt/wctxactions.py

             action._filetypes = types
             action._runfunc = func
             if icon:
-                action.setIcon(qtlib.getmenuicon(icon))
+                action.setIcon(qtlib.geticon(icon))
             if keys:
                 action.setShortcut(QKeySequence(keys))
             action.triggered.connect(self.runAction)
             action._filetypes = types
             action._runfunc = func
             if icon:
-                action.setIcon(qtlib.getmenuicon(icon))
+                action.setIcon(qtlib.geticon(icon))
             if func is not None:
                 action.triggered.connect(self.runAction)
             return action

tortoisehg/hgqt/workbench.py

             else:
                 action.triggered.connect(slot)
         if icon:
-            if toolbar:
-                action.setIcon(qtlib.geticon(icon))
-            else:
-                action.setIcon(qtlib.getmenuicon(icon))
+            action.setIcon(qtlib.geticon(icon))
         if shortcut:
             keyseq = qtlib.keysequence(shortcut)
             if isinstance(keyseq, QKeySequence.StandardKey):
         for name, desc, icon, tip, cb in self._action_defs():
             act = self._actions[name]
             if icon:
-                act.setIcon(qtlib.getmenuicon(icon))
+                act.setIcon(qtlib.geticon(icon))
             if tip:
                 act.setStatusTip(tip)
             if cb: