10 import os |
10 import os |
11 import re |
11 import re |
12 |
12 |
13 from PyQt4.QtCore import QFileInfo, pyqtSlot |
13 from PyQt4.QtCore import QFileInfo, pyqtSlot |
14 from PyQt4.QtGui import QWidget, QDialog, QInputDialog, QApplication, QClipboard, \ |
14 from PyQt4.QtGui import QWidget, QDialog, QInputDialog, QApplication, QClipboard, \ |
15 QTextCursor, QDialogButtonBox, QMainWindow, QVBoxLayout, QTableWidgetItem |
15 QTextCursor, QDialogButtonBox, QVBoxLayout, QTableWidgetItem |
16 |
16 |
17 from E5Gui import E5MessageBox, E5FileDialog |
17 from E5Gui import E5MessageBox, E5FileDialog |
|
18 from E5Gui.E5MainWindow import E5MainWindow |
18 |
19 |
19 from .Ui_PyRegExpWizardDialog import Ui_PyRegExpWizardDialog |
20 from .Ui_PyRegExpWizardDialog import Ui_PyRegExpWizardDialog |
20 |
21 |
21 from .PyRegExpWizardRepeatDialog import PyRegExpWizardRepeatDialog |
22 from .PyRegExpWizardRepeatDialog import PyRegExpWizardRepeatDialog |
22 from .PyRegExpWizardCharactersDialog import PyRegExpWizardCharactersDialog |
23 from .PyRegExpWizardCharactersDialog import PyRegExpWizardCharactersDialog |
23 |
24 |
24 import UI.PixmapCache |
25 import UI.PixmapCache |
25 |
26 |
26 import Utilities |
27 import Utilities |
|
28 import Preferences |
27 |
29 |
28 |
30 |
29 class PyRegExpWizardWidget(QWidget, Ui_PyRegExpWizardDialog): |
31 class PyRegExpWizardWidget(QWidget, Ui_PyRegExpWizardDialog): |
30 """ |
32 """ |
31 Class implementing the Python re wizard dialog. |
33 Class implementing the Python re wizard dialog. |
662 @return generated code (string) |
664 @return generated code (string) |
663 """ |
665 """ |
664 return self.cw.getCode(indLevel, indString) |
666 return self.cw.getCode(indLevel, indString) |
665 |
667 |
666 |
668 |
667 class PyRegExpWizardWindow(QMainWindow): |
669 class PyRegExpWizardWindow(E5MainWindow): |
668 """ |
670 """ |
669 Main window class for the standalone dialog. |
671 Main window class for the standalone dialog. |
670 """ |
672 """ |
671 def __init__(self, parent=None): |
673 def __init__(self, parent=None): |
672 """ |
674 """ |
678 self.cw = PyRegExpWizardWidget(self, fromEric=False) |
680 self.cw = PyRegExpWizardWidget(self, fromEric=False) |
679 size = self.cw.size() |
681 size = self.cw.size() |
680 self.setCentralWidget(self.cw) |
682 self.setCentralWidget(self.cw) |
681 self.resize(size) |
683 self.resize(size) |
682 |
684 |
|
685 self.setStyle(Preferences.getUI("Style"), Preferences.getUI("StyleSheet")) |
|
686 |
683 self.cw.buttonBox.accepted[()].connect(self.close) |
687 self.cw.buttonBox.accepted[()].connect(self.close) |
684 self.cw.buttonBox.rejected[()].connect(self.close) |
688 self.cw.buttonBox.rejected[()].connect(self.close) |