diff --git a/.env.example b/.env.example index 79feae8..418a2f1 100644 --- a/.env.example +++ b/.env.example @@ -20,3 +20,4 @@ ALLOWED_URLS= # UI WINDOW_WIDTH=1024 WINDOW_HEIGHT=768 +# WINDOW_TITLE= (leave empty to use: "{APP_NAME} v{APP_VERSION}") diff --git a/src/webdrop_bridge/config.py b/src/webdrop_bridge/config.py index 5738f1a..ea0c5a6 100644 --- a/src/webdrop_bridge/config.py +++ b/src/webdrop_bridge/config.py @@ -31,6 +31,7 @@ class Config: webapp_url: URL to load in embedded web application window_width: Initial window width in pixels window_height: Initial window height in pixels + window_title: Main window title (default: "{app_name} v{app_version}") enable_logging: Whether to write logs to file Raises: @@ -46,6 +47,7 @@ class Config: webapp_url: str window_width: int window_height: int + window_title: str enable_logging: bool @classmethod @@ -82,6 +84,9 @@ class Config: webapp_url = os.getenv("WEBAPP_URL", "file:///./webapp/index.html") window_width = int(os.getenv("WINDOW_WIDTH", "1024")) window_height = int(os.getenv("WINDOW_HEIGHT", "768")) + # Window title defaults to app_name + version if not specified + default_title = f"{app_name} v{app_version}" + window_title = os.getenv("WINDOW_TITLE", default_title) enable_logging = os.getenv("ENABLE_LOGGING", "true").lower() == "true" # Validate log level @@ -145,6 +150,7 @@ class Config: webapp_url=webapp_url, window_width=window_width, window_height=window_height, + window_title=window_title, enable_logging=enable_logging, ) diff --git a/src/webdrop_bridge/ui/main_window.py b/src/webdrop_bridge/ui/main_window.py index 1d977e4..207cd58 100644 --- a/src/webdrop_bridge/ui/main_window.py +++ b/src/webdrop_bridge/ui/main_window.py @@ -245,7 +245,7 @@ class MainWindow(QMainWindow): self._is_manual_check = False # Track if this is a manual check (for UI feedback) # Set window properties - self.setWindowTitle(f"{config.app_name} v{config.app_version}") + self.setWindowTitle(config.window_title) self.setGeometry( 100, 100, diff --git a/tests/integration/test_update_flow.py b/tests/integration/test_update_flow.py index e6c640c..f1c52e0 100644 --- a/tests/integration/test_update_flow.py +++ b/tests/integration/test_update_flow.py @@ -24,6 +24,7 @@ def config(tmp_path): webapp_url="file:///./webapp/index.html", window_width=800, window_height=600, + window_title="Test WebDrop v0.0.1", enable_logging=False, ) diff --git a/tests/unit/test_config_manager.py b/tests/unit/test_config_manager.py index 267f1b8..35038d3 100644 --- a/tests/unit/test_config_manager.py +++ b/tests/unit/test_config_manager.py @@ -246,6 +246,7 @@ class TestConfigExporter: webapp_url="http://localhost:8080", window_width=800, window_height=600, + window_title="WebDrop Bridge v1.0.0", enable_logging=True, ) diff --git a/tests/unit/test_main_window.py b/tests/unit/test_main_window.py index b38057e..75216e0 100644 --- a/tests/unit/test_main_window.py +++ b/tests/unit/test_main_window.py @@ -32,6 +32,7 @@ def sample_config(tmp_path): webapp_url=str(webapp_file), window_width=800, window_height=600, + window_title="Test WebDrop v1.0.0", enable_logging=False, ) return config diff --git a/tests/unit/test_settings_dialog.py b/tests/unit/test_settings_dialog.py index ad090f3..332d63d 100644 --- a/tests/unit/test_settings_dialog.py +++ b/tests/unit/test_settings_dialog.py @@ -22,6 +22,7 @@ def sample_config(tmp_path): webapp_url="http://localhost:8080", window_width=800, window_height=600, + window_title="WebDrop Bridge v1.0.0", enable_logging=True, ) diff --git a/tests/unit/test_startup_check.py b/tests/unit/test_startup_check.py index f3e407f..dedeaf1 100644 --- a/tests/unit/test_startup_check.py +++ b/tests/unit/test_startup_check.py @@ -22,6 +22,7 @@ def sample_config(tmp_path): webapp_url="file:///./webapp/index.html", window_width=800, window_height=600, + window_title="Test WebDrop v1.0.0", enable_logging=False, )