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

commit: begin to implement a reload() method

* emit a signal to change the commit button name (QRefresh, etc)
* status widget will not refresh itself anymore at creation
* fix quickop again
* repowidget: connect to thgimport.invalidated signal

Changeset ffba725ede94

Parent 0b4c95c5495e

by Steve Borho

Changes to 4 files · Browse files at ffba725ede94 Showing diff from parent 0b4c95c5495e Diff from another changeset...

 
36
37
38
 
39
40
41
 
129
130
131
 
 
 
 
132
133
134
 
294
295
296
297
 
 
298
299
300
 
392
393
394
395
396
397
398
399
400
401
 
582
583
584
585
586
587
588
 
597
598
599
 
600
601
602
603
 
 
 
 
604
605
606
 
619
620
621
 
 
622
623
624
 
626
627
628
629
 
630
631
632
 
36
37
38
39
40
41
42
 
130
131
132
133
134
135
136
137
138
139
 
299
300
301
 
302
303
304
305
306
 
398
399
400
 
 
 
 
401
402
403
 
584
585
586
 
587
588
589
 
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
 
625
626
627
628
629
630
631
632
 
634
635
636
 
637
638
639
640
@@ -36,6 +36,7 @@
  'A widget that encompasses a StatusWidget and commit extras'   loadBegin = pyqtSignal()   loadComplete = pyqtSignal() + commitButtonName = pyqtSignal(str)   showMessage = pyqtSignal(str)   commitComplete = pyqtSignal()   @@ -129,6 +130,10 @@
  self.msgte = msgte   self.msgcombo = msgcombo   + def reload(self): + self.stwidget.refreshWctx() + self.commitButtonName.emit(_('Commit')) +   def msgChanged(self):   text = self.msgte.toPlainText()   self.buttonHBox.setEnabled(not text.isEmpty()) @@ -294,7 +299,8 @@
  return   repo = self.stwidget.repo   repo.rollback() - self.stwidget.refreshWctx() + repo.thginvalidate() + self.reload()   QTimer.singleShot(500, lambda: shlib.shell_notify([repo.root]))     def getMessage(self): @@ -392,10 +398,6 @@
  self.userhist = self.userhist[:10]   self.refreshUserList()   - def reload(self): - # TODO - pass -   def commit(self):   repo = self.stwidget.repo   ui = repo.ui @@ -582,7 +584,6 @@
  self.connect(bb, SIGNAL("rejected()"), self, SLOT("reject()"))   bb.button(BB.Discard).setText('Undo')   bb.button(BB.Discard).clicked.connect(commit.rollback) - bb.button(BB.Ok).setText('Commit')   bbl.addWidget(bb, alignment=Qt.AlignRight)   bbl.addSpacing(9)   self.bb = bb @@ -597,10 +598,15 @@
  commit.showMessage.connect(self.showMessage)   commit.loadComplete.connect(self.updateUndo)   commit.commitComplete.connect(self.postcommit) + commit.commitButtonName.connect(self.setButtonName)     name = hglib.get_reponame(commit.stwidget.repo)   self.setWindowTitle('%s - commit' % name)   self.commit = commit + self.commit.reload() + + def setButtonName(self, name): + self.bb.button(QDialogButtonBox.Ok).setText(name)     def updateUndo(self):   BB = QDialogButtonBox @@ -619,6 +625,8 @@
  if event.key() == Qt.Key_Escape:   self.reject()   return + elif event.matches(QKeySequence.Refresh): + self.commit.reload()   return super(CommitDialog, self).keyPressEvent(event)     def postcommit(self): @@ -626,7 +634,7 @@
  if repo.ui.configbool('tortoisehg', 'closeci'):   self.reject()   return - self.commit.stwidget.refreshWctx() + self.commit.reload()     def accept(self):   self.commit.commit()
 
96
97
98
99
100
 
 
101
102
103
 
96
97
98
 
 
99
100
101
102
103
@@ -96,8 +96,8 @@
  stwidget.restoreState(s.value('quickop/state').toByteArray())   self.restoreGeometry(s.value('quickop/geom').toByteArray())   self.stwidget = stwidget - - self.stwidget.errorMessage.connect(self.statusbar.set_text) + stwidget.showMessage.connect(self.statusbar.set_text) + QTimer.singleShot(0, self.stwidget.refreshWctx)     def keyPressEvent(self, event):   if event.key() in (Qt.Key_Return, Qt.Key_Enter):
 
129
130
131
 
132
133
134
135
136
137
 
 
 
138
139
140
141
142
143
 
251
252
253
 
254
255
256
257
258
259
260
 
129
130
131
132
133
134
135
136
 
137
138
139
140
141
 
 
142
143
144
 
252
253
254
255
256
 
 
 
257
258
259
@@ -129,15 +129,16 @@
    pats = {}   opts = {} + b = QPushButton('Commit')   cw = CommitWidget(pats, opts, root=self.repo.root)   cw.showMessage.connect(self.showMessage)   cw.commitComplete.connect(self.reload)   cw.commitComplete.connect(cw.stwidget.refreshWctx) - b = QPushButton(_('Commit'))   cw.buttonHBox.addWidget(b) + cw.commitButtonName.connect(lambda n: b.setText(n)) + cw.loadConfigs(QSettings()) + cw.reload()   b.clicked.connect(cw.commit) - s = QSettings() - cw.loadConfigs(s)   self.repo._commitwidget = cw   return SharedWidget(cw)   @@ -251,10 +252,8 @@
  def thgimport(self):   l = len(self.repo)   dlg = thgimport.ImportDialog(repo=self.repo, parent=self) + dlg.repoInvalidated.connect(self.reload)   dlg.exec_() - self.repo.thginvalidate() - if len(self.repo) != l: - self.reload()     def verify(self):   cmdline = ['--repository', self.repo.root, 'verify']
 
190
191
192
193
194
195
196
 
781
782
783
 
784
785
786
 
190
191
192
 
193
194
195
 
780
781
782
783
784
785
786
@@ -190,7 +190,6 @@
  self.split = split   self.diffvbox = vbox   self.override = False - QTimer.singleShot(0, self.refreshWctx)     def teLinkClicked(self, url):   self.override = True @@ -781,6 +780,7 @@
  self.stwidget.titleTextChanged.connect(self.setWindowTitle)   self.stwidget.showMessage.connect(self.stbar.showMessage)   self.setWindowTitle(self.stwidget.getTitle()) + QTimer.singleShot(0, self.stwidget.refreshWctx)     def accept(self):   s = QSettings()