Skip to content

Commit

Permalink
Update 1.7.2
Browse files Browse the repository at this point in the history
Final fixes
  • Loading branch information
Lenochxd committed Jan 23, 2024
1 parent f819797 commit ade0d36
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 20 deletions.
34 changes: 16 additions & 18 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,32 @@
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"):
with open('config.json', encoding="utf-8") as f:
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")
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion main_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
]
Expand Down
70 changes: 70 additions & 0 deletions static/files/version.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit ade0d36

Please sign in to comment.