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

stable repowidget, repoview: implemented storing of col widths and reimplemented col elasticity

- The column widths of the repoview are saved to settings on exit and graph rebuild
- The description column is now resized when the workbench is resized
- A redundant function was removed

Changeset 469eb69b2546

Parent 9d149b6dd5fa

by Michael De Wildt

Changes to 3 files · Browse files at 469eb69b2546 Showing diff from parent 9d149b6dd5fa Diff from another changeset...

 
140
141
142
143
 
144
145
146
 
277
278
279
280
281
 
 
 
 
282
283
284
 
140
141
142
 
143
144
145
146
 
277
278
279
 
 
280
281
282
283
284
285
286
@@ -140,7 +140,7 @@
    self.splitter = QSplitter(Qt.Vertical)   self.setCentralWidget(self.splitter) - self.repoview = HgRepoView(self.repo, self.splitter) + self.repoview = HgRepoView(self.repo, 'fileLogDialog', self.splitter)   self.contentframe = QFrame(self.splitter)     vbox = QVBoxLayout() @@ -277,8 +277,10 @@
  self.splitter = QSplitter(Qt.Vertical)   self.setCentralWidget(self.splitter)   self.horizontalLayout = QHBoxLayout() - self.tableView_revisions_left = HgRepoView(self.repo, self) - self.tableView_revisions_right = HgRepoView(self.repo, self) + self.tableView_revisions_left = HgRepoView(self.repo, + 'fileDiffDialogLeft', self) + self.tableView_revisions_right = HgRepoView(self.repo, + 'fileDiffDialogRight', self)   self.horizontalLayout.addWidget(self.tableView_revisions_left)   self.horizontalLayout.addWidget(self.tableView_revisions_right)   self.frame = QFrame()
 
32
33
34
35
 
36
37
38
39
 
40
41
42
 
121
122
123
124
 
125
126
127
 
241
242
243
244
 
245
246
 
247
248
249
250
251
252
 
 
 
253
254
255
 
32
33
34
 
35
36
37
38
39
40
41
42
43
 
122
123
124
 
125
126
127
128
 
242
243
244
 
245
246
 
247
248
249
250
251
 
 
252
253
254
255
256
257
@@ -32,11 +32,12 @@
  menuRequested = pyqtSignal(QPoint, object)   showMessage = pyqtSignal(unicode)   - def __init__(self, repo, parent=None): + def __init__(self, repo, cfgname, parent=None):   QTableView.__init__(self, parent)   self.repo = repo   self.current_rev = -1   self.resized = False + self.cfgname = cfgname   self.setShowGrid(False)     vh = self.verticalHeader() @@ -121,7 +122,7 @@
  fontm = QFontMetrics(self.font())   widths = [-1 for _i in xrange(model.columnCount(QModelIndex()))]   - key = 'repoview/column_widths/%s' % str(self.repo[0]) + key = '%s/column_widths/%s' % (self.cfgname, str(self.repo[0]))   col_widths = [int(w) for w in QSettings().value(key).toStringList()]     for c in range(model.columnCount(QModelIndex())): @@ -241,15 +242,16 @@
  for c in range(self.model().columnCount(QModelIndex())):   col_widths.append(self.columnWidth(c))   - key = 'repoview/column_widths/%s' % str(self.repo[0]) + key = '%s/column_widths/%s' % (self.cfgname, str(self.repo[0]))   s.setValue(key, col_widths) - s.setValue('repoview/widget_width', self.viewport().width()) + s.setValue('%s/widget_width' % self.cfgname, self.viewport().width())     def resizeEvent(self, e):   # re-size columns the smart way: the column holding Description   # is re-sized according to the total widget size. - widget_width = QSettings().value('repoview/widget_width').toInt()[0] - if self.resized and widget_width: + key = '%s/widget_width' % self.cfgname + widget_width, ok = QSettings().value(key).toInt() + if self.resized and ok and widget_width:   model = self.model()   vp_width = self.viewport().width()   total_width = stretch_col = 0
 
123
124
125
126
 
127
128
129
 
123
124
125
 
126
127
128
129
@@ -123,7 +123,7 @@
    self.layout().addWidget(self.repotabs_splitter)   - self.repoview = view = HgRepoView(self.repo, self) + self.repoview = view = HgRepoView(self.repo, 'repoWidget', self)   view.revisionClicked.connect(self.onRevisionClicked)   view.revisionSelected.connect(self.onRevisionSelected)   view.revisionAltClicked.connect(self.onRevisionSelected)