10 import os |
10 import os |
11 |
11 |
12 from PyQt4.QtCore import QDir, QTimer, QFileInfo, pyqtSignal, QEvent, QSize, \ |
12 from PyQt4.QtCore import QDir, QTimer, QFileInfo, pyqtSignal, QEvent, QSize, \ |
13 QTranslator, QObject, Qt |
13 QTranslator, QObject, Qt |
14 from PyQt4.QtGui import QSizePolicy, QSpacerItem, QWidget, QHBoxLayout, QKeySequence, \ |
14 from PyQt4.QtGui import QSizePolicy, QSpacerItem, QWidget, QHBoxLayout, QKeySequence, \ |
15 QWhatsThis, QMdiArea, qApp, QApplication, QMainWindow, QComboBox, QVBoxLayout, \ |
15 QWhatsThis, QMdiArea, qApp, QApplication, QComboBox, QVBoxLayout, QAction, QLabel |
16 QAction, QLabel |
|
17 from PyQt4 import uic |
16 from PyQt4 import uic |
18 |
17 |
19 from E5Gui import E5MessageBox, E5FileDialog |
18 from E5Gui import E5MessageBox, E5FileDialog |
|
19 from E5Gui.E5MainWindow import E5MainWindow |
20 |
20 |
21 from .TRSingleApplication import TRSingleApplicationServer |
21 from .TRSingleApplication import TRSingleApplicationServer |
22 |
22 |
23 import UI.PixmapCache |
23 import UI.PixmapCache |
24 import UI.Config |
24 import UI.Config |
25 |
25 |
|
26 import Preferences |
|
27 |
26 |
28 |
27 noTranslationName = QApplication.translate("TRPreviewer", "<No translation>") |
29 noTranslationName = QApplication.translate("TRPreviewer", "<No translation>") |
28 |
30 |
29 |
31 |
30 class TRPreviewer(QMainWindow): |
32 class TRPreviewer(E5MainWindow): |
31 """ |
33 """ |
32 Class implementing the UI Previewer main window. |
34 Class implementing the UI Previewer main window. |
33 """ |
35 """ |
34 def __init__(self, filenames=[], parent=None, name=None): |
36 def __init__(self, filenames=[], parent=None, name=None): |
35 """ |
37 """ |
45 super().__init__(parent) |
47 super().__init__(parent) |
46 if not name: |
48 if not name: |
47 self.setObjectName("TRPreviewer") |
49 self.setObjectName("TRPreviewer") |
48 else: |
50 else: |
49 self.setObjectName(name) |
51 self.setObjectName(name) |
|
52 |
|
53 self.setStyle(Preferences.getUI("Style"), Preferences.getUI("StyleSheet")) |
|
54 |
50 self.resize(QSize(800, 600).expandedTo(self.minimumSizeHint())) |
55 self.resize(QSize(800, 600).expandedTo(self.minimumSizeHint())) |
51 self.setAttribute(Qt.WA_DeleteOnClose) |
56 self.setAttribute(Qt.WA_DeleteOnClose) |
52 self.statusBar() |
57 self.statusBar() |
53 |
58 |
54 self.setWindowIcon(UI.PixmapCache.getIcon("eric.png")) |
59 self.setWindowIcon(UI.PixmapCache.getIcon("eric.png")) |