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

repowidget: implement qrefresh

if a patch is applied, the commit button now reads "QRefresh" and acts
accordingly

Changeset 920c8ed1caa8

Parent ec50bf35d75a

by Adrian Buehlmann

Changes to 2 files · Browse files at 920c8ed1caa8 Showing diff from parent ec50bf35d75a Diff from another changeset...

 
99
100
101
102
103
 
 
104
105
106
 
 
 
 
107
108
109
 
99
100
101
 
 
102
103
104
105
 
106
107
108
109
110
111
112
@@ -99,11 +99,14 @@
  QtGui.QWidget.showEvent(self, event)   self.showMessageSignal.emit(self.currentMessage)   - def commit(self): - args = ['commit'] + def commit(self, action='commit'): + args = [str(action)]   args += ['-v', '-m', self.message.text()]   dlg = cmdui.Dialog(args) - dlg.setWindowTitle(_('Commit')) + if action == 'commit': + dlg.setWindowTitle(_('Commit')) + elif action == 'qrefresh': + dlg.setWindowTitle(_('QRefresh'))   if dlg.exec_():   self.reload('tip')  
 
26
27
28
 
29
30
31
 
59
60
61
62
 
63
64
65
 
95
96
97
98
 
99
100
101
 
104
105
106
107
 
 
 
 
 
108
109
110
 
183
184
185
 
 
 
 
 
186
187
188
 
26
27
28
29
30
31
32
 
60
61
62
 
63
64
65
66
 
96
97
98
 
99
100
101
102
 
105
106
107
 
108
109
110
111
112
113
114
115
 
188
189
190
191
192
193
194
195
196
197
198
@@ -26,6 +26,7 @@
 from tortoisehg.util.util import format_desc, xml_escape, tounicode  from tortoisehg.util import hglib   +from tortoisehg.hgqt.i18n import _  from tortoisehg.hgqt.config import HgConfig    headerstyle = ''' @@ -59,7 +60,7 @@
  Display metadata for one revision (rev, author, description, etc.)   """   - commitsignal = QtCore.pyqtSignal() + commitsignal = QtCore.pyqtSignal(QtCore.QString)     def __init__(self, parent=None):   QtGui.QWidget.__init__(self, parent) @@ -95,7 +96,7 @@
  hb3 = QtGui.QHBoxLayout()   hb3.addStretch(0)   vb.addLayout(hb3) - self._commitbutton = w = QtGui.QPushButton('Commit') + self._commitbutton = w = QtGui.QPushButton()   hb3.addWidget(w, 0, Qt.AlignBottom)   connect(w, SIGNAL('clicked()'), self.commit)   @@ -104,7 +105,11 @@
  self.anchorClicked)     def commit(self): - self.commitsignal.emit() + if self.mqpatch: + action = 'qrefresh' + else: + action = 'commit' + self.commitsignal.emit(action)     def expand(self):   self.setExpanded(not self._expanded) @@ -183,6 +188,11 @@
  rev = ctx.rev()     enableci = self._expanded and not rev + if enableci: + if self.mqpatch: + self._commitbutton.setText(_('QRefresh')) + else: + self._commitbutton.setText(_('Commit'))   self._commitbutton.setVisible(enableci)   self._message.setEditable(enableci)