3131from PySide6 .QtCore import QDir
3232from PySide6 .QtWidgets import QFileDialog , QInputDialog
3333
34- from engine_sdk import CompilerEngine , compute_auto_for_engine , engine_register
34+ from engine_sdk import (
35+ CompilerEngine ,
36+ add_form_checkbox ,
37+ add_icon_selector ,
38+ add_output_dir ,
39+ compute_auto_for_engine ,
40+ engine_register ,
41+ )
3542
3643
3744@engine_register
@@ -222,14 +229,14 @@ def create_tab(self, gui):
222229 form_layout .setSpacing (8 )
223230
224231 # Onefile option
225- self ._opt_onefile = QCheckBox ( "Onefile" )
226- self . _opt_onefile . setObjectName ( " opt_onefile_dynamic")
227- form_layout . addRow ( "Mode:" , self . _opt_onefile )
232+ self ._opt_onefile = add_form_checkbox (
233+ form_layout , "Mode:" , "Onefile" , " opt_onefile_dynamic"
234+ )
228235
229236 # Windowed option
230- self ._opt_windowed = QCheckBox ( "Windowed" )
231- self . _opt_windowed . setObjectName ( " opt_windowed_dynamic")
232- form_layout . addRow ( "Console:" , self . _opt_windowed )
237+ self ._opt_windowed = add_form_checkbox (
238+ form_layout , "Console:" , "Windowed" , " opt_windowed_dynamic"
239+ )
233240
234241 # Noconfirm option
235242 self ._opt_noconfirm = QCheckBox ("Noconfirm" )
@@ -254,13 +261,12 @@ def create_tab(self, gui):
254261 layout .addLayout (form_layout )
255262
256263 # Icon button
257- icon_layout = QHBoxLayout ()
258- self ._btn_select_icon = QPushButton ("🎨 Choisir une icône (.ico)" )
259- self ._btn_select_icon .setObjectName ("btn_select_icon_dynamic" )
260- self ._btn_select_icon .clicked .connect (self .select_icon )
261- icon_layout .addWidget (self ._btn_select_icon )
262- icon_layout .addStretch ()
263- layout .addLayout (icon_layout )
264+ self ._btn_select_icon = add_icon_selector (
265+ layout ,
266+ "🎨 Choisir une icône (.ico)" ,
267+ self .select_icon ,
268+ "btn_select_icon_dynamic" ,
269+ )
264270
265271 # Debug option
266272 self ._opt_debug = QCheckBox ("Mode debug (--debug)" )
@@ -274,14 +280,11 @@ def create_tab(self, gui):
274280 layout .addWidget (self ._pyinstaller_add_data )
275281
276282 # Output directory
277- output_layout = QHBoxLayout ()
278- self ._output_dir_input = QLineEdit ()
279- self ._output_dir_input .setObjectName ("output_dir_input_dynamic" )
280- self ._output_dir_input .setPlaceholderText (
281- "Dossier de sortie (--distpath). Laisser vide pour ./dist"
283+ self ._output_dir_input = add_output_dir (
284+ layout ,
285+ "Dossier de sortie (--distpath). Laisser vide pour ./dist" ,
286+ "output_dir_input_dynamic" ,
282287 )
283- output_layout .addWidget (self ._output_dir_input )
284- layout .addLayout (output_layout )
285288
286289 layout .addStretch ()
287290
0 commit comments