Plugins/WizardPlugins/ColorDialogWizard/ColorDialogWizardDialog.py

Tue, 09 Oct 2012 19:28:59 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 09 Oct 2012 19:28:59 +0200
changeset 2128
bf80601e12d3
parent 1509
c0b5e693b0eb
child 2302
f29e9405c851
permissions
-rw-r--r--

Removed obsolete functionality from Color Dialog Wizard and corrected an issue.

0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
1509
c0b5e693b0eb Updated copyright for 2012.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1131
diff changeset
3 # Copyright (c) 2003 - 2012 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the color dialog wizard dialog.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10 import os
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11
2128
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
12 from PyQt4.QtCore import pyqtSlot
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
13 from PyQt4.QtGui import QColor, QColorDialog, QDialog, QDialogButtonBox
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
537
72b32daeb8d6 Continued replacing QMessageBox methods with own methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 446
diff changeset
15 from E5Gui import E5MessageBox
72b32daeb8d6 Continued replacing QMessageBox methods with own methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 446
diff changeset
16
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
17 from .Ui_ColorDialogWizardDialog import Ui_ColorDialogWizardDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
19
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 class ColorDialogWizardDialog(QDialog, Ui_ColorDialogWizardDialog):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 Class implementing the color dialog wizard dialog.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 It displays a dialog for entering the parameters
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 for the QColorDialog code generator.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 def __init__(self, parent=None):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 @param parent parent widget (QWidget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 """
1131
7781e396c903 Changed the code to use super() to access the superclass.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1112
diff changeset
33 super().__init__(parent)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 self.setupUi(self)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 self.bTest = \
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 self.buttonBox.addButton(self.trUtf8("Test"), QDialogButtonBox.ActionRole)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 def on_buttonBox_clicked(self, button):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 Private slot called by a button of the button box clicked.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 @param button button that was clicked (QAbstractButton)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 if button == self.bTest:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 self.on_bTest_clicked()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 @pyqtSlot()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 def on_bTest_clicked(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 Private method to test the selected options.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 if self.rColor.isChecked():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 if not self.eColor.currentText():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 QColorDialog.getColor()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 coStr = self.eColor.currentText()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 if coStr.startswith('#'):
425
ca5e65413fc5 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 42
diff changeset
59 coStr = "QColor('{0}')".format(coStr)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 else:
425
ca5e65413fc5 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 42
diff changeset
61 coStr = "QColor({0})".format(coStr)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 try:
2128
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
63 exec('from PyQt4.QtCore import Qt;'
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
64 ' QColorDialog.getColor({0}, None, "{1}")'.format(
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
65 coStr, self.eTitle.text()))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 except:
537
72b32daeb8d6 Continued replacing QMessageBox methods with own methods.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 446
diff changeset
67 E5MessageBox.critical(self,
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 self.trUtf8("QColorDialog Wizard Error"),
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 self.trUtf8("""<p>The colour <b>{0}</b> is not valid.</p>""")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 .format(coStr))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 elif self.rRGBA.isChecked():
2128
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
73 QColorDialog.getColor(
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
74 QColor(self.sRed.value(), self.sGreen.value(),
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
75 self.sBlue.value(), self.sAlpha.value()),
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
76 None, self.eTitle.text(),
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
77 QColorDialog.ColorDialogOptions(QColorDialog.ShowAlphaChannel))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 def on_eRGB_textChanged(self, text):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 Private slot to handle the textChanged signal of eRGB.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 @param text the new text (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 if not text:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 self.sRed.setEnabled(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 self.sGreen.setEnabled(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 self.sBlue.setEnabled(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 self.sAlpha.setEnabled(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 self.bTest.setEnabled(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 self.sRed.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 self.sGreen.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 self.sBlue.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 self.sAlpha.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 self.bTest.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 def on_eColor_editTextChanged(self, text):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 Private slot to handle the editTextChanged signal of eColor.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 @param text the new text (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 if not text or text.startswith('Qt.') or text.startswith('#'):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 self.bTest.setEnabled(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 self.bTest.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 def getCode(self, indLevel, indString):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 Public method to get the source code.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 @param indLevel indentation level (int)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 @param indString string used for indentation (space or tab) (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 @return generated code (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 # calculate our indentation level and the indentation string
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 il = indLevel + 1
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 istring = il * indString
446
69aac6eeba9b Changed the wizards code generation to eliminate not needed backslashes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 425
diff changeset
120 estring = os.linesep + indLevel * indString
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 # now generate the code
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 code = 'QColorDialog.'
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 if self.rColor.isChecked():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 code += 'getColor('
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126 if self.eColor.currentText():
42
23b45a742e17 Fixed a bunch of issues including a workaround for a bug in the Python email package (s. EmailDialog.py).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 13
diff changeset
127 col = self.eColor.currentText()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 if col.startswith('#'):
425
ca5e65413fc5 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 42
diff changeset
129 code += 'QColor("{0}")'.format(col)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 else:
425
ca5e65413fc5 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 42
diff changeset
131 code += 'QColor({0})'.format(col)
2128
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
132 code += ', None,{0}'.format(os.linesep)
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
133 code += '{0}self.trUtf8("{1}"),{2}'.format(
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
134 istring, self.eTitle.text(), os.linesep)
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
135 code += \
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
136 '{0}QColorDialog.ColorDialogOptions(QColorDialog.ShowAlphaChannel)'\
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
137 .format(istring)
446
69aac6eeba9b Changed the wizards code generation to eliminate not needed backslashes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 425
diff changeset
138 code += '){0}'.format(estring)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
139 elif self.rRGBA.isChecked():
2128
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
140 code += 'getColor('
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
141 if not self.eRGB.text():
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
142 code += 'QColor({0:d}, {1:d}, {2:d}, {3:d}),{4}'.format(
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
143 self.sRed.value(), self.sGreen.value(), self.sBlue.value(),
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
144 self.sAlpha.value(), os.linesep)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145 else:
2128
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
146 code += '{0},{1}'.format(self.eRGB.text(), os.linesep)
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
147 code += '{0}None,{1}'.format(istring, os.linesep)
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
148 code += '{0}self.trUtf8("{1}"),{2}'.format(
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
149 istring, self.eTitle.text(), os.linesep)
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
150 code += \
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
151 '{0}QColorDialog.ColorDialogOptions(QColorDialog.ShowAlphaChannel)'\
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
152 .format(istring)
bf80601e12d3 Removed obsolete functionality from Color Dialog Wizard and corrected an issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
153 code += '){0}'.format(estring)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
155 return code

eric ide

mercurial