eric7/Plugins/WizardPlugins/MessageBoxWizard/MessageBoxWizardDialog.py

branch
eric7
changeset 8322
b422b4e77d19
parent 8318
962bce857696
child 8415
c6236bed1b50
equal deleted inserted replaced
8319:ea11a3948f40 8322:b422b4e77d19
151 if self.rInformation.isChecked(): 151 if self.rInformation.isChecked():
152 QMessageBox.information( 152 QMessageBox.information(
153 self, 153 self,
154 self.eCaption.text(), 154 self.eCaption.text(),
155 self.eMessage.toPlainText(), 155 self.eMessage.toPlainText(),
156 QMessageBox.StandardButtons(buttons), 156 buttons,
157 defaultButton 157 defaultButton
158 ) 158 )
159 elif self.rQuestion.isChecked(): 159 elif self.rQuestion.isChecked():
160 QMessageBox.question( 160 QMessageBox.question(
161 self, 161 self,
162 self.eCaption.text(), 162 self.eCaption.text(),
163 self.eMessage.toPlainText(), 163 self.eMessage.toPlainText(),
164 QMessageBox.StandardButtons(buttons), 164 buttons,
165 defaultButton 165 defaultButton
166 ) 166 )
167 elif self.rWarning.isChecked(): 167 elif self.rWarning.isChecked():
168 QMessageBox.warning( 168 QMessageBox.warning(
169 self, 169 self,
170 self.eCaption.text(), 170 self.eCaption.text(),
171 self.eMessage.toPlainText(), 171 self.eMessage.toPlainText(),
172 QMessageBox.StandardButtons(buttons), 172 buttons,
173 defaultButton 173 defaultButton
174 ) 174 )
175 elif self.rCritical.isChecked(): 175 elif self.rCritical.isChecked():
176 QMessageBox.critical( 176 QMessageBox.critical(
177 self, 177 self,
178 self.eCaption.text(), 178 self.eCaption.text(),
179 self.eMessage.toPlainText(), 179 self.eMessage.toPlainText(),
180 QMessageBox.StandardButtons(buttons), 180 buttons,
181 defaultButton 181 defaultButton
182 ) 182 )
183 183
184 def on_buttonBox_clicked(self, button): 184 def on_buttonBox_clicked(self, button):
185 """ 185 """
284 if len(buttons) == 0: 284 if len(buttons) == 0:
285 return "" 285 return ""
286 286
287 istring2 = istring + indString 287 istring2 = istring + indString
288 joinstring = ' |{0}{1}'.format(os.linesep, istring2) 288 joinstring = ' |{0}{1}'.format(os.linesep, istring2)
289 btnCode = ',{0}{1}QMessageBox.StandardButtons('.format( 289 btnCode = ',{0}{1}('.format(
290 os.linesep, istring) 290 os.linesep, istring)
291 btnCode += '{0}{1}{2})'.format( 291 btnCode += '{0}{1}{2})'.format(
292 os.linesep, istring2, joinstring.join(buttons)) 292 os.linesep, istring2, joinstring.join(buttons))
293 defaultIndex = self.defaultCombo.currentIndex() 293 defaultIndex = self.defaultCombo.currentIndex()
294 if defaultIndex: 294 if defaultIndex:

eric ide

mercurial