feat: Add window title configuration and update related components and tests
This commit is contained in:
parent
c621e63a8d
commit
8e97f85c64
8 changed files with 13 additions and 1 deletions
|
|
@ -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,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue