6 """ |
6 """ |
7 Module implementing the QFileDialog wizard plugin. |
7 Module implementing the QFileDialog wizard plugin. |
8 """ |
8 """ |
9 |
9 |
10 from __future__ import unicode_literals # __IGNORE_WARNING__ |
10 from __future__ import unicode_literals # __IGNORE_WARNING__ |
|
11 |
|
12 import re |
11 |
13 |
12 from PyQt4.QtCore import QObject |
14 from PyQt4.QtCore import QObject |
13 from PyQt4.QtGui import QDialog |
15 from PyQt4.QtGui import QDialog |
14 |
16 |
15 from E5Gui.E5Application import e5App |
17 from E5Gui.E5Application import e5App |
97 Private method to display a dialog and get the code. |
101 Private method to display a dialog and get the code. |
98 |
102 |
99 @param editor reference to the current editor |
103 @param editor reference to the current editor |
100 @return the generated code (string) |
104 @return the generated code (string) |
101 """ |
105 """ |
|
106 match = self.__pyqtRe.search(editor.text()) |
|
107 if match is None: |
|
108 pyqtVariant = 0 # unknown |
|
109 else: |
|
110 pyqtVariant = int(match.group(1)) # 4 or 5 |
|
111 |
102 from WizardPlugins.FileDialogWizard.FileDialogWizardDialog import \ |
112 from WizardPlugins.FileDialogWizard.FileDialogWizardDialog import \ |
103 FileDialogWizardDialog |
113 FileDialogWizardDialog |
104 dlg = FileDialogWizardDialog(None) |
114 dlg = FileDialogWizardDialog(pyqtVariant, None) |
105 if dlg.exec_() == QDialog.Accepted: |
115 if dlg.exec_() == QDialog.Accepted: |
106 line, index = editor.getCursorPosition() |
116 line, index = editor.getCursorPosition() |
107 indLevel = editor.indentation(line) // editor.indentationWidth() |
117 indLevel = editor.indentation(line) // editor.indentationWidth() |
108 if editor.indentationsUseTabs(): |
118 if editor.indentationsUseTabs(): |
109 indString = '\t' |
119 indString = '\t' |