diff --git a/main.py b/main.py index 29bf4bd..7e71c1e 100644 --- a/main.py +++ b/main.py @@ -21,26 +21,27 @@ def main() -> int: splash_image_path = paths.get_asset_path(settings_manager.get_config("splash_image")) use_splash = splash_image_path and paths.Path(splash_image_path).exists() - # Créer la fenêtre principale - window: MainWindow = MainWindow() - if use_splash: # Créer et afficher le splash screen splash = SplashScreen(duration=1500) splash.show_splash() - # Connecter le signal finished pour afficher la fenêtre principale et vérifier les mises à jour + # Connecter le signal finished pour créer et afficher la fenêtre principale def show_main_window(): if update_manager.check_for_update(): - return 0 + app.quit() + return + window: MainWindow = MainWindow() window.show() - splash.finished.connect(lambda: show_main_window()) + splash.finished.connect(show_main_window) else: # Pas de splash screen, vérifier les mises à jour puis afficher la fenêtre principale if update_manager.check_for_update(): return 0 + window: MainWindow = MainWindow() window.show() + return app.exec() if __name__ == "__main__":