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

status: add filename/status label above diff text

Introduces an hbox we will be able to add buttons to later

Changeset c0ae1e4496bd

Parent b2b8839f20c0

by Steve Borho

Changes to one file · Browse files at c0ae1e4496bd Showing diff from parent b2b8839f20c0 Diff from another changeset...

 
134
135
136
137
 
 
 
 
 
 
 
 
 
 
 
138
139
140
 
 
141
142
143
 
202
203
204
 
205
206
207
208
209
210
 
 
211
212
213
214
 
 
215
216
217
 
399
400
401
402
403
404
405
406
407
408
 
409
410
411
 
468
469
470
 
 
 
 
 
 
 
 
 
471
472
473
 
134
135
136
 
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
 
214
215
216
217
218
219
220
221
 
 
222
223
224
225
 
 
226
227
228
229
230
 
412
413
414
 
 
 
 
 
 
 
415
416
417
418
 
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
@@ -134,10 +134,22 @@
  self.tv = tv   self.le = le   - self.te = QTextEdit(split) + # Diff panel side of splitter + vbox = QVBoxLayout() + vbox.setMargin(0) + docf = QFrame(split) + docf.setLayout(vbox) + hbox = QHBoxLayout() + hbox.setContentsMargins (5, 7, 0, 0) + self.fnamelabel = QLabel('<insert filename here>') + hbox.addWidget(self.fnamelabel) + + self.te = QTextEdit()   self.te.document().setDefaultStyleSheet(qtlib.thgstylesheet)   self.te.setReadOnly(True)   self.te.setLineWrapMode(QTextEdit.NoWrap) + vbox.addLayout(hbox) + vbox.addWidget(self.te)     if not parent:   self.setWindowTitle(_('TortoiseHg Status')) @@ -202,16 +214,17 @@
  'Connected to treeview "clicked" signal'   path, status, mst, upath = index.model().getRow(index)   wfile = util.pconvert(path) + self.fnamelabel.setText(statusMessage(status, mst, upath))     if status in '?IC':   # TODO: Display file contents if a button clicked,   # add to a toolbar above the diff panel - text = '<b>File is not tracked</b>' - self.te.setHtml(text) + diff = _('<em>No displayable differences</em>') + self.te.setHtml(diff)   return   elif status in '!': - text = '<b>File is missing!</b>' - self.te.setHtml(text) + diff = _('<em>No displayable differences</em>') + self.te.setHtml(diff)   return     warnings = chunkselect.check_max_diff(self.wctx, wfile) @@ -399,13 +412,7 @@
  else:   return _colors.get(status, QColor('black'))   elif role == Qt.ToolTipRole: - if status in statusTypes: - tip = statusTypes[status].desc % upath - if mst == 'R': - tip += _(', resolved merge') - elif mst == 'U': - tip += _(', unresolved merge') - return QVariant(tip) + return QVariant(statusMessage(status, mst, upath))   return QVariant()     def headerData(self, col, orientation, role): @@ -468,6 +475,15 @@
  def getChecked(self):   return self.checked.copy()   +def statusMessage(status, mst, upath): + tip = '' + if status in statusTypes: + tip = statusTypes[status].desc % upath + if mst == 'R': + tip += _(', resolved merge') + elif mst == 'U': + tip += _(', unresolved merge') + return tip    class StatusType(object):   preferredOrder = 'MAR?!ICS'