12 |
12 |
13 from PyQt4.QtCore import * |
13 from PyQt4.QtCore import * |
14 from PyQt4.QtGui import * |
14 from PyQt4.QtGui import * |
15 |
15 |
16 from E5Gui.E5Completers import E5FileCompleter |
16 from E5Gui.E5Completers import E5FileCompleter |
17 from E5Gui import E5MessageBox |
17 from E5Gui import E5MessageBox, E5FileDialog |
18 |
18 |
19 from .Ui_DiffDialog import Ui_DiffDialog |
19 from .Ui_DiffDialog import Ui_DiffDialog |
20 import Utilities |
20 import Utilities |
21 |
21 |
22 from difflib import SequenceMatcher |
22 from difflib import SequenceMatcher |
267 if fname != '.': |
267 if fname != '.': |
268 fname = "{0}.diff".format(self.filename2) |
268 fname = "{0}.diff".format(self.filename2) |
269 else: |
269 else: |
270 fname = dname |
270 fname = dname |
271 |
271 |
272 fname, selectedFilter = QFileDialog.getSaveFileNameAndFilter( |
272 fname, selectedFilter = E5FileDialog.getSaveFileNameAndFilter( |
273 self, |
273 self, |
274 self.trUtf8("Save Diff"), |
274 self.trUtf8("Save Diff"), |
275 fname, |
275 fname, |
276 self.trUtf8("Patch Files (*.diff)"), |
276 self.trUtf8("Patch Files (*.diff)"), |
277 None, |
277 None, |
278 QFileDialog.Options(QFileDialog.DontConfirmOverwrite | |
278 E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite)) |
279 QFileDialog.DontUseNativeDialog)) |
|
280 |
279 |
281 if not fname: |
280 if not fname: |
282 return |
281 return |
283 |
282 |
284 ext = QFileInfo(fname).suffix() |
283 ext = QFileInfo(fname).suffix() |
456 Private slot to display a file selection dialog. |
455 Private slot to display a file selection dialog. |
457 |
456 |
458 @param lineEdit field for the display of the selected filename |
457 @param lineEdit field for the display of the selected filename |
459 (QLineEdit) |
458 (QLineEdit) |
460 """ |
459 """ |
461 filename = QFileDialog.getOpenFileName( |
460 filename = E5FileDialog.getOpenFileName( |
462 self, |
461 self, |
463 self.trUtf8("Select file to compare"), |
462 self.trUtf8("Select file to compare"), |
464 lineEdit.text(), |
463 lineEdit.text(), |
465 "", |
464 "") |
466 QFileDialog.DontUseNativeDialog) |
|
467 |
465 |
468 if filename: |
466 if filename: |
469 lineEdit.setText(Utilities.toNativeSeparators(filename)) |
467 lineEdit.setText(Utilities.toNativeSeparators(filename)) |
470 |
468 |
471 @pyqtSlot() |
469 @pyqtSlot() |