Source

thg-qt-mq / wb-noprogressdlg.diff

Full commit
# HG changeset patch
# Parent 620ad655a7b4d7837cba986f708de56329a1c025
workbench: remove unused startup progress dialog

Now startup progress is shown in statusbar.

diff --git a/tortoisehg/hgqt/workbench.py b/tortoisehg/hgqt/workbench.py
--- a/tortoisehg/hgqt/workbench.py
+++ b/tortoisehg/hgqt/workbench.py
@@ -43,9 +43,6 @@ class Workbench(QMainWindow):
 
     def __init__(self):
         QMainWindow.__init__(self)
-        self.progressDialog = QProgressDialog('TortoiseHg - Initializing Workbench', QString(), 0, 100)
-        self.progressDialog.setAutoClose(False)
-
         self.ui = ui.ui()
 
         self.setupUi()
@@ -55,7 +52,7 @@ class Workbench(QMainWindow):
         rr.showMessage.connect(self.showMessage)
         rr.openRepo.connect(self.openRepo)
         rr.removeRepo.connect(self.removeRepo)
-        rr.progressReceived.connect(self.progress)
+        rr.progressReceived.connect(self.statusbar.progress)
         rr.hide()
         self.addDockWidget(Qt.LeftDockWidgetArea, rr)
         self.activeRepoChanged.connect(rr.setActiveTabRepo)
@@ -95,8 +92,6 @@ class Workbench(QMainWindow):
         # Create the actions that will be displayed on the context menu
         self.createActions()
         self.lastClosedRepoRootList = []
-        self.progressDialog.close()
-        self.progressDialog = None
 
         self.server = None
 
@@ -790,23 +785,8 @@ class Workbench(QMainWindow):
     def showMessage(self, msg):
         self.statusbar.showMessage(msg)
 
-    @pyqtSlot(QString, object, QString, QString, object)
     def progress(self, topic, pos, item, unit, total=100, root=None):
-        if self.progressDialog:
-            if pos is None:
-                self.progressDialog.close()
-                return
-            if total is None:
-                total = 100
-            pos = round(pos)
-            total = round(total)
-            self.progressDialog.setWindowTitle('TortoiseHg - %s' % topic)
-            self.progressDialog.setLabelText('%s (%d / %d)' % (item, pos, total))
-            self.progressDialog.setMaximum(total)
-            self.progressDialog.show()
-            self.progressDialog.setValue(pos)
-        else:
-            self.statusbar.progress(topic, pos, item, unit, total, root)
+        self.statusbar.progress(topic, pos, item, unit, total, root)
 
     def setHistoryColumns(self, *args):
         """Display the column selection dialog"""