Yuya Nishihara committed ec5e4f0

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.

  • Participants
  • Parent commits 46957e6
  • Branches stable

Comments (0)

Files changed (2)

File tortoisehg/hgqt/

         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)
             return True
+        sw.syncStarted.connect(self.clearInfoBar)

File tortoisehg/hgqt/

     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)
     def inclicked(self):
+        self.syncStarted.emit()
         url = self.currentUrl(True)
         urlu = hglib.tounicode(url)
         self.showMessage.emit(_('Getting incoming changesets from %s...') % urlu)
   , ('force', 'branch', 'rev', 'subrepos'))
     def pullclicked(self):
+        self.syncStarted.emit()
         url = self.currentUrl(True)
         urlu = hglib.tounicode(url)
         def finished(ret, output):, ('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)['--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