Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0.3, 2.0.4, and 2.0.5

stable repomodel, i18n: translate column headers

Changeset 06d45c36a5da

Parent de756a7ca8d8

by Wagner Bruna

Changes to 2 files · Browse files at 06d45c36a5da Showing diff from parent de756a7ca8d8 Diff from another changeset...

 
41
42
43
44
 
 
45
46
47
 
50
51
52
53
 
 
54
55
56
 
78
79
80
81
 
82
83
84
 
41
42
43
 
44
45
46
47
48
 
51
52
53
 
54
55
56
57
58
 
80
81
82
 
83
84
85
86
@@ -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
36
37
38
39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
41
42
 
459
460
461
462
 
463
464
465
 
35
36
37
 
 
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
 
474
475
476
 
477
478
479
480
@@ -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