Changeset 06d45c36a5da…
Parent de756a7ca8d8…
by
Changes to 2 files · Browse files at 06d45c36a5da Showing diff from parent de756a7ca8d8 Diff from another changeset...
@@ -41,7 +41,8 @@ list = QListWidget()
# enabled cols are listed in sorted order
for c in self.curcolumns:
- item = QListWidgetItem(c)
+ item = QListWidgetItem(repomodel.COLUMNNAMES[c])
+ item.columnid = c
item.setFlags(Qt.ItemIsSelectable |
Qt.ItemIsEnabled |
Qt.ItemIsDragEnabled |
@@ -50,7 +51,8 @@ list.addItem(item)
# disabled cols are listed last
for c in self.disabled:
- item = QListWidgetItem(c)
+ item = QListWidgetItem(repomodel.COLUMNNAMES[c])
+ item.columnid = c
item.setFlags(Qt.ItemIsSelectable |
Qt.ItemIsEnabled |
Qt.ItemIsDragEnabled |
@@ -78,7 +80,7 @@ for i in xrange(self.list.count()):
item = self.list.item(i)
if item.checkState() == Qt.Checked:
- cols.append(str(item.text()))
+ cols.append(item.columnid)
s.setValue('workbench/columns', cols)
QDialog.accept(self)
|
@@ -35,8 +35,23 @@ "darkcyan", "gray", "yellow", ]
COLORS = [str(QColor(x).name()) for x in COLORS]
-ALLCOLUMNS = ('Graph', 'Rev', 'Branch', 'Description', 'Author', 'Tags', 'Node',
- 'Age', 'LocalTime', 'UTCTime', 'Changes')
+COLUMNHEADERS = (
+ ('Graph', _('Graph', 'column header')),
+ ('Rev', _('Rev', 'column header')),
+ ('Branch', _('Branch', 'column header')),
+ ('Description', _('Description', 'column header')),
+ ('Author', _('Author', 'column header')),
+ ('Tags', _('Tags', 'column header')),
+ ('Node', _('Node', 'column header')),
+ ('Age', _('Age', 'column header')),
+ ('LocalTime', _('Local Time', 'column header')),
+ ('UTCTime', _('UTC Time', 'column header')),
+ ('Changes', _('Changes', 'column header')),
+ )
+
+COLUMNNAMES = dict(COLUMNHEADERS)
+
+ALLCOLUMNS = [h[0] for h in COLUMNHEADERS]
UNAPPLIED_PATCH_COLOR = '#999999'
@@ -459,7 +474,7 @@ def headerData(self, section, orientation, role):
if orientation == Qt.Horizontal:
if role == Qt.DisplayRole:
- return QVariant(self._columns[section])
+ return QVariant(COLUMNNAMES[self._columns[section]])
if role == Qt.TextAlignmentRole:
return QVariant(Qt.AlignLeft)
return nullvariant
|
Loading...