Refactor UI startup and stylesheet handling

Moved the main application stylesheet to a new src/gui/ytsage_stylesheet.py module and applied it via StyleSheet.MAIN. Deferred blocking startup checks (FFmpeg, yt-dlp, Deno, updates) until after the UI is shown to improve responsiveness. Improved subtitle file deletion logic and added destination filename capture in downloader. Added custom style for auto-update checkbox in updater dialog.
This commit is contained in:
oop7
2026-01-24 13:35:02 +02:00
parent 4d4d9e10b9
commit 9759fa565f
5 changed files with 198 additions and 218 deletions
-17
View File
@@ -3,8 +3,6 @@ import sys
from PySide6.QtWidgets import QApplication, QMessageBox
from src.utils.ytsage_logger import logger
from src.core.ytsage_yt_dlp import check_ytdlp_binary, setup_ytdlp # Import the new yt-dlp setup functions
from src.core.ytsage_deno import check_deno_binary, setup_deno # Import the new Deno setup functions
from src.gui.ytsage_gui_main import YTSageApp # Import the main application class from ytsage_gui_main
@@ -22,21 +20,6 @@ def main():
logger.info("Starting YTSage application")
app = QApplication(sys.argv)
# Get the expected binary path and check if it exists
if not check_ytdlp_binary():
# No app-specific binary found, show setup dialog regardless of Python package
logger.warning("No yt-dlp binary found, starting setup process")
yt_dlp_path = setup_ytdlp()
if yt_dlp_path == "yt-dlp": # If user canceled or something went wrong
logger.warning("yt-dlp not configured properly")
# Check for Deno binary
if not check_deno_binary():
logger.warning("No Deno binary found, starting setup process")
deno_path = setup_deno()
if deno_path == "deno": # If user canceled or something went wrong
logger.warning("Deno not configured properly")
window = YTSageApp() # Instantiate the main application class
window.show()
logger.info("Application window shown, entering main loop")