Commits

David Golub  committed aed4b26

cmdui, sync, commit: hide prompt while operation is in progress

  • Participants
  • Parent commits e1aa63b
  • Branches stable

Comments (0)

Files changed (6)

File tortoisehg/hgqt/cmdui.py

         self.setFocusProxy(self._logwidget)
         self.setRepository(None)
         self.openPrompt()
+        self.suppressPrompt = False
 
     def _initlogwidget(self):
         self._logwidget = _LogWidgetForConsole(self)
         try:
             self._logwidget.appendLog(msg, label)
         finally:
-            self.openPrompt()
+            if not self.suppressPrompt:
+                self.openPrompt()
 
     @pyqtSlot(object)
     def setRepository(self, repo):
 
     @_cmdtable
     def _cmd_hg(self, args):
+        self.suppressPrompt = True
+        self.closePrompt()
         if self._repo:
             args = ['--cwd', self._repo.root] + args
-        self._cmdcore.run(args)
+        try:
+            self._cmdcore.run(args)
+        finally:
+            self.suppressPrompt = False
+            self.openPrompt()
 
     @_cmdtable
     def _cmd_thg(self, args):

File tortoisehg/hgqt/commit.py

     progress = pyqtSignal(QString, object, QString, QString, object)
     output = pyqtSignal(QString, QString)
     makeLogVisible = pyqtSignal(bool)
+    beginSuppressPrompt = pyqtSignal()
+    endSuppressPrompt = pyqtSignal()
 
     def __init__(self, repo, pats, opts, embedded=False, parent=None, rev=None):
         QWidget.__init__(self, parent=parent)
         self.runner.output.connect(self.output)
         self.runner.progress.connect(self.progress)
         self.runner.makeLogVisible.connect(self.makeLogVisible)
+        self.runner.commandStarted.connect(self.beginSuppressPrompt)
+        self.runner.commandFinished.connect(self.endSuppressPrompt)
         self.runner.commandFinished.connect(self.commandFinished)
 
         layout = QVBoxLayout()

File tortoisehg/hgqt/docklog.py

     def output(self, msg, label):
         self.logte.appendLog(msg, label)
 
+    @pyqtSlot()
+    def beginSuppressPrompt(self):
+        self.logte.suppressPrompt = True
+
+    @pyqtSlot()
+    def endSuppressPrompt(self):
+        self.logte.suppressPrompt = False
+        self.logte.openPrompt()
+
     def showEvent(self, event):
         self.visibilityChanged.emit(True)
 

File tortoisehg/hgqt/repowidget.py

     output = pyqtSignal(QString, QString)
     progress = pyqtSignal(QString, object, QString, QString, object)
     makeLogVisible = pyqtSignal(bool)
+    beginSuppressPrompt = pyqtSignal()
+    endSuppressPrompt = pyqtSignal()
 
     repoChanged = pyqtSignal(QString)
 
         cw.output.connect(self.output)
         cw.progress.connect(self.progress)
         cw.makeLogVisible.connect(self.makeLogVisible)
+        cw.beginSuppressPrompt.connect(self.beginSuppressPrompt)
+        cw.endSuppressPrompt.connect(self.endSuppressPrompt)
         cw.linkActivated.connect(self._openLink)
         cw.showMessage.connect(self.showMessage)
         QTimer.singleShot(0, cw.reload)
         sw.output.connect(self._showOutputOnInfoBar)
         sw.progress.connect(self.progress)
         sw.makeLogVisible.connect(self.makeLogVisible)
+        sw.beginSuppressPrompt.connect(self.beginSuppressPrompt)
+        sw.endSuppressPrompt.connect(self.endSuppressPrompt)
         sw.syncStarted.connect(self.clearInfoBar)
         sw.outgoingNodes.connect(self.setOutgoingNodes)
         sw.showMessage.connect(self.showMessage)

File tortoisehg/hgqt/sync.py

     output = pyqtSignal(QString, QString)
     progress = pyqtSignal(QString, object, QString, QString, object)
     makeLogVisible = pyqtSignal(bool)
+    beginSuppressPrompt = pyqtSignal()
+    endSuppressPrompt = pyqtSignal()
     showBusyIcon = pyqtSignal(QString)
     hideBusyIcon = pyqtSignal(QString)
 
         self.optionsbutton.pressed.connect(self.editOptions)
 
         cmd = cmdui.Widget(not self.embedded, True, self)
+        cmd.commandStarted.connect(self.beginSuppressPrompt)
         cmd.commandStarted.connect(self.commandStarted)
+        cmd.commandFinished.connect(self.endSuppressPrompt)
         cmd.commandFinished.connect(self.commandFinished)
         cmd.makeLogVisible.connect(self.makeLogVisible)
         cmd.output.connect(self.output)

File tortoisehg/hgqt/workbench.py

             self.statusbar.progress(tp, p, i, u, tl, repo.root))
         rw.output.connect(self.log.output)
         rw.makeLogVisible.connect(self.log.setShown)
+        rw.beginSuppressPrompt.connect(self.log.beginSuppressPrompt)
+        rw.endSuppressPrompt.connect(self.log.endSuppressPrompt)
         rw.revisionSelected.connect(self.updateHistoryActions)
         rw.repoLinkClicked.connect(self.openLinkedRepo)
         rw.taskTabsWidget.currentChanged.connect(self.updateTaskViewMenu)