7 Module implementing a dialog to show the output of the hg diff command process. |
7 Module implementing a dialog to show the output of the hg diff command process. |
8 """ |
8 """ |
9 |
9 |
10 import os |
10 import os |
11 |
11 |
12 from PyQt4.QtCore import pyqtSlot, QProcess, QTimer, QFileInfo |
12 from PyQt4.QtCore import pyqtSlot, QProcess, QTimer, QFileInfo, Qt |
13 from PyQt4.QtGui import QWidget, QDialogButtonBox, QBrush, QColor, \ |
13 from PyQt4.QtGui import QWidget, QDialogButtonBox, QBrush, QColor, \ |
14 QTextCursor, QFileDialog, QLineEdit |
14 QTextCursor, QFileDialog, QLineEdit |
15 |
15 |
16 from E5Gui import E5MessageBox |
16 from E5Gui import E5MessageBox |
17 |
17 |
172 self.contents.insertPlainText( |
172 self.contents.insertPlainText( |
173 self.trUtf8('There is no difference.')) |
173 self.trUtf8('There is no difference.')) |
174 return |
174 return |
175 |
175 |
176 self.buttonBox.button(QDialogButtonBox.Save).setEnabled(True) |
176 self.buttonBox.button(QDialogButtonBox.Save).setEnabled(True) |
|
177 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
|
178 self.buttonBox.button(QDialogButtonBox.Close).setFocus(Qt.OtherFocusReason) |
|
179 |
177 tc = self.contents.textCursor() |
180 tc = self.contents.textCursor() |
178 tc.movePosition(QTextCursor.Start) |
181 tc.movePosition(QTextCursor.Start) |
179 self.contents.setTextCursor(tc) |
182 self.contents.setTextCursor(tc) |
180 self.contents.ensureCursorVisible() |
183 self.contents.ensureCursorVisible() |
181 |
184 |