Skip to content

Commit d2427d3

Browse files
committed
small fixes
1 parent 4bb3f4c commit d2427d3

File tree

3 files changed

+24
-12
lines changed

3 files changed

+24
-12
lines changed

src/switchcraft/gui_modern/views/packaging_wizard_view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ def _run_autopilot(self, e):
860860
ft.Text("Please wait, performing magic...", key="status_txt")
861861
], height=100, tight=True),
862862
modal=True,
863-
on_dismiss=lambda e: print("Autopilot finished")
863+
on_dismiss=lambda e: logger.debug("Autopilot finished")
864864
)
865865
if hasattr(self.app_page, "open"):
866866
self.app_page.open(self.autopilot_dlg)

src/switchcraft/gui_modern/views/settings_view.py

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -812,17 +812,28 @@ def _show_permission_dialog(self, callback):
812812
self._show_snack("Preparing GitHub Permissions...", "BLUE")
813813

814814
def proceed(e):
815-
logger.debug("User clicked 'Continue'")
816-
if hasattr(dlg, "open"):
817-
dlg.open = False
818-
self.app_page.update()
819-
callback(None)
815+
try:
816+
logger.info("User clicked 'Continue' in permission dialog [INSTRUMENTED]")
817+
self._close_dialog(dlg)
818+
819+
# Check page before update to avoid ghosts
820+
if self.app_page:
821+
self.app_page.update()
822+
823+
logger.info("Calling callback from permission dialog...")
824+
callback(e) # Pass event 'e' instead of None, though _start_github_login handles None too
825+
except Exception as ex:
826+
logger.exception(f"Critical error in proceed handler: {ex}")
827+
self._show_snack(f"Error continuing: {ex}", "RED")
820828

821829
def cancel(e):
822-
logger.debug("User clicked 'Cancel' in permission dialog")
823-
if hasattr(dlg, "open"):
824-
dlg.open = False
825-
self.app_page.update()
830+
try:
831+
logger.info("User clicked 'Cancel' in permission dialog [INSTRUMENTED]")
832+
self._close_dialog(dlg)
833+
if self.app_page:
834+
self.app_page.update()
835+
except Exception as ex:
836+
logger.error(f"Error in cancel handler: {ex}")
826837

827838
explanation = i18n.get("github_permissions_explanation") or (
828839
"SwitchCraft requests the following GitHub permissions:\n\n"
@@ -833,6 +844,7 @@ def cancel(e):
833844
)
834845

835846
dlg = ft.AlertDialog(
847+
modal=True, # Force user interaction
836848
title=ft.Text(i18n.get("github_permissions_title") or "GitHub Permissions"),
837849
content=ft.Column([
838850
ft.Text(explanation),

switchcraft.iss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ Source: "src\switchcraft\assets\switchcraft_logo.png"; DestDir: "{app}"; Flags:
9494

9595
[Icons]
9696
; Start Menu
97-
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Comment: "{#MyAppDescription}"
97+
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Comment: "{#MyAppDescription}"; AppUserModelID: "FaserF.SwitchCraft.Modern.Release"
9898
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
9999

100100
; Desktop (optional)
101-
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon; Comment: "{#MyAppDescription}"
101+
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon; Comment: "{#MyAppDescription}"; AppUserModelID: "FaserF.SwitchCraft.Modern.Release"
102102

103103
[Registry]
104104
; Add to Add/Remove Programs with additional info

0 commit comments

Comments
 (0)