7 Module implementing a dialog starting a process and showing its output. |
7 Module implementing a dialog starting a process and showing its output. |
8 """ |
8 """ |
9 |
9 |
10 import os |
10 import os |
11 |
11 |
12 from PyQt4.QtCore import QTimer, QProcess, pyqtSlot |
12 from PyQt4.QtCore import QTimer, QProcess, pyqtSlot, Qt |
13 from PyQt4.QtGui import QLineEdit, QDialog, QDialogButtonBox |
13 from PyQt4.QtGui import QLineEdit, QDialog, QDialogButtonBox |
14 |
14 |
15 from E5Gui import E5MessageBox |
15 from E5Gui import E5MessageBox |
16 |
16 |
17 from .Ui_SvnDialog import Ui_SvnDialog |
17 from .Ui_SvnDialog import Ui_SvnDialog |
59 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) |
59 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) |
60 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
60 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
61 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
61 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
62 |
62 |
63 self.inputGroup.setEnabled(False) |
63 self.inputGroup.setEnabled(False) |
|
64 self.inputGroup.hide() |
64 |
65 |
65 self.proc = None |
66 self.proc = None |
|
67 |
|
68 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) |
|
69 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
|
70 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
|
71 self.buttonBox.button(QDialogButtonBox.Close).setFocus(Qt.OtherFocusReason) |
66 |
72 |
67 if Preferences.getVCS("AutoClose") and \ |
73 if Preferences.getVCS("AutoClose") and \ |
68 self.normal and \ |
74 self.normal and \ |
69 self.errors.toPlainText() == "": |
75 self.errors.toPlainText() == "": |
70 self.accept() |
76 self.accept() |
128 self.proc.start('svn', args) |
134 self.proc.start('svn', args) |
129 procStarted = self.proc.waitForStarted() |
135 procStarted = self.proc.waitForStarted() |
130 if not procStarted: |
136 if not procStarted: |
131 self.buttonBox.setFocus() |
137 self.buttonBox.setFocus() |
132 self.inputGroup.setEnabled(False) |
138 self.inputGroup.setEnabled(False) |
|
139 self.inputGroup.hide() |
133 E5MessageBox.critical(self, |
140 E5MessageBox.critical(self, |
134 self.trUtf8('Process Generation Error'), |
141 self.trUtf8('Process Generation Error'), |
135 self.trUtf8( |
142 self.trUtf8( |
136 'The process {0} could not be started. ' |
143 'The process {0} could not be started. ' |
137 'Ensure, that it is in the search path.' |
144 'Ensure, that it is in the search path.' |
138 ).format('svn')) |
145 ).format('svn')) |
139 else: |
146 else: |
140 self.inputGroup.setEnabled(True) |
147 self.inputGroup.setEnabled(True) |
|
148 self.inputGroup.show() |
141 return procStarted |
149 return procStarted |
142 |
150 |
143 def normalExit(self): |
151 def normalExit(self): |
144 """ |
152 """ |
145 Public method to check for a normal process termination. |
153 Public method to check for a normal process termination. |