refactor: Restructure GUI components into separate modules for improved maintainability

This commit is contained in:
Warry
2025-12-04 12:03:31 +01:00
parent 428d34056b
commit 75868b32d0
23 changed files with 1901 additions and 1791 deletions
+31
View File
@@ -0,0 +1,31 @@
"""Progress bars mixin for MainWindow.
Handles progress bar updates and formatting.
"""
import math
class ProgressMixin:
"""Mixin containing progress bar management methods."""
def on_progress_reset(self):
"""Reset progress bars to zero."""
self.pb_list.setValue(0)
self.pb_item.setValue(0)
def on_progress_list(self, value: float) -> None:
"""Update the progress of the list progress bar."""
self.pb_list.setValue(int(math.ceil(value)))
def on_progress_item(self, value: float) -> None:
"""Update the progress of the item progress bar."""
self.pb_item.setValue(int(math.ceil(value)))
def on_progress_item_name(self, value: str) -> None:
"""Set the format of the item progress bar."""
self.pb_item.setFormat(f"%p% {value}")
def on_progress_list_name(self, value: str) -> None:
"""Set the format of the list progress bar."""
self.pb_list.setFormat(f"%p% {value}")