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

repomodel: read column list from QSettings()

After the log column selection dialog is run and accepted, the updateColumns()
method so be called to refresh the column list.

Changeset 6709e3401d67

Parent a807b8c1b49d

by Steve Borho

Changes to one file · Browse files at 6709e3401d67 Showing diff from parent a807b8c1b49d Diff from another changeset...

 
133
134
135
136
137
138
139
 
251
252
253
254
255
256
 
 
 
 
 
 
 
257
258
259
260
261
262
263
264
265
266
 
 
267
268
269
 
133
134
135
 
136
137
138
 
250
251
252
 
 
 
253
254
255
256
257
258
259
260
 
 
 
 
 
 
 
 
 
261
262
263
264
265
@@ -133,7 +133,6 @@
  _allcolumns = ('ID', 'Branch', 'Graph', 'Log', 'Author', 'Date', 'Tags',)   _columns = ('ID', 'Branch', 'Graph', 'Log', 'Author', 'Date', 'Tags',)   _stretchs = {'Log': 1, } - _getcolumns = "getChangelogColumns"     def __init__(self, repo, branch='', parent=None):   """ @@ -251,19 +250,16 @@
  self.fill_step = cfg.getFillingStep()   self.max_file_size = cfg.getMaxFileSize()   self.hide_mq_tags = cfg.getMQHideTags() - - cols = getattr(cfg, self._getcolumns)() - if cols is not None: + self.updateColumns() + + def updateColumns(self): + s = QSettings() + 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] - if len(validcols) != len(cols): - wrongcols = [col for col in cols if col not in self._allcolumns] - print "WARNING! %s are not valid column names. Check your configuration." % ','.join(wrongcols) - print " reverting to default columns configuration" - elif 'Log' not in validcols or 'ID' not in validcols: - print "WARNING! 'Log' and 'ID' are mandatory. Check your configuration." - print " reverting to default columns configuration" - else: - self._columns = tuple(validcols) + self._columns = tuple(validcols) + self.emit(SIGNAL("layoutChanged()"))     def maxWidthValueForColumn(self, column):   column = self._columns[column]