Add loading splash screen for app startup
**Splash Screen Features:** - Shows "Local Transcription" branding during startup - Displays progress messages as app initializes - Prevents users from clicking multiple times while loading - Clean dark theme matching app design **Implementation:** - Created splash screen with custom pixmap drawing - Updates messages during initialization phases: - "Loading configuration..." - "Creating user interface..." - "Starting web server..." - "Loading Whisper model..." - Automatically closes when main window is ready - Always stays on top to remain visible **Benefits:** - Better user experience during model loading (2-5 seconds) - Prevents multiple app instances from confusion - Professional appearance - Clear feedback that app is starting 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -71,10 +71,13 @@ class ModelLoaderThread(QThread):
|
||||
class MainWindow(QMainWindow):
|
||||
"""Main application window using PySide6."""
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, splash_screen=None):
|
||||
"""Initialize the main window."""
|
||||
super().__init__()
|
||||
|
||||
# Store splash screen reference
|
||||
self.splash_screen = splash_screen
|
||||
|
||||
# Application state
|
||||
self.is_transcribing = False
|
||||
self.config = Config()
|
||||
@@ -101,14 +104,32 @@ class MainWindow(QMainWindow):
|
||||
self.setWindowTitle("Local Transcription")
|
||||
self.resize(900, 700)
|
||||
|
||||
# Update splash
|
||||
self._update_splash("Creating user interface...")
|
||||
|
||||
# Create UI
|
||||
self._create_widgets()
|
||||
|
||||
# Update splash
|
||||
self._update_splash("Starting web server...")
|
||||
|
||||
# Start web server if enabled
|
||||
self._start_web_server_if_enabled()
|
||||
|
||||
# Update splash
|
||||
self._update_splash("Loading Whisper model...")
|
||||
|
||||
# Initialize components (in background)
|
||||
self._initialize_components()
|
||||
|
||||
# Start web server if enabled
|
||||
self._start_web_server_if_enabled()
|
||||
def _update_splash(self, message: str):
|
||||
"""Update splash screen message if it exists."""
|
||||
if self.splash_screen:
|
||||
from PySide6.QtCore import Qt
|
||||
from PySide6.QtGui import QColor
|
||||
from PySide6.QtWidgets import QApplication
|
||||
self.splash_screen.showMessage(message, Qt.AlignBottom | Qt.AlignCenter, QColor("#888888"))
|
||||
QApplication.processEvents()
|
||||
|
||||
def _create_widgets(self):
|
||||
"""Create all UI widgets."""
|
||||
|
||||
Reference in New Issue
Block a user