Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

workbench: add menu item for column selection

Changeset feb6fa028eb2

Parent e6c7741beb1c

by David Wilhelm

Changes to 3 files · Browse files at feb6fa028eb2 Showing diff from parent e6c7741beb1c Diff from another changeset...

 
10
11
12
 
13
14
15
 
77
78
79
80
81
 
 
10
11
12
13
14
15
16
 
78
79
80
 
 
81
@@ -10,6 +10,7 @@
 from tortoisehg.hgqt import qtlib  from tortoisehg.util import hglib  from tortoisehg.hgqt.i18n import _ +from tortoisehg.hgqt import repomodel    from PyQt4.QtCore import *  from PyQt4.QtGui import * @@ -77,5 +78,4 @@
  QDialog.reject(self)    def run(ui, *pats, **opts): - _allcolumns = ('ID', 'Branch', 'Graph', 'Log', 'Author', 'Date', 'Tags',) - return ColumnSelectDialog(_allcolumns) + return ColumnSelectDialog(repomodel.ALLCOLUMNS)
 
36
37
38
 
39
40
41
 
122
123
124
125
126
127
128
 
186
187
188
189
 
190
191
192
 
36
37
38
39
40
41
42
 
123
124
125
 
126
127
128
 
186
187
188
 
189
190
191
192
@@ -36,6 +36,7 @@
  "darkcyan", "gray", "yellow", ]  COLORS = [str(QColor(x).name()) for x in COLORS]  #COLORS = [str(color) for color in QColor.colorNames()] +ALLCOLUMNS = ('ID', 'Branch', 'Graph', 'Log', 'Author', 'Date', 'Tags',)    def get_color(n, ignore=()):   """ @@ -122,7 +123,6 @@
  """   Model used for displaying the revisions of a Hg *local* repository   """ - _allcolumns = ('ID', 'Branch', 'Graph', 'Log', 'Author', 'Date', 'Tags',)   _columns = ('ID', 'Branch', 'Graph', 'Log', 'Author', 'Date', 'Tags',)   _stretchs = {'Log': 1, }   @@ -186,7 +186,7 @@
  cols = s.value('workbench/columns').toStringList()   cols = [str(col) for col in cols]   if cols: - validcols = [col for col in cols if col in self._allcolumns] + validcols = [col for col in cols if col in ALLCOLUMNS]   self._columns = tuple(validcols)   self.emit(SIGNAL("layoutChanged()"))  
 
17
18
19
 
20
21
22
 
24
25
26
 
27
28
29
 
197
198
199
 
 
200
201
202
 
217
218
219
 
220
221
222
 
416
417
418
 
419
420
421
 
496
497
498
 
 
 
 
 
 
 
 
499
500
501
 
17
18
19
20
21
22
23
 
25
26
27
28
29
30
31
 
199
200
201
202
203
204
205
206
 
221
222
223
224
225
226
227
 
421
422
423
424
425
426
427
 
502
503
504
505
506
507
508
509
510
511
512
513
514
515
@@ -17,6 +17,7 @@
 from mercurial.error import RepoError    from tortoisehg.util.hglib import tounicode +from tortoisehg.hgqt import repomodel  from tortoisehg.hgqt.i18n import _  from tortoisehg.hgqt.decorators import timeit  from tortoisehg.hgqt.qtlib import geticon, getfont @@ -24,6 +25,7 @@
 from tortoisehg.hgqt.repowidget import RepoWidget  from tortoisehg.hgqt.commit import CommitWidget  from tortoisehg.hgqt.reporegistry import RepoRegistryView +from tortoisehg.hgqt.logcolumns import ColumnSelectDialog    from tortoisehg.util import paths   @@ -197,6 +199,8 @@
  self.actionShowPaths = a = QAction(_("Show Paths"), self)   a.setCheckable(True)   + self.actionSelectColumns = QAction(_("Choose Log Columns..."), self) +   a = QAction(_("Show Repository Registry"), self)   a.setCheckable(True)   self.actionShowRepoRegistry = a @@ -217,6 +221,7 @@
  self.menuView = m = QMenu(_("View"), self.menubar)   m.addAction(self.actionShowRepoRegistry)   m.addAction(self.actionShowPaths) + m.addAction(self.actionSelectColumns)     self.menubar.addAction(self.menuFile.menuAction())   self.menubar.addAction(self.menuView.menuAction()) @@ -416,6 +421,7 @@
  self.actionQuit.triggered.connect(self.close)   self.actionBack.triggered.connect(self.back)   self.actionForward.triggered.connect(self.forward) + self.actionSelectColumns.triggered.connect(self.setHistoryColumns)   self.actionShowPaths.toggled.connect(self.actionShowPathsToggled)   self.actionShowRepoRegistry.toggled.connect(self.showRepoRegistry)   @@ -496,6 +502,14 @@
  def actionShowPathsToggled(self, show):   self.reporegistry.showPaths(show)   + def setHistoryColumns(self, *args): + """Display the column selection dialog""" + dlg = ColumnSelectDialog(repomodel.ALLCOLUMNS) + dlg.exec_() + self.reload() + w = self.repoTabsWidget.currentWidget() + w.repoview.resizeColumns() +   def back(self):   w = self.repoTabsWidget.currentWidget()   if w: