From ade0d36b765d791f901860036b17e04c9f56fca1 Mon Sep 17 00:00:00 2001 From: LeLenoch <81lennoch@gmail.com> Date: Tue, 23 Jan 2024 21:48:06 +0100 Subject: [PATCH] Update 1.7.2 Final fixes --- main.py | 34 +++++++++---------- main_server.py | 2 +- setup.py | 2 +- static/files/version.json | 70 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 88 insertions(+), 20 deletions(-) diff --git a/main.py b/main.py index 030a333..c9440b1 100644 --- a/main.py +++ b/main.py @@ -26,7 +26,7 @@ def reload_config(): port = 5000 black_theme = "true" - open_in_default_browser = "true" + open_in_integrated_browser = "true" language = "en_US" if os.path.exists("config.json"): @@ -34,26 +34,24 @@ def reload_config(): config = json.load(f) settings = config.get('settings', {}) integrated_browser_key = 'open-settings-in-integrated-browser' - if integrated_browser_key not in settings: - browser_key = 'open-settings-in-browser' - - if browser_key in config['settings']: - open_in_default_browser = settings.get(browser_key, 'false') == 'true' - settings[integrated_browser_key] = 'false' if open_in_default_browser else 'true' - settings.pop(browser_key, None) - else: - config['settings'][integrated_browser_key] = 'false' + browser_key = 'open-settings-in-browser' + + if browser_key in config['settings']: + settings[integrated_browser_key] = 'false' if open_in_integrated_browser else 'true' + settings.pop(browser_key, None) - with open('config.json', 'w', encoding="utf-8") as json_file: - json.dump(config, json_file, indent=4) + open_in_integrated_browser = settings.get(integrated_browser_key, 'false') == 'true' + print(open_in_integrated_browser) + with open('config.json', 'w', encoding="utf-8") as json_file: + json.dump(config, json_file, indent=4) port = config['url']['port'] black_theme = config['front']['black-theme'] language = config['settings']['language'] - return port, black_theme, language, open_in_default_browser + return port, black_theme, language, open_in_integrated_browser -port, black_theme, language, open_in_default_browser = reload_config() +port, black_theme, language, open_in_integrated_browser = reload_config() wmi = win32com.client.GetObject("winmgmts:") processes = wmi.InstancesOf("Win32_Process") @@ -186,16 +184,16 @@ def get_local_ip(): local_ip = get_local_ip() def open_config(): - port, black_theme, language, open_in_default_browser = reload_config() - if open_in_default_browser.lower() == 'true': - webbrowser.open(f"http://{local_ip}:{port}?config=show") - else: + port, black_theme, language, open_in_integrated_browser = reload_config() + if open_in_integrated_browser == True: webview.create_window('WebDeck Config', url=f'http://{local_ip}:{port}?config=show', background_color='#141414') webview.start() foreground_window = win32gui.GetForegroundWindow() window_title = win32gui.GetWindowText(foreground_window) if "webdeck" in window_title.lower(): win32gui.ShowWindow(foreground_window, win32con.SW_MAXIMIZE) + else: + webbrowser.open(f"http://{local_ip}:{port}?config=show") def close_window(event=None): global window diff --git a/main_server.py b/main_server.py index db14fc6..763645e 100644 --- a/main_server.py +++ b/main_server.py @@ -2172,7 +2172,7 @@ def fix_firewall_permission(): ] subprocess.run(command) -if config['settings']['automatic-firewall-bypass'] == 'false' and check_firewall_permission() == False: +if config['settings']['automatic-firewall-bypass'] == 'true' and check_firewall_permission() == False: fix_firewall_permission() app.run(host=local_ip, port=config['url']['port'], diff --git a/setup.py b/setup.py index f00a9c6..76c658c 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ exclude_folders = [ - '!buttons', 'addons', '.git', '.github', '.vscode', '__pycache__', 'build', + '!buttons', 'addons', '.git', '.github', '.vscode', '__pycache__', 'build', 'requirements.txt', 'webdeck', '%.html%WebDeck', 'testmic', 'build.bat', 'WD_main.exe', 'WebDeck.exe', 'WD_updater.exe' ] diff --git a/static/files/version.json b/static/files/version.json index de9a5b1..efeea82 100644 --- a/static/files/version.json +++ b/static/files/version.json @@ -1,5 +1,75 @@ { "versions": [ + { + "version": "1.7.2", + "release_date": { + "day": "23", + "month": "01", + "year": "2024", + "hour": "21", + "minute": "55" + }, + "en": { + "updates": [ + "Introduced a language system with support for French and English. Anyone can now translate to a new language using the .lang files located in static/files/langs/*", + "Added the option to disable the soundboard" + ], + "minor_enhancements": [ + "Added a reconnection screen in case the server becomes inaccessible", + "Added a button in the settings to easily authorize the application through the Windows firewall", + "Increased the hitbox size for closing menus", + "SVG files are now loaded during the loading process, preventing display issues" + ], + "fixes": [ + "Fixed the 'Open' button; it is now possible to create new ones easily", + "Fix: No need to restart the application when changing the OBS password", + "Fix: No need to restart the application when changing the dedicated browser settings", + "Fix: Configuration no longer closes when pressing 'c' or 'm' in a text field", + "Fixed ability to scroll on mobile in button configuration pages", + "Fixed button image resizing not automatically reverting to 70% after changing the image.", + "Fixed the wallpaper size in the button preview in edit mode", + "Fixed the auto-update that performed the update even if disabled", + "Removed the unnecessary PowerShell window at startup", + "Minor bug fixes" + ], + "nobody_cares": [ + "Improved code quality", + "Added the 'Automatic Firewall Bypass on Startup' parameter", + "Fixed the 'Quit' button in the tray when launched from Python", + "Fixed default GPU problem (tried, I can't test it atm since I don't have nvidia graphics card)" + ] + }, + "fr": { + "updates": [ + "Ajout d'un système de langues avec prise en charge du français et de l'anglais. Il est désormais possible à n'importe qui de traduire vers une nouvelle langue en utilisant les fichiers .lang situés dans static/files/langs/*", + "Ajout du paramètre permettant de désactiver la soundboard" + ], + "minor_enhancements": [ + "Ajout d'un écran de reconnexion si jamais le serveur n'est plus accessible", + "Ajout d'un bouton dans les paramètres pour autoriser l'application via le pare-feu windows facilement", + "Augmentation de la taille de la hitbox pour fermer les menus", + "Les fichiers SVG sont maintenant chargés pendant le chargement, ce qui évite les problèmes d'affichage" + ], + "fixes": [ + "Correction du bouton 'Ouvrir', il est désormais possible d'en créer de nouveaux facilement", + "Correction : Plus besoin de redémarrer l'application lors du changement du mot de passe OBS", + "Correction : Plus besoin de redémarrer l'application lors du changement du paramètre du navigateur dédié", + "Correction : La configuration ne se ferme plus en appuyant sur 'c' ou 'm' dans un champ de texte", + "Correction: Possibilité de scroller sur mobile dans les pages de configuration de boutons", + "Correction du redimensionnement des images des boutons, qui ne revenait pas automatiquement à 70% après avoir modifié l'image.", + "Correction de la taille du fond d'écran dans l'aperçu des boutons en mode édition", + "Correction de l'auto-update qui effectuait la mise à jour même si désactivé", + "Suppression de la fenêtre PowerShell inutile au démarrage", + "Corrections de bugs mineurs" + ], + "nobody_cares": [ + "Qualité du code améliorée", + "Ajout du paramètre 'Contournement automatique du pare-feu au démarrage'", + "Réparation du bouton 'Quitter' dans le tray lorsqu'il est lancé depuis Python", + "Correction d'un problème de GPU par défaut (essayé, je ne peux pas le tester mtn j'ai pas de cg nvidia)" + ] + } + }, { "version": "1.7.1", "release_date": {