@@ -50,17 +50,13 @@ def __init__(self, page: ft.Page):
5050 self .progress_bar = ft .ProgressBar (width = 400 , visible = False )
5151 self .addon_warning = ft .Container (visible = False )
5252
53- # File Picker for Native/Web Support
54- self .file_picker = ft .FilePicker ()
55- self .file_picker .on_result = self ._on_file_picker_result
56- self .file_picker .on_upload = self ._on_file_upload
57-
5853 async def on_drop_click (e ):
59- # Use Flet's FilePicker instead of blocking helper
60- await self .file_picker .pick_files (
61- allow_multiple = False ,
54+ # Use FilePickerHelper (Tkinter) instead of Flet's potentially buggy FilePicker
55+ path = FilePickerHelper .pick_file (
6256 allowed_extensions = ["exe" , "msi" , "ps1" , "bat" , "cmd" , "vbs" , "msp" ]
6357 )
58+ if path :
59+ self .start_analysis (path )
6460
6561 def on_drag_enter (e ):
6662 self .drop_zone .border = ft .Border .all (4 , "BLUE_400" )
@@ -224,8 +220,7 @@ def on_source_tab_change(e):
224220
225221 ]
226222
227- # Add FilePicker to controls (it's invisible but needs to be in the tree)
228- self .controls .append (self .file_picker )
223+ # Add FilePicker removed in favor of FilePickerHelper (Tkinter) logic
229224
230225 self ._check_addon ()
231226
@@ -651,9 +646,9 @@ def _show_results(self, result: AnalysisResult):
651646 )
652647
653648 action_buttons = ft .Row ([
654- ft .FilledButton (content = ft .Row ([ft .Icon (ft .Icons .AUTO_FIX_HIGH ), ft .Text (i18n .get ("btn_auto_deploy" ) or "Auto Deploy (All-in-One)" )], alignment = ft .MainAxisAlignment .CENTER ), style = ft .ButtonStyle (bgcolor = "RED_700" , color = "WHITE" ), on_click = lambda _ : self ._run_all_in_one_flow (result )),
655- ft .FilledButton (content = ft .Row ([ft .Icon (ft .Icons .PLAY_ARROW ), ft .Text (i18n .get ("btn_test_locally" ) or "Test Locally (Admin)" )], alignment = ft .MainAxisAlignment .CENTER ), style = ft .ButtonStyle (bgcolor = "GREEN_700" , color = "WHITE" ), on_click = lambda _ : self ._run_local_test_action (info .file_path , info .install_switches )),
656- ft .FilledButton (content = ft .Row ([ft .Icon (ft .Icons .DESCRIPTION ), ft .Text (i18n .get ("btn_winget_manifest" ) or "Winget Manifest" )], alignment = ft .MainAxisAlignment .CENTER ), on_click = lambda _ : self ._open_manifest_dialog (info )),
649+ ft .FilledButton (content = ft .Row ([ft .Icon (ft .Icons .AUTO_FIX_HIGH ), ft .Text (i18n .get ("btn_auto_deploy" ) or "Auto Deploy (All-in-One)" )], alignment = ft .MainAxisAlignment .CENTER ), style = ft .ButtonStyle (bgcolor = "RED_700" , color = "WHITE" ), on_click = self . _safe_event_handler ( lambda _ : self ._run_all_in_one_flow (result ), "Auto Deploy" )),
650+ ft .FilledButton (content = ft .Row ([ft .Icon (ft .Icons .PLAY_ARROW ), ft .Text (i18n .get ("btn_test_locally" ) or "Test Locally (Admin)" )], alignment = ft .MainAxisAlignment .CENTER ), style = ft .ButtonStyle (bgcolor = "GREEN_700" , color = "WHITE" ), on_click = self . _safe_event_handler ( lambda _ : self ._run_local_test_action (info .file_path , info .install_switches ), "Test Locally" )),
651+ ft .FilledButton (content = ft .Row ([ft .Icon (ft .Icons .DESCRIPTION ), ft .Text (i18n .get ("btn_winget_manifest" ) or "Winget Manifest" )], alignment = ft .MainAxisAlignment .CENTER ), on_click = self . _safe_event_handler ( lambda _ : self ._open_manifest_dialog (info ), "Winget Manifest" )),
657652 ], wrap = True )
658653 self .results_column .controls .append (action_buttons )
659654
@@ -687,9 +682,9 @@ def _show_results(self, result: AnalysisResult):
687682 # 7. Deployment Actions (Intune, IntuneWin)
688683 self .results_column .controls .append (
689684 ft .Row ([
690- ft .FilledButton (content = ft .Row ([ft .Icon (ft .Icons .CODE ), ft .Text (i18n .get ("generate_intune_script" ) or "Generate Intune Script" )], alignment = ft .MainAxisAlignment .CENTER ), on_click = self ._on_click_create_script ),
691- ft .FilledButton (content = ft .Row ([ft .Icon (ft .Icons .INVENTORY ), ft .Text (i18n .get ("btn_create_intunewin" ) or "Create .intunewin" )], alignment = ft .MainAxisAlignment .CENTER ), on_click = self ._on_click_create_intunewin ),
692- ft .FilledButton (content = ft .Row ([ft .Icon (ft .Icons .TERMINAL ), ft .Text (i18n .get ("btn_manual_cmds" ) or "Manual Commands" )], alignment = ft .MainAxisAlignment .CENTER ), on_click = self ._show_manual_cmds ),
685+ ft .FilledButton (content = ft .Row ([ft .Icon (ft .Icons .CODE ), ft .Text (i18n .get ("generate_intune_script" ) or "Generate Intune Script" )], alignment = ft .MainAxisAlignment .CENTER ), on_click = self ._safe_event_handler ( self . _on_click_create_script , "Generate Script" ) ),
686+ ft .FilledButton (content = ft .Row ([ft .Icon (ft .Icons .INVENTORY ), ft .Text (i18n .get ("btn_create_intunewin" ) or "Create .intunewin" )], alignment = ft .MainAxisAlignment .CENTER ), on_click = self ._safe_event_handler ( self . _on_click_create_intunewin , "Create Intunewin" ) ),
687+ ft .FilledButton (content = ft .Row ([ft .Icon (ft .Icons .TERMINAL ), ft .Text (i18n .get ("btn_manual_cmds" ) or "Manual Commands" )], alignment = ft .MainAxisAlignment .CENTER ), on_click = self ._safe_event_handler ( self . _show_manual_cmds , "Manual Commands" ) ),
693688 ], wrap = True )
694689 )
695690
@@ -761,7 +756,7 @@ def _show_results(self, result: AnalysisResult):
761756
762757 # 12. View Detailed Button
763758 self .results_column .controls .append (
764- ft .FilledButton (content = ft .Row ([ft .Icon (ft .Icons .ZOOM_IN ), ft .Text (i18n .get ("view_full_params" ) or "View Detailed Analysis Data" )], alignment = ft .MainAxisAlignment .CENTER ), on_click = lambda _ : self ._show_detailed_parameters (result ))
759+ ft .FilledButton (content = ft .Row ([ft .Icon (ft .Icons .ZOOM_IN ), ft .Text (i18n .get ("view_full_params" ) or "View Detailed Analysis Data" )], alignment = ft .MainAxisAlignment .CENTER ), on_click = self . _safe_event_handler ( lambda _ : self ._show_detailed_parameters (result ), "View Details" ))
765760 )
766761
767762 self .update ()
0 commit comments