feat: add application icon and improve path handling for bundled executables
This commit is contained in:
@@ -12,13 +12,15 @@ import webbrowser
|
||||
|
||||
# --- STIHÅNDTERING (Til EXE-brug) ---
|
||||
if getattr(sys, 'frozen', False):
|
||||
# Vi kører som en kompileret .exe
|
||||
base_dir = os.path.dirname(sys.executable)
|
||||
# RESOURCE_DIR er mapper indeni EXE-filen (ikoner, billeder)
|
||||
RESOURCE_DIR = getattr(sys, '_MEIPASS', os.path.dirname(os.path.abspath(__file__)))
|
||||
# CONFIG_DIR er mappen hvor selve .exe filen ligger (settings.json)
|
||||
CONFIG_DIR = os.path.dirname(sys.executable)
|
||||
else:
|
||||
# Vi kører som normalt script
|
||||
base_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
RESOURCE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
CONFIG_DIR = RESOURCE_DIR
|
||||
|
||||
SETTINGS_FILE = os.path.join(base_dir, 'settings.json')
|
||||
SETTINGS_FILE = os.path.join(CONFIG_DIR, 'settings.json')
|
||||
|
||||
def load_settings():
|
||||
default_settings = {
|
||||
@@ -278,6 +280,10 @@ class SharePointApp(wx.Frame):
|
||||
self.Show()
|
||||
self.Bind(wx.EVT_CLOSE, self.on_close_window)
|
||||
|
||||
# SÆT VINDUESIKON (øverste venstre hjørne)
|
||||
icon_path = os.path.join(RESOURCE_DIR, "icon.ico")
|
||||
if os.path.exists(icon_path):
|
||||
self.SetIcon(wx.Icon(icon_path, wx.BITMAP_TYPE_ICO))
|
||||
def get_txt(self, key, **kwargs):
|
||||
text = STRINGS[self.lang].get(key, key)
|
||||
if kwargs:
|
||||
|
||||
Reference in New Issue
Block a user