Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

stable repowidget: clear infobar at start of sync operation (fixes #965)

When we start new sync operation, the previous notification should be canceled.
This patch adds syncStarted signal in order to know the start of sync, which
is triggered by both repo widget (main toolbar) and sync widget.

Changeset ec5e4f01d8de

Parent 46957e6dff2d

by Yuya Nishihara

Changes to 2 files · Browse files at ec5e4f01d8de Showing diff from parent 46957e6dff2d Diff from another changeset...

 
296
297
298
 
299
300
301
302
303
304
 
 
 
305
306
307
 
363
364
365
 
366
367
368
 
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
 
367
368
369
370
371
372
373
@@ -296,12 +296,16 @@
  w.setFocus() # to handle key press by InfoBar   return w   + @pyqtSlot()   def clearInfoBar(self, priority=None):   """Close current infobar if available; return True if got empty"""   it = self._infobarlayout.itemAt(0)   if not it:   return True   if priority is None or it.widget().infobartype <= priority: + # removes current infobar explicitly, because close() seems to + # delay deletion until next eventloop. + self._infobarlayout.removeItem(it)   it.widget().close()   return True   else: @@ -363,6 +367,7 @@
  sw.output.connect(self._showOutputOnInfoBar)   sw.progress.connect(self.progress)   sw.makeLogVisible.connect(self.makeLogVisible) + sw.syncStarted.connect(self.clearInfoBar)   sw.outgoingNodes.connect(self.setOutgoingNodes)   sw.showMessage.connect(self.showMessage)   sw.showMessage.connect(self._showMessageOnInfoBar)
 
51
52
53
 
54
55
56
 
752
753
754
 
755
756
757
 
787
788
789
 
790
791
792
 
825
826
827
 
828
829
830
 
898
899
900
 
901
902
903
 
51
52
53
54
55
56
57
 
753
754
755
756
757
758
759
 
789
790
791
792
793
794
795
 
828
829
830
831
832
833
834
 
902
903
904
905
906
907
908
@@ -51,6 +51,7 @@
  return user, host, port, folder, passwd, scheme    class SyncWidget(QWidget, qtlib.TaskWidget): + syncStarted = pyqtSignal() # incoming/outgoing/pull/push started   outgoingNodes = pyqtSignal(object)   incomingBundle = pyqtSignal(QString)   showMessage = pyqtSignal(unicode) @@ -752,6 +753,7 @@
  ##     def inclicked(self): + self.syncStarted.emit()   url = self.currentUrl(True)   urlu = hglib.tounicode(url)   self.showMessage.emit(_('Getting incoming changesets from %s...') % urlu) @@ -787,6 +789,7 @@
  self.run(cmdline, ('force', 'branch', 'rev', 'subrepos'))     def pullclicked(self): + self.syncStarted.emit()   url = self.currentUrl(True)   urlu = hglib.tounicode(url)   def finished(ret, output): @@ -825,6 +828,7 @@
  self.run(cmdline, ('force', 'branch', 'rev', 'bookmark'))     def outclicked(self): + self.syncStarted.emit()   url = self.currentUrl(True)   urlu = hglib.tounicode(url)   self.showMessage.emit(_('Finding outgoing changesets to %s...') % urlu) @@ -898,6 +902,7 @@
  self.run(['--repository', self.repo.root, 'p4pending', '--verbose'], ())     def pushclicked(self, confirm, rev=None, branch=None): + self.syncStarted.emit()   url = self.currentUrl(True)   urlu = hglib.tounicode(url)   if (not hg.islocal(self.currentUrl(False)) and confirm