mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 09:59:41 +02:00
feat: add image opacity, config migration, settings
Add image overlay opacity support and related UI/settings, plus robust config migration and error handling. Key changes: - UI: image overlay now uses QGraphicsOpacityEffect, hides when disabled, and updates opacity on state changes (src/interface/dialogs/image.py). - New NotificationPopup dialog for user alerts (src/interface/dialogs/notificationpopup.py). - Settings dialog: added Image Opacity control, adjusted labels, persist/rollback behavior on cancel, and include opacity when saving (src/interface/dialogs/settings.py). - State: added properties for image_opacity and image_enabled with change notifications; renamed image_width setter param for clarity (src/utils/data/state.py). - Config: switch from config.yml to config.ini, implement one-time migration, typed read/write of values, validation/error handling, automatic backups of corrupted files and user notification (src/utils/config/config.py). - Settings save: accept and persist image_opacity (src/utils/config/settings.py). - Startup: initialize QApplication earlier and pass app to run_gui (src/main.py). - Minor: removed an extra blank line in log handler and small import cleanups. These changes enable adjustable overlay transparency, improve config reliability, and surface errors to users while preserving/backuping old configs.
This commit is contained in:
+7
-4
@@ -20,8 +20,7 @@ import signal
|
||||
import time
|
||||
import sys
|
||||
|
||||
def run_gui():
|
||||
app = QtWidgets.QApplication.instance() or QtWidgets.QApplication(sys.argv)
|
||||
def run_gui(app):
|
||||
qdarktheme.setup_theme("auto")
|
||||
widget = MainWindow()
|
||||
|
||||
@@ -42,7 +41,11 @@ def keyboardinterrupthandler(signum, frame):
|
||||
def main():
|
||||
# Begin counting startup time
|
||||
start_time = time.perf_counter()
|
||||
# Parse saved files
|
||||
|
||||
# Initialize UI Engine
|
||||
app = QtWidgets.QApplication.instance() or QtWidgets.QApplication(sys.argv)
|
||||
|
||||
# Parse saved files
|
||||
read_config()
|
||||
logs = get_download_logs()
|
||||
_, downloads = split_data(logs)
|
||||
@@ -65,7 +68,7 @@ def main():
|
||||
elapsed = time.perf_counter() - start_time
|
||||
consoleLog(f"Initialization completed in {elapsed:.2f}s. Launching GUI")
|
||||
# Launch GUI
|
||||
run_gui()
|
||||
run_gui(app)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user