16 class PyRegExpWizardCharactersDialog(QDialog, Ui_PyRegExpWizardCharactersDialog): |
16 class PyRegExpWizardCharactersDialog(QDialog, Ui_PyRegExpWizardCharactersDialog): |
17 """ |
17 """ |
18 Class implementing a dialog for entering character classes. |
18 Class implementing a dialog for entering character classes. |
19 """ |
19 """ |
20 specialChars = { |
20 specialChars = { |
21 4 : "\\a", |
21 4: "\\a", |
22 5 : "\\f", |
22 5: "\\f", |
23 6 : "\\n", |
23 6: "\\n", |
24 7 : "\\r", |
24 7: "\\r", |
25 8 : "\\t", |
25 8: "\\t", |
26 9 : "\\v" |
26 9: "\\v" |
27 } |
27 } |
28 |
28 |
29 predefinedClasses = ["\\s", "\\S", "\\w", "\\W", "\\d", "\\D"] |
29 predefinedClasses = ["\\s", "\\S", "\\w", "\\W", "\\d", "\\D"] |
30 |
30 |
31 def __init__(self,parent = None): |
31 def __init__(self, parent=None): |
32 """ |
32 """ |
33 Constructor |
33 Constructor |
34 |
34 |
35 @param parent parent widget (QWidget) |
35 @param parent parent widget (QWidget) |
36 """ |
36 """ |
37 QDialog.__init__(self,parent) |
37 QDialog.__init__(self, parent) |
38 self.setupUi(self) |
38 self.setupUi(self) |
39 |
39 |
40 self.comboItems = [] |
40 self.comboItems = [] |
41 self.comboItems.append(self.trUtf8("Normal character")) |
41 self.comboItems.append(self.trUtf8("Normal character")) |
42 self.comboItems.append(self.trUtf8("Unicode character in hexadecimal notation")) |
42 self.comboItems.append(self.trUtf8("Unicode character in hexadecimal notation")) |
79 hlayout0.setObjectName("hlayout0") |
79 hlayout0.setObjectName("hlayout0") |
80 self.moreSinglesButton = QPushButton(self.trUtf8("Additional Entries"), |
80 self.moreSinglesButton = QPushButton(self.trUtf8("Additional Entries"), |
81 self.singlesBox) |
81 self.singlesBox) |
82 self.moreSinglesButton.setObjectName("moreSinglesButton") |
82 self.moreSinglesButton.setObjectName("moreSinglesButton") |
83 hlayout0.addWidget(self.moreSinglesButton) |
83 hlayout0.addWidget(self.moreSinglesButton) |
84 hspacer0 = QSpacerItem(30,20,QSizePolicy.Expanding,QSizePolicy.Minimum) |
84 hspacer0 = QSpacerItem(30, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) |
85 hlayout0.addItem(hspacer0) |
85 hlayout0.addItem(hspacer0) |
86 self.singlesBoxLayout.addLayout(hlayout0) |
86 self.singlesBoxLayout.addLayout(hlayout0) |
87 self.moreSinglesButton.clicked[()].connect(self.__addSinglesLine) |
87 self.moreSinglesButton.clicked[()].connect(self.__addSinglesLine) |
88 |
88 |
89 # generate dialog part for character ranges |
89 # generate dialog part for character ranges |
112 hlayout1.setObjectName("hlayout1") |
112 hlayout1.setObjectName("hlayout1") |
113 self.moreRangesButton = QPushButton(self.trUtf8("Additional Entries"), |
113 self.moreRangesButton = QPushButton(self.trUtf8("Additional Entries"), |
114 self.rangesBox) |
114 self.rangesBox) |
115 self.moreSinglesButton.setObjectName("moreRangesButton") |
115 self.moreSinglesButton.setObjectName("moreRangesButton") |
116 hlayout1.addWidget(self.moreRangesButton) |
116 hlayout1.addWidget(self.moreRangesButton) |
117 hspacer1 = QSpacerItem(30,20,QSizePolicy.Expanding,QSizePolicy.Minimum) |
117 hspacer1 = QSpacerItem(30, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) |
118 hlayout1.addItem(hspacer1) |
118 hlayout1.addItem(hspacer1) |
119 self.rangesBoxLayout.addLayout(hlayout1) |
119 self.rangesBoxLayout.addLayout(hlayout1) |
120 self.moreRangesButton.clicked[()].connect(self.__addRangesLine) |
120 self.moreRangesButton.clicked[()].connect(self.__addRangesLine) |
121 |
121 |
122 def __addSinglesLine(self): |
122 def __addSinglesLine(self): |