70 def __init__(self, parent=None, buttonsContentList=[], sizeIndex=2, settingsButtonPosition=0):
72 self.setWindowTitle(i18n(
"Workflow Buttons settings"))
75 mainLayout = QVBoxLayout(self)
78 self.
defaultButtonContent = {
"iconMode": 0,
"icon" :
"",
"tooltip":
"",
"toolIndex" : 0,
"presetName" :
"",
"FGColorValues" : {
"model":
"",
"depth":
"",
"components":[],
"profile":
"" },
"BGColorValues" : {
"model":
"",
"depth":
"",
"components":[],
"profile":
"" },
"script" :
"" }
87 buttonsScrollArea = QScrollArea(self)
90 buttonsScrollArea.setWidgetResizable(
True)
93 mainLayout.addWidget(buttonsScrollArea)
100 layoutForSelectorControls = QHBoxLayout()
101 controlsSize = QSize(22,22)
104 selectedButtonIDLabelTitle = QLabel(i18n(
"Selected button:"), self)
106 layoutForSelectorControls.addWidget(selectedButtonIDLabelTitle)
109 spacer1 = QWidget(self)
110 spacer1.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
111 layoutForSelectorControls.addWidget(spacer1)
114 addButtonButton = QToolButton(self)
115 addButtonButton.setIconSize(controlsSize)
116 addButtonButton.setIcon(INSTANCE.icon(
'addlayer'))
117 addButtonButton.setToolTip(i18n(
"Add a workflow button"))
119 layoutForSelectorControls.addWidget(addButtonButton)
122 moveButtonLeftButton = QToolButton(self)
123 moveButtonLeftButton.setIconSize(controlsSize)
124 moveButtonLeftButton.setIcon(INSTANCE.icon(
'arrow-left'))
125 moveButtonLeftButton.setToolTip(i18n(
"Move selected workflow button to the left"))
127 layoutForSelectorControls.addWidget(moveButtonLeftButton)
128 moveButtonRightButton = QToolButton(self)
129 moveButtonRightButton.setIconSize(controlsSize)
130 moveButtonRightButton.setIcon(INSTANCE.icon(
'arrow-right'))
131 moveButtonRightButton.setToolTip(i18n(
"Move selected workflow button to the right"))
133 layoutForSelectorControls.addWidget(moveButtonRightButton)
136 deleteButtonButton = QToolButton(self)
137 deleteButtonButton.setIconSize(controlsSize)
138 deleteButtonButton.setIcon(INSTANCE.icon(
'deletelayer'))
139 deleteButtonButton.setToolTip(i18n(
"Delete selected workflow button"))
141 layoutForSelectorControls.addWidget(deleteButtonButton)
142 mainLayout.addLayout(layoutForSelectorControls)
145 layoutForIconMode = QHBoxLayout()
146 iconModeLabel = QLabel(i18n(
"Select icon mode:"), self)
147 layoutForIconMode.addWidget(iconModeLabel)
153 spacer2 = QWidget(self)
154 spacer2.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
155 layoutForIconMode.addWidget(spacer2)
157 mainLayout.addLayout(layoutForIconMode)
160 layoutForIconSelection = QHBoxLayout()
162 addIconLabel = QLabel(i18n(
"Select a custom icon:"), self)
163 layoutForIconSelection.addWidget(addIconLabel)
169 iconPathDialogButton = QPushButton(i18n(
"..."), self)
170 iconPathDialogButton.setToolTip(i18n(
"Select the custom icon"))
172 layoutForIconSelection.addWidget(iconPathDialogButton)
174 mainLayout.addLayout(layoutForIconSelection)
177 layoutForToolTip = QHBoxLayout()
178 toolTipLabel = QLabel(i18n(
"Enter a Tooltip:"), self)
179 layoutForToolTip.addWidget(toolTipLabel)
185 mainLayout.addLayout(layoutForToolTip)
188 layoutForToolSelector = QHBoxLayout()
189 toolSelectorLabel = QLabel(i18n(
"Select a tool:"), self)
190 layoutForToolSelector.addWidget(toolSelectorLabel)
196 spacer3 = QWidget(self)
197 spacer3.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
198 layoutForToolSelector.addWidget(spacer3)
200 mainLayout.addLayout(layoutForToolSelector)
203 layoutForPresetSelector = QHBoxLayout()
204 presetSelectorLabel = QLabel(i18n(
"Select a brush preset:"), self)
205 layoutForPresetSelector.addWidget(presetSelectorLabel)
211 presetDialogButton = QPushButton(i18n(
"..."), self)
212 presetDialogButton.setToolTip(i18n(
"Select the brush preset"))
214 layoutForPresetSelector.addWidget(presetDialogButton)
216 mainLayout.addLayout(layoutForPresetSelector)
219 layoutForFGColorInput = QHBoxLayout()
220 FGColorLabel = QLabel(i18n(
"Select foreground color:"), self)
221 layoutForFGColorInput.addWidget(FGColorLabel)
222 FGColorInputSelector = QPushButton(i18n(
"Load current foreground color"), self)
224 layoutForFGColorInput.addWidget(FGColorInputSelector)
225 FGColorClear = QPushButton(i18n(
"Clear foreground color"), self)
227 layoutForFGColorInput.addWidget(FGColorClear)
229 spacer4 = QWidget(self)
230 spacer4.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
231 layoutForFGColorInput.addWidget(spacer4)
233 mainLayout.addLayout(layoutForFGColorInput)
235 colorInfoToolTip = i18n(
"Color model ; depth ; profile ; components")
237 layoutForFGColorInfo = QHBoxLayout()
244 spacer5 = QWidget(self)
245 spacer5.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
246 layoutForFGColorInfo.addWidget(spacer5)
248 mainLayout.addLayout(layoutForFGColorInfo)
251 layoutForBGColorInput = QHBoxLayout()
252 BGColorLabel = QLabel(i18n(
"Select background color:"), self)
253 layoutForBGColorInput.addWidget(BGColorLabel)
254 BGColorInputSelector = QPushButton(i18n(
"Load current background color"), self)
256 layoutForBGColorInput.addWidget(BGColorInputSelector)
257 BGColorClear = QPushButton(i18n(
"Clear background color"), self)
259 layoutForBGColorInput.addWidget(BGColorClear)
261 spacer6 = QWidget(self)
262 spacer6.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
263 layoutForBGColorInput.addWidget(spacer6)
265 mainLayout.addLayout(layoutForBGColorInput)
267 layoutForBGColorInfo = QHBoxLayout()
274 spacer7 = QWidget(self)
275 spacer7.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
276 layoutForBGColorInfo.addWidget(spacer7)
278 mainLayout.addLayout(layoutForBGColorInfo)
281 layoutForScriptSelection = QHBoxLayout()
283 scriptLabel = QLabel(i18n(
"Select a script file:"), self)
284 layoutForScriptSelection.addWidget(scriptLabel)
290 scriptPathDialogButton = QPushButton(i18n(
"..."), self)
291 scriptPathDialogButton.setToolTip(i18n(
"Select the script"))
293 layoutForScriptSelection.addWidget(scriptPathDialogButton)
295 mainLayout.addLayout(layoutForScriptSelection)
298 spacerLine = QFrame(self)
299 spacerLine.setFrameShape(QFrame.Shape.HLine)
300 spacerLine.setFrameShadow(QFrame.Shadow.Sunken)
301 mainLayout.addWidget(spacerLine)
304 layoutForButtonsSize = QHBoxLayout()
305 buttonsSizeLabel = QLabel(i18n(
"Buttons size:"), self)
310 layoutForButtonsSize.addWidget(buttonsSizeLabel)
313 spacer8 = QWidget(self)
314 spacer8.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
315 layoutForButtonsSize.addWidget(spacer8)
317 mainLayout.addLayout(layoutForButtonsSize)
320 layoutForSettingsButtonOption = QHBoxLayout()
321 settingsButtonOptionLabel = QLabel(i18n(
"Settings button position:"), self)
327 layoutForSettingsButtonOption.addWidget(settingsButtonOptionLabel)
330 spacer9 = QWidget(self)
331 spacer9.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
332 layoutForSettingsButtonOption.addWidget(spacer9)
334 mainLayout.addLayout(layoutForSettingsButtonOption)
337 layoutForBottom = QHBoxLayout()
338 buttonBox = QDialogButtonBox(self)
339 buttonBox.setStandardButtons( QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel)
342 layoutForBottom.addWidget(buttonBox)
343 mainLayout.addLayout(layoutForBottom)
346 self.resize(500, 500)