macOS support (code only, no build yet)

This commit is contained in:
sarah committed 2026-10-14 13:18:20 +02:00
1 parent 1feb6d4336
commit ca04dcd4a7
17 files changed
+572 -126

No files matched your search

+6 -5
View File
@@ -14,7 +14,7 @@ import flet as ft
import SelfUpdate
from Catalog import UpdateCatalog
from Core import (
AppName, AppVersion, IsWindows, StartMenuDir, ApplyAppearance, AssetsDir, BuildTheme, BundledFontFamily, ChipButtonStyle, DataDir,
AppName, AppVersion, IsLinux, IsMac, IsWindows, StartMenuDir, ApplyAppearance, AssetsDir, BuildTheme, BundledFontFamily, ChipButtonStyle, DataDir,
BundledManifestsDir, DataHome, EffectiveSettings, LoadConfig, Palette,
)
from Dialogs import ShowInstallDialog, ShowOptionsDialog, ShowRemoveDialog, ShowUpdateDialog
@@ -26,7 +26,8 @@ from Settings import ShowSettingsDialog
_MaxLogLines = 2000
# When running packaged (AppImage / .exe), SaraSuite can put itself in the
# app menu: a desktop entry on Linux, a Start Menu shortcut on Windows.
# app menu: a desktop entry on Linux, a Start Menu shortcut on Windows. On
# macOS SaraSuite.app already is an app wherever it's put (e.g. /Applications).
_Packaged = SelfUpdate.RunningAppImage()
_AppImage = str(_Packaged) if _Packaged else ""
if IsWindows:
@@ -43,7 +44,7 @@ def _KeepFallbackLibraries() -> None:
~/.local/share/SaraSuite/Libraries, for FletIdentity.py to give the Flet
client of every installed program on systems without it."""
Bundled = Path(getattr(sys, "_MEIPASS", "")) / "FallbackLibs"
if IsWindows or not Bundled.is_dir():
if not IsLinux or not Bundled.is_dir():
return
Kept = DataDir / "Libraries"
try:
@@ -286,7 +287,7 @@ def Main(Page: ft.Page) -> None:
MenuButton = ft.OutlinedButton(
content=f"Remove from {_MenuLabel}" if _MenuEntry.exists() else f"Add to {_MenuLabel}",
style=ChipButtonStyle(),
visible=bool(_AppImage),
visible=bool(_AppImage) and not IsMac,
on_click=ToggleMenuEntry,
)
@@ -355,7 +356,7 @@ if __name__ == "__main__":
sys.exit(Run(sys.argv[1:]))
SelfUpdate.CleanUpOldExe()
if not IsWindows:
if IsLinux:
# A Flet client copy with the window app ID srhtnin.SaraSuite, so the
# desktop matches the window to SaraSuite.desktop (StartupWMClass) instead
# of showing it as "com.appveyor.flet". See Programs/FletIdentity.py.