34 """ |
34 """ |
35 super(ColorDialogWizardDialog, self).__init__(parent) |
35 super(ColorDialogWizardDialog, self).__init__(parent) |
36 self.setupUi(self) |
36 self.setupUi(self) |
37 |
37 |
38 self.bTest = self.buttonBox.addButton( |
38 self.bTest = self.buttonBox.addButton( |
39 self.trUtf8("Test"), QDialogButtonBox.ActionRole) |
39 self.tr("Test"), QDialogButtonBox.ActionRole) |
|
40 |
|
41 msh = self.minimumSizeHint() |
|
42 self.resize(max(self.width(), msh.width()), msh.height()) |
40 |
43 |
41 def on_buttonBox_clicked(self, button): |
44 def on_buttonBox_clicked(self, button): |
42 """ |
45 """ |
43 Private slot called by a button of the button box clicked. |
46 Private slot called by a button of the button box clicked. |
44 |
47 |
66 ' QColorDialog.getColor({0}, None, "{1}")'.format( |
69 ' QColorDialog.getColor({0}, None, "{1}")'.format( |
67 coStr, self.eTitle.text())) |
70 coStr, self.eTitle.text())) |
68 except: |
71 except: |
69 E5MessageBox.critical( |
72 E5MessageBox.critical( |
70 self, |
73 self, |
71 self.trUtf8("QColorDialog Wizard Error"), |
74 self.tr("QColorDialog Wizard Error"), |
72 self.trUtf8( |
75 self.tr( |
73 """<p>The colour <b>{0}</b> is not valid.</p>""") |
76 """<p>The colour <b>{0}</b> is not valid.</p>""") |
74 .format(coStr)) |
77 .format(coStr)) |
75 |
78 |
76 elif self.rRGBA.isChecked(): |
79 elif self.rRGBA.isChecked(): |
77 QColorDialog.getColor( |
80 QColorDialog.getColor( |
148 code += '{0}QColor({1}),{2}'.format( |
151 code += '{0}QColor({1}),{2}'.format( |
149 istring, col, os.linesep) |
152 istring, col, os.linesep) |
150 else: |
153 else: |
151 code += '{0}QColor(Qt.white),{1}'.format(istring, os.linesep) |
154 code += '{0}QColor(Qt.white),{1}'.format(istring, os.linesep) |
152 code += '{0}{1},{2}'.format(istring, parent, os.linesep) |
155 code += '{0}{1},{2}'.format(istring, parent, os.linesep) |
153 code += '{0}self.trUtf8("{1}"),{2}'.format( |
156 code += '{0}self.tr("{1}"),{2}'.format( |
154 istring, self.eTitle.text(), os.linesep) |
157 istring, self.eTitle.text(), os.linesep) |
155 code += '{0}QColorDialog.ColorDialogOptions(' \ |
158 code += '{0}QColorDialog.ColorDialogOptions(' \ |
156 'QColorDialog.ShowAlphaChannel)'.format(istring) |
159 'QColorDialog.ShowAlphaChannel)'.format(istring) |
157 code += '){0}'.format(estring) |
160 code += '){0}'.format(estring) |
158 elif self.rRGBA.isChecked(): |
161 elif self.rRGBA.isChecked(): |
163 self.sBlue.value(), self.sAlpha.value(), os.linesep) |
166 self.sBlue.value(), self.sAlpha.value(), os.linesep) |
164 else: |
167 else: |
165 code += '{0}{1},{2}'.format( |
168 code += '{0}{1},{2}'.format( |
166 istring, self.eRGB.text(), os.linesep) |
169 istring, self.eRGB.text(), os.linesep) |
167 code += '{0}{1},{2}'.format(istring, parent, os.linesep) |
170 code += '{0}{1},{2}'.format(istring, parent, os.linesep) |
168 code += '{0}self.trUtf8("{1}"),{2}'.format( |
171 code += '{0}self.tr("{1}"),{2}'.format( |
169 istring, self.eTitle.text(), os.linesep) |
172 istring, self.eTitle.text(), os.linesep) |
170 code += '{0}QColorDialog.ColorDialogOptions(' \ |
173 code += '{0}QColorDialog.ColorDialogOptions(' \ |
171 'QColorDialog.ShowAlphaChannel)'.format(istring) |
174 'QColorDialog.ShowAlphaChannel)'.format(istring) |
172 code += '){0}'.format(estring) |
175 code += '){0}'.format(estring) |
173 |
176 |