mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-03 17:39:42 +02:00
49 lines
1.6 KiB
Python
49 lines
1.6 KiB
Python
from PySide6.QtCore import QObject, Signal
|
|
from PySide6.QtWidgets import QTableWidget
|
|
from typing import Optional, Any, List, Dict
|
|
from pathlib import Path
|
|
|
|
class AppState(QObject):
|
|
image_changed = Signal(str)
|
|
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.posts: List[Dict[str, Any]] = []
|
|
self.post_titles: Optional[List] = None
|
|
self.post_urls: Optional[List] = None
|
|
self.post_author: List[str] = []
|
|
self.post_seeders: List[str] = []
|
|
self.post_leechers: List[str] = []
|
|
self.version: str = "dev"
|
|
self._image_path: str = ""
|
|
self.ignore_updates: bool = False
|
|
self.debug: bool = False
|
|
self.autoresume: bool = True
|
|
self.tracker: str = "rutracker"
|
|
self.tracker_list: dict[str, QTableWidget] = {}
|
|
self.api_url: str = "https://api.michijackson.xyz"
|
|
self.download_path: str = str(Path.home() / "Downloads")
|
|
self.up_speed_limit: int = 0
|
|
self.down_speed_limit: int = 0
|
|
self.max_connections: int = 200
|
|
self.max_downloads: int = 10
|
|
self.settings_path: str = ""
|
|
self.dl_session: Any = None
|
|
self.active_downloads: Dict = {}
|
|
self.window_transparency: bool = False
|
|
self.interfaces: List = []
|
|
self.active_interfaces: List = []
|
|
self.bound_interface: Any = None
|
|
|
|
@property
|
|
def image_path(self) -> str:
|
|
return self._image_path
|
|
|
|
@image_path.setter
|
|
def image_path(self, new_path: str):
|
|
if new_path != self._image_path:
|
|
self._image_path = new_path
|
|
self.image_changed.emit(new_path)
|
|
|
|
state = AppState()
|