-
-
Notifications
You must be signed in to change notification settings - Fork 267
Expand file tree
/
Copy pathGhost-Downloader-3.py
More file actions
57 lines (42 loc) · 1.59 KB
/
Ghost-Downloader-3.py
File metadata and controls
57 lines (42 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import os
import sys
from PySide6.QtCore import QStandardPaths
from qfluentwidgets import qconfig
from app.supports.application import SingletonApplication
from app.supports.config import cfg
# import orjson
# sys.modules['json'] = orjson
appLocalDataLocation = QStandardPaths.writableLocation(QStandardPaths.StandardLocation.GenericDataLocation)
qconfig.load(f"{appLocalDataLocation}/GhostDownloader/UserConfig.json", cfg)
if cfg.get(cfg.dpiScale) != 0:
os.environ["QT_ENABLE_HIGHDPI_SCALING"] = "0"
os.environ["QT_SCALE_FACTOR"] = str(cfg.get(cfg.dpiScale))
application = SingletonApplication(sys.argv, "gd3")
# --- Start Program ---
from loguru import logger
import warnings
from PySide6.QtCore import QTranslator
from app.view.windows.main_window import MainWindow
from app.supports.recorder import taskRecorder
# noinspection PyUnresolvedReferences
import app.assets.resources
from app.services.core_service import coreService
from app.services.feature_service import featureService
warnings.warn = logger.warning
# internationalization
locale = cfg.language.value.value
translator = QTranslator()
translator.load(locale, "gd3", ".", ":/i18n")
application.installTranslator(translator)
isSilently = "--silence" in sys.argv
coreService.start()
mainWindow = MainWindow(isSilently)
featureService.loadFeatures(mainWindow)
taskRecorder.load()
mainWindow.taskPage.resumeMemorizedTasks()
mainWindow.syncThemeColor()
if not isSilently:
mainWindow.splashScreen.finish()
application.aboutToQuit.connect(coreService.stop)
application.aboutToQuit.connect(taskRecorder.flush)
sys.exit(application.exec())