Source

thg-qt-mq / status-icon-sfx.diff

# HG changeset patch
# Parent 1050dfbe658762f922ca6fd92abd787b2fd58aae
status: remove '.ico' from statusTypes for compatibility with geticon()


diff --git a/tortoisehg/hgqt/manifestdialog.py b/tortoisehg/hgqt/manifestdialog.py
--- a/tortoisehg/hgqt/manifestdialog.py
+++ b/tortoisehg/hgqt/manifestdialog.py
@@ -280,7 +280,7 @@ class _StatusFilterButton(QToolButton):
             st = status.statusTypes[c]
             a = menu.addAction('%s %s' % (c, st.name))
             if st.icon:
-                a.setIcon(qtlib.geticon(st.icon.rstrip('.ico')))  # XXX
+                a.setIcon(qtlib.geticon(st.icon))
             a.setCheckable(True)
             a.setChecked(c in text)
             a.toggled.connect(self._update)
diff --git a/tortoisehg/hgqt/manifestmodel.py b/tortoisehg/hgqt/manifestmodel.py
--- a/tortoisehg/hgqt/manifestmodel.py
+++ b/tortoisehg/hgqt/manifestmodel.py
@@ -59,7 +59,7 @@ class ManifestModel(QAbstractItemModel):
             return ic
         st = status.statusTypes[e.status]
         if st.icon:
-            ic = _overlaidicon(ic, qtlib.geticon(st.icon.rstrip('.ico')))  # XXX
+            ic = _overlaidicon(ic, qtlib.geticon(st.icon))
         return ic
 
     def flags(self, index):
diff --git a/tortoisehg/hgqt/status.py b/tortoisehg/hgqt/status.py
--- a/tortoisehg/hgqt/status.py
+++ b/tortoisehg/hgqt/status.py
@@ -640,9 +640,7 @@ class WctxModel(QAbstractTableModel):
         '''
         elif role == Qt.DecorationRole and index.column() == COL_STATUS:
             if status in statusTypes:
-                ico = QIcon()
-                ico.addPixmap(QPixmap('icons/' + statusTypes[status].icon))
-                return QVariant(ico)
+                return qtlib.geticon(statusTypes[status].icon)
         '''
         return QVariant()
 
@@ -735,21 +733,21 @@ class StatusType(object):
         self.uilabel = uilabel
 
 statusTypes = {
-    'M' : StatusType('modified', 'menucommit.ico', _('%s is modified'),
+    'M' : StatusType('modified', 'menucommit', _('%s is modified'),
                      'status.modified'),
-    'A' : StatusType('added', 'fileadd.ico', _('%s is added'),
+    'A' : StatusType('added', 'fileadd', _('%s is added'),
                      'status.added'),
-    'R' : StatusType('removed', 'filedelete.ico', _('%s is removed'),
+    'R' : StatusType('removed', 'filedelete', _('%s is removed'),
                      'status.removed'),
-    '?' : StatusType('unknown', 'shelve.ico', _('%s is not tracked (unknown)'),
+    '?' : StatusType('unknown', 'shelve', _('%s is not tracked (unknown)'),
                      'status.unknown'),
-    '!' : StatusType('deleted', 'menudelete.ico', _('%s is missing!'),
+    '!' : StatusType('deleted', 'menudelete', _('%s is missing!'),
                      'status.deleted'),
-    'I' : StatusType('ignored', 'ignore.ico', _('%s is ignored'),
+    'I' : StatusType('ignored', 'ignore', _('%s is ignored'),
                      'status.ignored'),
     'C' : StatusType('clean', '', _('%s is not modified (clean)'),
                      'status.clean'),
-    'S' : StatusType('subrepo', 'hg.ico', _('%s is a dirty subrepo'),
+    'S' : StatusType('subrepo', 'hg', _('%s is a dirty subrepo'),
                      'status.subrepo'),
 }