Windows support

This commit is contained in:
sarah committed 2026-10-09 14:16:50 +02:00
1 parent f1935a119b
commit 6cb2bd74cc
13 files changed
+207 -25

No files matched your search

+5 -2
View File
@@ -7,7 +7,7 @@ from typing import Callable, Optional
import flet as ft
from Core import AppConfig, ChildEnvironment, ChipButton, Note, NotificationStyle, Palette
from Core import AppConfig, ChildEnvironment, ChipButton, IsWindows, Note, NotificationStyle, Palette
from Service import RestartIfRunning
from Sortd import Setup, SortdError
@@ -69,7 +69,10 @@ class App:
def OpenFolder(self, PathText: str) -> None:
try:
subprocess.Popen(["xdg-open", PathText], env=ChildEnvironment(), start_new_session=True)
if IsWindows:
os.startfile(PathText) # Explorer
else:
subprocess.Popen(["xdg-open", PathText], env=ChildEnvironment(), start_new_session=True)
except OSError as Error:
self.Notify(f"Couldn't open {PathText}: {Error}", "error")