Plugins/WizardPlugins/InputDialogWizard/InputDialogWizardDialog.py

changeset 3190
a9a94491c4fd
parent 3160
209a07d7e401
child 3366
6084bb3c3911
equal deleted inserted replaced
3189:9a21c547de5f 3190:a9a94491c4fd
39 QDoubleValidator(-2147483647, 2147483647, 99, self.eDoubleFrom)) 39 QDoubleValidator(-2147483647, 2147483647, 99, self.eDoubleFrom))
40 self.eDoubleTo.setValidator( 40 self.eDoubleTo.setValidator(
41 QDoubleValidator(-2147483647, 2147483647, 99, self.eDoubleTo)) 41 QDoubleValidator(-2147483647, 2147483647, 99, self.eDoubleTo))
42 42
43 self.bTest = self.buttonBox.addButton( 43 self.bTest = self.buttonBox.addButton(
44 self.trUtf8("Test"), QDialogButtonBox.ActionRole) 44 self.tr("Test"), QDialogButtonBox.ActionRole)
45 45
46 @pyqtSlot(bool) 46 @pyqtSlot(bool)
47 def on_rItem_toggled(self, checked): 47 def on_rItem_toggled(self, checked):
48 """ 48 """
49 Private slot to perform actions dependant on the item type selection. 49 Private slot to perform actions dependant on the item type selection.
138 resvar = "result" 138 resvar = "result"
139 code = '{0}, ok = QInputDialog.'.format(resvar) 139 code = '{0}, ok = QInputDialog.'.format(resvar)
140 if self.rText.isChecked(): 140 if self.rText.isChecked():
141 code += 'getText({0}{1}'.format(os.linesep, istring) 141 code += 'getText({0}{1}'.format(os.linesep, istring)
142 code += '{0},{1}{2}'.format(parent, os.linesep, istring) 142 code += '{0},{1}{2}'.format(parent, os.linesep, istring)
143 code += 'self.trUtf8("{0}"),{1}{2}'.format( 143 code += 'self.tr("{0}"),{1}{2}'.format(
144 self.eCaption.text(), os.linesep, istring) 144 self.eCaption.text(), os.linesep, istring)
145 code += 'self.trUtf8("{0}"),{1}{2}'.format( 145 code += 'self.tr("{0}"),{1}{2}'.format(
146 self.eLabel.text(), os.linesep, istring) 146 self.eLabel.text(), os.linesep, istring)
147 if self.rEchoNormal.isChecked(): 147 if self.rEchoNormal.isChecked():
148 code += 'QLineEdit.Normal' 148 code += 'QLineEdit.Normal'
149 elif self.rEchoNoEcho.isChecked(): 149 elif self.rEchoNoEcho.isChecked():
150 code += 'QLineEdit.NoEcho' 150 code += 'QLineEdit.NoEcho'
151 else: 151 else:
152 code += 'QLineEdit.Password' 152 code += 'QLineEdit.Password'
153 if self.eTextDefault.text(): 153 if self.eTextDefault.text():
154 code += ',{0}{1}self.trUtf8("{2}")'.format( 154 code += ',{0}{1}self.tr("{2}")'.format(
155 os.linesep, istring, self.eTextDefault.text()) 155 os.linesep, istring, self.eTextDefault.text())
156 code += '){0}'.format(estring) 156 code += '){0}'.format(estring)
157 elif self.rInteger.isChecked(): 157 elif self.rInteger.isChecked():
158 code += 'getInt({0}{1}'.format(os.linesep, istring) 158 code += 'getInt({0}{1}'.format(os.linesep, istring)
159 code += '{0},{1}{2}'.format(parent, os.linesep, istring) 159 code += '{0},{1}{2}'.format(parent, os.linesep, istring)
160 code += 'self.trUtf8("{0}"),{1}{2}'.format( 160 code += 'self.tr("{0}"),{1}{2}'.format(
161 self.eCaption.text(), os.linesep, istring) 161 self.eCaption.text(), os.linesep, istring)
162 code += 'self.trUtf8("{0}"),{1}{2}'.format( 162 code += 'self.tr("{0}"),{1}{2}'.format(
163 self.eLabel.text(), os.linesep, istring) 163 self.eLabel.text(), os.linesep, istring)
164 code += '{0:d}, {1:d}, {2:d}, {3:d}){4}'.format( 164 code += '{0:d}, {1:d}, {2:d}, {3:d}){4}'.format(
165 self.sIntDefault.value(), self.sIntFrom.value(), 165 self.sIntDefault.value(), self.sIntFrom.value(),
166 self.sIntTo.value(), self.sIntStep.value(), estring) 166 self.sIntTo.value(), self.sIntStep.value(), estring)
167 elif self.rDouble.isChecked(): 167 elif self.rDouble.isChecked():
177 doubleTo = float(self.eDoubleTo.text()) 177 doubleTo = float(self.eDoubleTo.text())
178 except ValueError: 178 except ValueError:
179 doubleTo = 2147483647 179 doubleTo = 2147483647
180 code += 'getDouble({0}{1}'.format(os.linesep, istring) 180 code += 'getDouble({0}{1}'.format(os.linesep, istring)
181 code += '{0},{1}{2}'.format(parent, os.linesep, istring) 181 code += '{0},{1}{2}'.format(parent, os.linesep, istring)
182 code += 'self.trUtf8("{0}"),{1}{2}'.format( 182 code += 'self.tr("{0}"),{1}{2}'.format(
183 self.eCaption.text(), os.linesep, istring) 183 self.eCaption.text(), os.linesep, istring)
184 code += 'self.trUtf8("{0}"),{1}{2}'.format( 184 code += 'self.tr("{0}"),{1}{2}'.format(
185 self.eLabel.text(), os.linesep, istring) 185 self.eLabel.text(), os.linesep, istring)
186 code += '{0}, {1}, {2}, {3:d}){4}'.format( 186 code += '{0}, {1}, {2}, {3:d}){4}'.format(
187 doubleDefault, doubleFrom, doubleTo, 187 doubleDefault, doubleFrom, doubleTo,
188 self.sDoubleDecimals.value(), estring) 188 self.sDoubleDecimals.value(), estring)
189 elif self.rItem.isChecked(): 189 elif self.rItem.isChecked():
190 code += 'getItem({0}{1}'.format(os.linesep, istring) 190 code += 'getItem({0}{1}'.format(os.linesep, istring)
191 code += '{0},{1}{2}'.format(parent, os.linesep, istring) 191 code += '{0},{1}{2}'.format(parent, os.linesep, istring)
192 code += 'self.trUtf8("{0}"),{1}{2}'.format( 192 code += 'self.tr("{0}"),{1}{2}'.format(
193 self.eCaption.text(), os.linesep, istring) 193 self.eCaption.text(), os.linesep, istring)
194 code += 'self.trUtf8("{0}"),{1}{2}'.format( 194 code += 'self.tr("{0}"),{1}{2}'.format(
195 self.eLabel.text(), os.linesep, istring) 195 self.eLabel.text(), os.linesep, istring)
196 code += '{0},{1}{2}'.format( 196 code += '{0},{1}{2}'.format(
197 self.eVariable.text(), os.linesep, istring) 197 self.eVariable.text(), os.linesep, istring)
198 code += '{0:d}, {1}){2}'.format( 198 code += '{0:d}, {1}){2}'.format(
199 self.sCurrentItem.value(), self.cEditable.isChecked(), estring) 199 self.sCurrentItem.value(), self.cEditable.isChecked(), estring)

eric ide

mercurial