Commits

Yuya Nishihara committed 23c011e

cmdui: remove Runner which is no longer used

All cmdui.Runner objects are replaced by repoagent.runCommand API.

Comments (0)

Files changed (1)

tortoisehg/hgqt/cmdui.py

         if self._session.isFinished():
             self._closeBtn.setFocus()
 
-class Runner(QObject):
-    """A component for running Mercurial command without UI
-
-    This command runner doesn't show any UI element unless it gets a warning
-    or an error while the command is running.  Once an error or a warning is
-    received, it pops-up a small dialog which contains the command log.
-    """
-
-    commandStarted = pyqtSignal()
-    commandFinished = pyqtSignal(int)
-    commandCanceling = pyqtSignal()
-
-    output = pyqtSignal(QString, QString)
-    progress = pyqtSignal(QString, object, QString, QString, object)
-    makeLogVisible = pyqtSignal(bool)
-
-    def __init__(self, logWindow, parent):
-        super(Runner, self).__init__(parent)
-        self.title = _('TortoiseHg')
-        self.core = Core(logWindow, parent)
-        self.core.commandStarted.connect(self.commandStarted)
-        self.core.commandFinished.connect(self.onCommandFinished)
-        self.core.commandCanceling.connect(self.commandCanceling)
-        self.core.output.connect(self.output)
-        self.core.progress.connect(self.progress)
-
-    ### Public Methods ###
-
-    def setTitle(self, title):
-        self.title = title
-
-    def run(self, cmdline, *args, **opts):
-        self.core.run(cmdline, *args, **opts)
-
-    def running(self):
-        return self.core.running()
-
-    def cancel(self):
-        self.core.cancel()
-
-    def outputShown(self):
-        if hasattr(self, 'dlg'):
-            return self.dlg.isVisible()
-        else:
-            return False
-
-    def setShowOutput(self, visible=True):
-        if not hasattr(self.core, 'outputLog'):
-            return
-        if not hasattr(self, 'dlg'):
-            self.dlg = dlg = QDialog(self.parent())
-            dlg.setWindowTitle(self.title)
-            dlg.setWindowFlags(Qt.Dialog)
-            dlg.setLayout(QVBoxLayout())
-            dlg.layout().addWidget(self.core.outputLog)
-            self.core.outputLog.setMinimumSize(460, 320)
-        self.dlg.setVisible(visible)
-
-    ### Signal Handler ###
-
-    @pyqtSlot(int)
-    def onCommandFinished(self, ret):
-        if ret != 0:
-            self.makeLogVisible.emit(True)
-            self.setShowOutput(True)
-        self.commandFinished.emit(ret)
-
 
 def errorMessageBox(session, parent=None, title=None):
     """Open a message box to report the error of the given session"""