7 Module implementing a dialog to show the output of the svn diff command process. |
7 Module implementing a dialog to show the output of the svn diff command process. |
8 """ |
8 """ |
9 |
9 |
10 import os |
10 import os |
11 |
11 |
12 from PyQt4.QtCore import QTimer, QFileInfo, QProcess, pyqtSlot |
12 from PyQt4.QtCore import QTimer, QFileInfo, QProcess, pyqtSlot, Qt |
13 from PyQt4.QtGui import QWidget, QColor, QLineEdit, QBrush, QTextCursor, QDialogButtonBox |
13 from PyQt4.QtGui import QWidget, QColor, QLineEdit, QBrush, QTextCursor, QDialogButtonBox |
14 |
14 |
15 from E5Gui.E5Application import e5App |
15 from E5Gui.E5Application import e5App |
16 from E5Gui import E5MessageBox, E5FileDialog |
16 from E5Gui import E5MessageBox, E5FileDialog |
17 |
17 |
93 @keyparam urls list of repository URLs (list of 2 strings) |
93 @keyparam urls list of repository URLs (list of 2 strings) |
94 @keyparam summary flag indicating a summarizing diff |
94 @keyparam summary flag indicating a summarizing diff |
95 (only valid for URL diffs) (boolean) |
95 (only valid for URL diffs) (boolean) |
96 """ |
96 """ |
97 self.errorGroup.hide() |
97 self.errorGroup.hide() |
|
98 self.inputGroup.show() |
98 self.intercept = False |
99 self.intercept = False |
99 self.filename = fn |
100 self.filename = fn |
100 |
101 |
101 self.process.kill() |
102 self.process.kill() |
102 |
103 |
167 |
168 |
168 self.process.start('svn', args) |
169 self.process.start('svn', args) |
169 procStarted = self.process.waitForStarted() |
170 procStarted = self.process.waitForStarted() |
170 if not procStarted: |
171 if not procStarted: |
171 self.inputGroup.setEnabled(False) |
172 self.inputGroup.setEnabled(False) |
|
173 self.inputGroup.hide() |
172 E5MessageBox.critical(self, |
174 E5MessageBox.critical(self, |
173 self.trUtf8('Process Generation Error'), |
175 self.trUtf8('Process Generation Error'), |
174 self.trUtf8( |
176 self.trUtf8( |
175 'The process {0} could not be started. ' |
177 'The process {0} could not be started. ' |
176 'Ensure, that it is in the search path.' |
178 'Ensure, that it is in the search path.' |
182 |
184 |
183 @param exitCode exit code of the process (integer) |
185 @param exitCode exit code of the process (integer) |
184 @param exitStatus exit status of the process (QProcess.ExitStatus) |
186 @param exitStatus exit status of the process (QProcess.ExitStatus) |
185 """ |
187 """ |
186 self.inputGroup.setEnabled(False) |
188 self.inputGroup.setEnabled(False) |
|
189 self.inputGroup.hide() |
187 |
190 |
188 if self.paras == 0: |
191 if self.paras == 0: |
189 self.contents.insertPlainText( |
192 self.contents.insertPlainText( |
190 self.trUtf8('There is no difference.')) |
193 self.trUtf8('There is no difference.')) |
191 return |
194 return |
192 |
195 |
193 self.buttonBox.button(QDialogButtonBox.Save).setEnabled(True) |
196 self.buttonBox.button(QDialogButtonBox.Save).setEnabled(True) |
|
197 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
|
198 self.buttonBox.button(QDialogButtonBox.Close).setFocus(Qt.OtherFocusReason) |
|
199 |
194 tc = self.contents.textCursor() |
200 tc = self.contents.textCursor() |
195 tc.movePosition(QTextCursor.Start) |
201 tc.movePosition(QTextCursor.Start) |
196 self.contents.setTextCursor(tc) |
202 self.contents.setTextCursor(tc) |
197 self.contents.ensureCursorVisible() |
203 self.contents.ensureCursorVisible() |
198 |
204 |