Skip to content

Commit ade0d36

Browse files
committed
Update 1.7.2
Final fixes
1 parent f819797 commit ade0d36

File tree

4 files changed

+88
-20
lines changed

4 files changed

+88
-20
lines changed

main.py

+16-18
Original file line numberDiff line numberDiff line change
@@ -26,34 +26,32 @@
2626
def reload_config():
2727
port = 5000
2828
black_theme = "true"
29-
open_in_default_browser = "true"
29+
open_in_integrated_browser = "true"
3030
language = "en_US"
3131

3232
if os.path.exists("config.json"):
3333
with open('config.json', encoding="utf-8") as f:
3434
config = json.load(f)
3535
settings = config.get('settings', {})
3636
integrated_browser_key = 'open-settings-in-integrated-browser'
37-
if integrated_browser_key not in settings:
38-
browser_key = 'open-settings-in-browser'
39-
40-
if browser_key in config['settings']:
41-
open_in_default_browser = settings.get(browser_key, 'false') == 'true'
42-
settings[integrated_browser_key] = 'false' if open_in_default_browser else 'true'
43-
settings.pop(browser_key, None)
44-
else:
45-
config['settings'][integrated_browser_key] = 'false'
37+
browser_key = 'open-settings-in-browser'
38+
39+
if browser_key in config['settings']:
40+
settings[integrated_browser_key] = 'false' if open_in_integrated_browser else 'true'
41+
settings.pop(browser_key, None)
4642

47-
with open('config.json', 'w', encoding="utf-8") as json_file:
48-
json.dump(config, json_file, indent=4)
43+
open_in_integrated_browser = settings.get(integrated_browser_key, 'false') == 'true'
44+
print(open_in_integrated_browser)
45+
with open('config.json', 'w', encoding="utf-8") as json_file:
46+
json.dump(config, json_file, indent=4)
4947

5048
port = config['url']['port']
5149
black_theme = config['front']['black-theme']
5250
language = config['settings']['language']
5351

54-
return port, black_theme, language, open_in_default_browser
52+
return port, black_theme, language, open_in_integrated_browser
5553

56-
port, black_theme, language, open_in_default_browser = reload_config()
54+
port, black_theme, language, open_in_integrated_browser = reload_config()
5755

5856
wmi = win32com.client.GetObject("winmgmts:")
5957
processes = wmi.InstancesOf("Win32_Process")
@@ -186,16 +184,16 @@ def get_local_ip():
186184
local_ip = get_local_ip()
187185

188186
def open_config():
189-
port, black_theme, language, open_in_default_browser = reload_config()
190-
if open_in_default_browser.lower() == 'true':
191-
webbrowser.open(f"http://{local_ip}:{port}?config=show")
192-
else:
187+
port, black_theme, language, open_in_integrated_browser = reload_config()
188+
if open_in_integrated_browser == True:
193189
webview.create_window('WebDeck Config', url=f'http://{local_ip}:{port}?config=show', background_color='#141414')
194190
webview.start()
195191
foreground_window = win32gui.GetForegroundWindow()
196192
window_title = win32gui.GetWindowText(foreground_window)
197193
if "webdeck" in window_title.lower():
198194
win32gui.ShowWindow(foreground_window, win32con.SW_MAXIMIZE)
195+
else:
196+
webbrowser.open(f"http://{local_ip}:{port}?config=show")
199197

200198
def close_window(event=None):
201199
global window

main_server.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2172,7 +2172,7 @@ def fix_firewall_permission():
21722172
]
21732173
subprocess.run(command)
21742174

2175-
if config['settings']['automatic-firewall-bypass'] == 'false' and check_firewall_permission() == False:
2175+
if config['settings']['automatic-firewall-bypass'] == 'true' and check_firewall_permission() == False:
21762176
fix_firewall_permission()
21772177

21782178
app.run(host=local_ip, port=config['url']['port'],

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141

4242
exclude_folders = [
43-
'!buttons', 'addons', '.git', '.github', '.vscode', '__pycache__', 'build',
43+
'!buttons', 'addons', '.git', '.github', '.vscode', '__pycache__', 'build', 'requirements.txt',
4444
'webdeck', '%.html%WebDeck', 'testmic', 'build.bat',
4545
'WD_main.exe', 'WebDeck.exe', 'WD_updater.exe'
4646
]

static/files/version.json

+70
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,75 @@
11
{
22
"versions": [
3+
{
4+
"version": "1.7.2",
5+
"release_date": {
6+
"day": "23",
7+
"month": "01",
8+
"year": "2024",
9+
"hour": "21",
10+
"minute": "55"
11+
},
12+
"en": {
13+
"updates": [
14+
"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/*",
15+
"Added the option to disable the soundboard"
16+
],
17+
"minor_enhancements": [
18+
"Added a reconnection screen in case the server becomes inaccessible",
19+
"Added a button in the settings to easily authorize the application through the Windows firewall",
20+
"Increased the hitbox size for closing menus",
21+
"SVG files are now loaded during the loading process, preventing display issues"
22+
],
23+
"fixes": [
24+
"Fixed the 'Open' button; it is now possible to create new ones easily",
25+
"Fix: No need to restart the application when changing the OBS password",
26+
"Fix: No need to restart the application when changing the dedicated browser settings",
27+
"Fix: Configuration no longer closes when pressing 'c' or 'm' in a text field",
28+
"Fixed ability to scroll on mobile in button configuration pages",
29+
"Fixed button image resizing not automatically reverting to 70% after changing the image.",
30+
"Fixed the wallpaper size in the button preview in edit mode",
31+
"Fixed the auto-update that performed the update even if disabled",
32+
"Removed the unnecessary PowerShell window at startup",
33+
"Minor bug fixes"
34+
],
35+
"nobody_cares": [
36+
"Improved code quality",
37+
"Added the 'Automatic Firewall Bypass on Startup' parameter",
38+
"Fixed the 'Quit' button in the tray when launched from Python",
39+
"Fixed default GPU problem (tried, I can't test it atm since I don't have nvidia graphics card)"
40+
]
41+
},
42+
"fr": {
43+
"updates": [
44+
"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/*",
45+
"Ajout du paramètre permettant de désactiver la soundboard"
46+
],
47+
"minor_enhancements": [
48+
"Ajout d'un écran de reconnexion si jamais le serveur n'est plus accessible",
49+
"Ajout d'un bouton dans les paramètres pour autoriser l'application via le pare-feu windows facilement",
50+
"Augmentation de la taille de la hitbox pour fermer les menus",
51+
"Les fichiers SVG sont maintenant chargés pendant le chargement, ce qui évite les problèmes d'affichage"
52+
],
53+
"fixes": [
54+
"Correction du bouton 'Ouvrir', il est désormais possible d'en créer de nouveaux facilement",
55+
"Correction : Plus besoin de redémarrer l'application lors du changement du mot de passe OBS",
56+
"Correction : Plus besoin de redémarrer l'application lors du changement du paramètre du navigateur dédié",
57+
"Correction : La configuration ne se ferme plus en appuyant sur 'c' ou 'm' dans un champ de texte",
58+
"Correction: Possibilité de scroller sur mobile dans les pages de configuration de boutons",
59+
"Correction du redimensionnement des images des boutons, qui ne revenait pas automatiquement à 70% après avoir modifié l'image.",
60+
"Correction de la taille du fond d'écran dans l'aperçu des boutons en mode édition",
61+
"Correction de l'auto-update qui effectuait la mise à jour même si désactivé",
62+
"Suppression de la fenêtre PowerShell inutile au démarrage",
63+
"Corrections de bugs mineurs"
64+
],
65+
"nobody_cares": [
66+
"Qualité du code améliorée",
67+
"Ajout du paramètre 'Contournement automatique du pare-feu au démarrage'",
68+
"Réparation du bouton 'Quitter' dans le tray lorsqu'il est lancé depuis Python",
69+
"Correction d'un problème de GPU par défaut (essayé, je ne peux pas le tester mtn j'ai pas de cg nvidia)"
70+
]
71+
}
72+
},
373
{
474
"version": "1.7.1",
575
"release_date": {

0 commit comments

Comments
 (0)