Changeset 29caeb413598…
Parent f50560f2ee7a…
by
Changes to 16 files · Browse files at 29caeb413598 Showing diff from parent f50560f2ee7a Diff from another changeset...
@@ -89,7 +89,7 @@ self.grid.addWidget(self.keep_open_chk, 10, 1)
# command widget
- self.cmd = cmdui.Widget()
+ self.cmd = cmdui.Widget(True, True, self)
self.cmd.commandStarted.connect(self.command_started)
self.cmd.commandFinished.connect(self.command_finished)
self.cmd.commandCanceling.connect(self.command_canceling)
|
@@ -97,7 +97,7 @@ box.addWidget(self.reslabel)
## command widget
- self.cmd = cmdui.Widget()
+ self.cmd = cmdui.Widget(True, False, self)
self.cmd.commandStarted.connect(self.command_started)
self.cmd.commandFinished.connect(self.command_finished)
self.cmd.commandCanceling.connect(self.command_canceling)
|
@@ -51,7 +51,7 @@ box.addLayout(hbox)
## command widget
- self.cmd = cmdui.Widget()
+ self.cmd = cmdui.Widget(True, False, self)
self.cmd.setShowOutput(True)
box.addWidget(self.cmd, 1)
|
@@ -128,7 +128,7 @@ stretch=40)
## command widget
- self.cmd = cmdui.Widget()
+ self.cmd = cmdui.Widget(True, True, self)
self.cmd.commandStarted.connect(self.command_started)
self.cmd.commandFinished.connect(self.command_finished)
self.cmd.commandFinished.connect(self.cmdfinished)
|
|
|
@@ -141,7 +141,7 @@ output = pyqtSignal(QString, QString)
progress = pyqtSignal(QString, object, QString, QString, object)
- def __init__(self, useInternal, parent):
+ def __init__(self, logWindow, parent):
super(Core, self).__init__(parent)
self.thread = None
@@ -151,8 +151,7 @@ self.rawoutlines = []
self.display = None
self.useproc = False
- self.internallog = useInternal
- if useInternal:
+ if logWindow:
self.outputLog = LogWidget()
self.outputLog.installEventFilter(qscilib.KeyPressInterceptor(self))
self.output.connect(self.outputLog.appendLog)
@@ -283,7 +282,7 @@ return True
def clearOutput(self):
- if self.internallog:
+ if hasattr(self, 'outputLog'):
self.outputLog.clear()
### Signal Handlers ###
@@ -501,7 +500,7 @@
@util.propertycache
def _cmdcore(self):
- cmdcore = Core(useInternal=False, parent=self)
+ cmdcore = Core(False, self)
cmdcore.output.connect(self._logwidget.appendLog)
cmdcore.commandStarted.connect(self.closePrompt)
cmdcore.commandFinished.connect(self.openPrompt)
@@ -642,35 +641,33 @@ progress = pyqtSignal(QString, object, QString, QString, object)
makeLogVisible = pyqtSignal(bool)
- def __init__(self, useInternal=True, parent=None):
+ def __init__(self, logWindow, statusBar, parent):
super(Widget, self).__init__(parent)
- self.internallog = useInternal
- self.core = Core(useInternal, self)
+ self.core = Core(logWindow, self)
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)
- if not useInternal:
+ if not logWindow:
return
vbox = QVBoxLayout()
vbox.setSpacing(4)
vbox.setContentsMargins(*(1,)*4)
+ self.setLayout(vbox)
# command output area
self.core.outputLog.setHidden(True)
- vbox.addWidget(self.core.outputLog, 1)
+ self.layout().addWidget(self.core.outputLog, 1)
- ## status and progress labels
- self.stbar = ThgStatusBar()
- self.stbar.setSizeGripEnabled(False)
- self.core.setStbar(self.stbar)
- vbox.addWidget(self.stbar)
-
- # widget setting
- self.setLayout(vbox)
+ if statusBar:
+ ## status and progress labels
+ self.stbar = ThgStatusBar()
+ self.stbar.setSizeGripEnabled(False)
+ self.core.setStbar(self.stbar)
+ self.layout().addWidget(self.stbar)
### Public Methods ###
@@ -681,11 +678,11 @@ self.core.cancel()
def setShowOutput(self, visible):
- if self.internallog:
+ if hasattr(self.core, 'outputLog'):
self.core.outputLog.setShown(visible)
def outputShown(self):
- if self.internallog:
+ if hasattr(self.core, 'outputLog'):
return self.core.outputLog.isVisible()
else:
return False
@@ -803,22 +800,16 @@ progress = pyqtSignal(QString, object, QString, QString, object)
makeLogVisible = pyqtSignal(bool)
- def __init__(self, useInternal, parent):
+ def __init__(self, logWindow, parent):
super(Runner, self).__init__(parent)
- self.internallog = useInternal
self.title = _('TortoiseHg')
-
- self.core = Core(useInternal, parent)
+ 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)
- if useInternal:
- self.core.outputLog.setMinimumSize(460, 320)
-
### Public Methods ###
def setTitle(self, title):
@@ -840,7 +831,7 @@ return False
def setShowOutput(self, visible=True):
- if not self.internallog:
+ if not hasattr(self.core, 'outputLog'):
return
if not hasattr(self, 'dlg'):
self.dlg = dlg = QDialog(self.parent())
@@ -848,6 +839,7 @@ 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 ###
|
@@ -50,7 +50,7 @@ self.destcsinfo = dest
self.layout().addWidget(destb)
- self.cmd = cmdui.Widget()
+ self.cmd = cmdui.Widget(True, False, self)
self.cmd.commandFinished.connect(self.commandFinished)
self.cmd.setShowOutput(True)
self.showMessage.connect(self.cmd.stbar.showMessage)
|
@@ -118,7 +118,7 @@ # perform pane
ppane = QVBoxLayout()
ppane.addSpacing(4)
- self.cmd = cmdui.Widget()
+ self.cmd = cmdui.Widget(True, True, self)
self.cmd.setShowOutput(True)
self.cmd.commandFinished.connect(self.command_finished)
self.cmd.commandCanceling.connect(self.command_canceling)
|
@@ -78,7 +78,7 @@ else:
self.svnchk = None
- self.cmd = cmdui.Widget()
+ self.cmd = cmdui.Widget(True, False, self)
self.cmd.commandFinished.connect(self.commandFinished)
self.showMessage.connect(self.cmd.stbar.showMessage)
self.cmd.stbar.linkActivated.connect(self.linkActivated)
|
@@ -83,7 +83,7 @@ self.keep_open_chk = QCheckBox(_('Always show output'))
# command widget
- self.cmd = cmdui.Widget()
+ self.cmd = cmdui.Widget(True, False, self)
self.cmd.commandStarted.connect(self.command_started)
self.cmd.commandFinished.connect(self.command_finished)
self.cmd.commandCanceling.connect(self.command_canceling)
|
@@ -127,7 +127,7 @@
out = qtlib.LabeledSeparator(_('Command output'))
self.layout().addWidget(out)
- self.cmd = cmdui.Widget(True, self)
+ self.cmd = cmdui.Widget(True, False, self)
self.cmd.commandFinished.connect(self.refresh)
self.cmd.setShowOutput(True)
self.layout().addWidget(self.cmd)
|
@@ -36,11 +36,8 @@ self.allchk = QCheckBox(_('Revert all files to this revision'))
self.layout().addWidget(self.allchk)
- self.cmd = cmdui.Widget()
- self.cmd.setShowOutput(False)
- self.cmd.stbar.setVisible(False)
+ self.cmd = cmdui.Runner(True, self)
self.cmd.commandFinished.connect(self.finished)
- self.layout().addWidget(self.cmd, 1)
BB = QDialogButtonBox
bbox = QDialogButtonBox(BB.Ok|BB.Cancel)
@@ -62,8 +59,6 @@ else:
cmdline = ['revert', '--repository', self.repo.root, self.wfile]
cmdline += ['--rev', self.rev]
- self.cmd.setShowOutput(True)
- self.cmd.stbar.setVisible(True)
self.cmd.run(cmdline)
def finished(self, ret):
|
@@ -34,7 +34,7 @@ self._updateform()
def _initcmd(self):
- self._cmd = cmdui.Widget()
+ self._cmd = cmdui.Widget(True, False, self)
# TODO: forget old logs?
self._log_edit = self._cmd.core.outputLog
self._qui.details_tabs.addTab(self._log_edit, _('Log'))
|
@@ -242,10 +242,9 @@ self.postpullbutton.clicked.connect(self.postpullclicked)
self.optionsbutton.pressed.connect(self.editOptions)
- cmd = cmdui.Widget(not self.embedded, self)
+ cmd = cmdui.Widget(not self.embedded, True, self)
cmd.commandStarted.connect(self.commandStarted)
cmd.commandFinished.connect(self.commandFinished)
-
cmd.makeLogVisible.connect(self.makeLogVisible)
cmd.output.connect(self.output)
cmd.progress.connect(self.progress)
|
@@ -89,7 +89,7 @@ grid.addItem(statbox, 3, 1)
## command widget
- self.cmd = cmdui.Widget()
+ self.cmd = cmdui.Widget(True, False, self)
self.cmd.commandStarted.connect(self.command_started)
self.cmd.commandFinished.connect(self.command_finished)
self.cmd.commandCanceling.connect(self.command_canceling)
|
@@ -91,7 +91,7 @@ self.nobackup_chk.setChecked(bool(opts.get('nobackup')))
## command widget
- self.cmd = cmdui.Widget()
+ self.cmd = cmdui.Widget(True, True, self)
self.cmd.commandStarted.connect(self.command_started)
self.cmd.commandFinished.connect(self.command_finished)
self.cmd.commandCanceling.connect(self.command_canceling)
|
@@ -107,7 +107,7 @@ repo.ui.configbool('tortoisehg', 'autoresolve', False))
## command widget
- self.cmd = cmdui.Widget(True, self)
+ self.cmd = cmdui.Widget(True, True, self)
self.cmd.commandStarted.connect(self.command_started)
self.cmd.commandFinished.connect(self.command_finished)
self.cmd.commandCanceling.connect(self.command_canceling)
|
Loading...