UI/DiffDialog.py

changeset 2101
5bac7dee9e1a
parent 1509
c0b5e693b0eb
child 2302
f29e9405c851
equal deleted inserted replaced
2100:fb16f4650860 2101:5bac7dee9e1a
10 import os 10 import os
11 import time 11 import time
12 12
13 from PyQt4.QtCore import QFileInfo, QEvent, pyqtSlot 13 from PyQt4.QtCore import QFileInfo, QEvent, pyqtSlot
14 from PyQt4.QtGui import QWidget, QColor, QBrush, QApplication, QTextCursor, \ 14 from PyQt4.QtGui import QWidget, QColor, QBrush, QApplication, QTextCursor, \
15 QDialogButtonBox, QMainWindow 15 QDialogButtonBox
16 16
17 from E5Gui.E5Completers import E5FileCompleter 17 from E5Gui.E5Completers import E5FileCompleter
18 from E5Gui import E5MessageBox, E5FileDialog 18 from E5Gui import E5MessageBox, E5FileDialog
19 from E5Gui.E5MainWindow import E5MainWindow
19 20
20 from .Ui_DiffDialog import Ui_DiffDialog 21 from .Ui_DiffDialog import Ui_DiffDialog
22
21 import Utilities 23 import Utilities
24 import Preferences
22 25
23 from difflib import SequenceMatcher 26 from difflib import SequenceMatcher
24 27
25 # This function is copied from python 2.3 and slightly modified. 28 # This function is copied from python 2.3 and slightly modified.
26 # The header lines contain a tab after the filename. 29 # The header lines contain a tab after the filename.
485 Private slot to handle the file 2 file selection button press. 488 Private slot to handle the file 2 file selection button press.
486 """ 489 """
487 self.__selectFile(self.file2Edit) 490 self.__selectFile(self.file2Edit)
488 491
489 492
490 class DiffWindow(QMainWindow): 493 class DiffWindow(E5MainWindow):
491 """ 494 """
492 Main window class for the standalone dialog. 495 Main window class for the standalone dialog.
493 """ 496 """
494 def __init__(self, parent=None): 497 def __init__(self, parent=None):
495 """ 498 """
496 Constructor 499 Constructor
497 500
498 @param parent reference to the parent widget (QWidget) 501 @param parent reference to the parent widget (QWidget)
499 """ 502 """
500 super().__init__(parent) 503 super().__init__(parent)
504
505 self.setStyle(Preferences.getUI("Style"), Preferences.getUI("StyleSheet"))
506
501 self.cw = DiffDialog(self) 507 self.cw = DiffDialog(self)
502 self.cw.installEventFilter(self) 508 self.cw.installEventFilter(self)
503 size = self.cw.size() 509 size = self.cw.size()
504 self.setCentralWidget(self.cw) 510 self.setCentralWidget(self.cw)
505 self.resize(size) 511 self.resize(size)

eric ide

mercurial