mirror of
https://github.com/xgui4/LCE-Qt-Launcher.git
synced 2026-07-18 02:30:44 +00:00
Refactor application :
Refactor application structure by removing BuildInfo class and integrating its attributes directly into the application context. Update features and views to utilize new string constants for application metadata. Replace UserPref class with a new implementation in pref.py, streamlining user preference management. Enhance instance manager and launcher views to accommodate these changes, ensuring consistent access to application information. Remove deprecated preferences module and adjust related functionality across the codebase.
This commit is contained in:
@@ -2,10 +2,9 @@
|
|||||||
"$schema": "https://raw.githubusercontent.com/xgui4/LCE-Qt-Launcher/refs/heads/nightly/schemas/x-application-lce_inst_config.json",
|
"$schema": "https://raw.githubusercontent.com/xgui4/LCE-Qt-Launcher/refs/heads/nightly/schemas/x-application-lce_inst_config.json",
|
||||||
"name": "aRockefeler Aether Mod",
|
"name": "aRockefeler Aether Mod",
|
||||||
"installation_path": ".lce-aether",
|
"installation_path": ".lce-aether",
|
||||||
"archive_file": "Release",
|
"archive_file": "Release.zip",
|
||||||
"image": ":/aether.png",
|
"image": ":/aether.png",
|
||||||
"exe_name": "Minecraft.Client.exe",
|
"exe_name": "Minecraft.Client.exe",
|
||||||
"url": "https://github.com/Frcoxd/aether-papu",
|
|
||||||
"repo_url": "https://github.com/Frcoxd/aether-papu",
|
"repo_url": "https://github.com/Frcoxd/aether-papu",
|
||||||
"news_feed": "https://github.com/LCE-Hub/LCE-Workshop/tree/main/.00versions/test",
|
"news_feed": "https://github.com/LCE-Hub/LCE-Workshop/tree/main/.00versions/test",
|
||||||
"instance_source": "InstanceSource.GITHUB_RELEASE",
|
"instance_source": "InstanceSource.GITHUB_RELEASE",
|
||||||
|
|||||||
@@ -64,17 +64,14 @@ files = [
|
|||||||
"src/lce_qt_launcher/__init__.py",
|
"src/lce_qt_launcher/__init__.py",
|
||||||
"src/lce_qt_launcher/app.py",
|
"src/lce_qt_launcher/app.py",
|
||||||
"src/lce_qt_launcher/app_context.py",
|
"src/lce_qt_launcher/app_context.py",
|
||||||
"src/lce_qt_launcher/downloader.py",
|
|
||||||
"src/lce_qt_launcher/features.py",
|
"src/lce_qt_launcher/features.py",
|
||||||
"src/lce_qt_launcher/views/__init__.py",
|
"src/lce_qt_launcher/views/__init__.py",
|
||||||
"src/lce_qt_launcher/views/cmd_args.py",
|
"src/lce_qt_launcher/views/cmd_args.py",
|
||||||
"src/lce_qt_launcher/views/launcher.py",
|
|
||||||
"src/lce_qt_launcher/views/setting_dialog.py",
|
"src/lce_qt_launcher/views/setting_dialog.py",
|
||||||
"src/lce_qt_launcher/views/browser_dialog.py",
|
"src/lce_qt_launcher/views/browser_dialog.py",
|
||||||
"src/lce_qt_launcher/views/term_service.py",
|
"src/lce_qt_launcher/views/term_service.py",
|
||||||
"src/lce_qt_launcher/views/cli.py",
|
"src/lce_qt_launcher/views/cli.py",
|
||||||
"src/lce_qt_launcher/views/launcher.py",
|
"src/lce_qt_launcher/views/launcher.py",
|
||||||
"src/lce_qt_launcher/views/launcher.py",
|
|
||||||
"src/lce_qt_launcher/views/app_data.py",
|
"src/lce_qt_launcher/views/app_data.py",
|
||||||
"src/lce_qt_launcher/managers/__init__.py",
|
"src/lce_qt_launcher/managers/__init__.py",
|
||||||
"src/lce_qt_launcher/managers/instance.py",
|
"src/lce_qt_launcher/managers/instance.py",
|
||||||
@@ -85,7 +82,7 @@ files = [
|
|||||||
"src/lce_qt_launcher/managers/skin_manager.py",
|
"src/lce_qt_launcher/managers/skin_manager.py",
|
||||||
"src/lce_qt_launcher/managers/display_manager.py",
|
"src/lce_qt_launcher/managers/display_manager.py",
|
||||||
"src/lce_qt_launcher/models/__init__.py",
|
"src/lce_qt_launcher/models/__init__.py",
|
||||||
"src/lce_qt_launcher/models/preferences.py",
|
"src/lce_qt_launcher/models/pref.py",
|
||||||
"src/lce_qt_launcher/models/theme.py",
|
"src/lce_qt_launcher/models/theme.py",
|
||||||
"src/lce_qt_launcher/utils/__init__.py",
|
"src/lce_qt_launcher/utils/__init__.py",
|
||||||
"src/lce_qt_launcher/utils/json_trans.py",
|
"src/lce_qt_launcher/utils/json_trans.py",
|
||||||
|
|||||||
@@ -1,25 +1,56 @@
|
|||||||
from enum import StrEnum
|
from importlib.metadata import PackageNotFoundError, metadata, version
|
||||||
|
from importlib.metadata._meta import PackageMetadata
|
||||||
|
|
||||||
FALLBACK_APP_NAME = "LCE Qt Launcher"
|
from PySide6.QtCore import qVersion
|
||||||
FALLBACK_VERSION_NUMBER = "0.0.20b0"
|
|
||||||
FALLBACK_LICENSE = "GPLv3"
|
|
||||||
FALLBACK_LICENSE_LINK = "https://www.gnu.org/licenses/gpl-3.0"
|
|
||||||
FALLBACK_GIT_REPO_URL = "https://github.com/xgui4/LCE-QT-Launcher"
|
|
||||||
|
|
||||||
VERSION_TYPE = "alpha"
|
_FALLBACK_APP_NAME = "LCE Qt Launcher"
|
||||||
INSTANCE_EXTENSION = ".lce_inst"
|
_FALLBACK_VERSION = "0.0.20b0"
|
||||||
AUTHORS = "Xgui4"
|
_FALLBACK_LICENSE = "GPLv3"
|
||||||
|
_FALLBACK_LICENSE_LINK = "https://www.gnu.org/licenses/gpl-3.0"
|
||||||
|
_FALLBACK_GIT_REPO_URL = "https://github.com/xgui4/LCE-QT-Launcher"
|
||||||
|
|
||||||
|
_VERSION_TYPE : str = "alpha"
|
||||||
|
_INSTANCE_EXTENSION : str = ".lce_inst"
|
||||||
|
_AUTHORS : str = "Xgui4"
|
||||||
|
|
||||||
class Languages(StrEnum):
|
app_name_str : str = _FALLBACK_APP_NAME
|
||||||
"""_summary_ : "Language Codes for JsonTrans"""
|
version_str : str = _FALLBACK_VERSION
|
||||||
|
licence_name_str : str = _FALLBACK_LICENSE
|
||||||
|
license_link_str : str = _FALLBACK_LICENSE_LINK
|
||||||
|
git_repo_url_str : str = _FALLBACK_GIT_REPO_URL
|
||||||
|
|
||||||
FALLBACK = "translations.json"
|
try:
|
||||||
ENGLISH = "en"
|
app_metadata: PackageMetadata = metadata("LCE-Qt-Launcher")
|
||||||
FRENCH = "fr"
|
|
||||||
|
|
||||||
|
_version_temp: str = version("LCE-Qt-Launcher")
|
||||||
|
_app_name_temp: str = app_metadata["Name"]
|
||||||
|
_repo_url_temp: str = app_metadata["Repository"]
|
||||||
|
_license_url_temp: str = app_metadata["LicenseURL"]
|
||||||
|
_license_temp: str = app_metadata["License"]
|
||||||
|
|
||||||
license_str = r"""
|
if _version_temp:
|
||||||
|
version_str = _version_temp
|
||||||
|
if _app_name_temp:
|
||||||
|
app_name_str = _app_name_temp
|
||||||
|
if _repo_url_temp:
|
||||||
|
git_repo_url_str = _repo_url_temp
|
||||||
|
if _license_url_temp:
|
||||||
|
license_link_str = _license_url_temp
|
||||||
|
if _license_temp:
|
||||||
|
license_text_str = _license_temp
|
||||||
|
|
||||||
|
except PackageNotFoundError as e:
|
||||||
|
print(f"Error : Package not found! More info : {e.msg}")
|
||||||
|
except RuntimeError as e:
|
||||||
|
print(f"Error : Metadata not found! More info : {e}")
|
||||||
|
except KeyError as e:
|
||||||
|
print(f"Error : Metadata not found! More info : {e}")
|
||||||
|
|
||||||
|
qt_version_str: str = qVersion()
|
||||||
|
authors_str: str = _AUTHORS
|
||||||
|
version_type_str: str = _VERSION_TYPE
|
||||||
|
instance_extension_str: str = _INSTANCE_EXTENSION
|
||||||
|
license_text_str = r"""
|
||||||
# GNU GENERAL PUBLIC LICENSE
|
# GNU GENERAL PUBLIC LICENSE
|
||||||
|
|
||||||
Version 3, 29 June 2007
|
Version 3, 29 June 2007
|
||||||
|
|||||||
@@ -4,13 +4,11 @@ from typing import TYPE_CHECKING
|
|||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from lce_qt_launcher.models.app_data import AppData
|
from lce_qt_launcher.models.app_data import AppData
|
||||||
|
|
||||||
from lce_qt_launcher import Languages
|
|
||||||
from lce_qt_launcher.managers.system_manager import SystemManager
|
from lce_qt_launcher.managers.system_manager import SystemManager
|
||||||
from lce_qt_launcher.models.preferences import UserPref
|
from lce_qt_launcher.models.pref import UserPref
|
||||||
from lce_qt_launcher.build_info import BuildInfo
|
|
||||||
from lce_qt_launcher.managers.instance_manager import InstanceManager, Instance
|
from lce_qt_launcher.managers.instance_manager import InstanceManager, Instance
|
||||||
from lce_qt_launcher.models.theme import StrTheme
|
from lce_qt_launcher.models.theme import StrTheme
|
||||||
from lce_qt_launcher.utils.json_trans import JsonTrans
|
from lce_qt_launcher.utils.json_trans import JsonTrans, Languages
|
||||||
|
|
||||||
_default_instance: Instance = Instance()
|
_default_instance: Instance = Instance()
|
||||||
_default_theme: StrTheme = StrTheme.MINECRAFT
|
_default_theme: StrTheme = StrTheme.MINECRAFT
|
||||||
@@ -19,87 +17,37 @@ _default_language: str = "en"
|
|||||||
|
|
||||||
class AppContext:
|
class AppContext:
|
||||||
"""_summary_ The App Main Context"""
|
"""_summary_ The App Main Context"""
|
||||||
|
def __init__(self,
|
||||||
def __init__(
|
|
||||||
self,
|
|
||||||
appData: AppData,
|
appData: AppData,
|
||||||
theme: StrTheme = _default_theme,
|
theme: StrTheme = _default_theme,
|
||||||
instance: Instance = _default_instance,
|
instance: Instance = _default_instance,
|
||||||
lang: str = _default_language,
|
lang: str = _default_language,
|
||||||
) -> None:
|
) -> None:
|
||||||
self.buildInfo: BuildInfo = BuildInfo()
|
|
||||||
self.sys_man: SystemManager = SystemManager()
|
self.sys_man: SystemManager = SystemManager()
|
||||||
self.userPref: UserPref = UserPref(self.buildInfo)
|
self.userPref: UserPref = UserPref()
|
||||||
self.instanceMan: InstanceManager = InstanceManager(
|
self.instanceMan: InstanceManager = InstanceManager(
|
||||||
instance, self.buildInfo, self
|
instance, self
|
||||||
)
|
)
|
||||||
self.theme: StrTheme = theme
|
self.theme: StrTheme = theme
|
||||||
self.translator: JsonTrans = JsonTrans(appData, lang)
|
self.translator: JsonTrans = JsonTrans(appData, lang)
|
||||||
|
self.selectedLang: str = Languages.FALLBACK.value
|
||||||
|
|
||||||
self.accesibleModeEnabled: bool = self.userPref.default_accesibility_mode
|
self.accesibleModeEnabled: bool = self.userPref.default_accesibility_mode
|
||||||
self.devModeEnabled: bool = self.userPref.default_developper_mode
|
self.devModeEnabled: bool = self.userPref.default_developper_mode
|
||||||
|
self.experimentModeEnabled: bool = self.userPref.default_experiment_mode
|
||||||
self.showHolidayEnabled: bool = self.userPref.default_show_holiday
|
self.showHolidayEnabled: bool = self.userPref.default_show_holiday
|
||||||
self.currentLang: str = Languages.FALLBACK.value
|
self.defaultInstancePath: str = self.userPref.default_instance_path
|
||||||
|
self.defaultUsername: str = self.userPref.default_username
|
||||||
|
|
||||||
self.BACKGROUND_PIXMAP_IMG: str = ":/assets/background.png"
|
self.BACKGROUND_PIXMAP_IMG: str = ":/assets/background.png"
|
||||||
self.ICON: str = ":/assets/launcher_small.png"
|
self.ICON: str = ":/assets/launcher_small.png"
|
||||||
self.MINECRAFT_WEBSITE: str = "https://minecraft.net"
|
self.MINECRAFT_WEBSITE: str = "https://minecraft.net"
|
||||||
self.MINECRAFT_LCE_WEBSITE: str = "https://minecraftlegacy.com/"
|
self.MINECRAFT_LCE_WEBSITE: str = "https://minecraftlegacy.com/"
|
||||||
|
|
||||||
def updateTheme(self, theme: StrTheme) -> None:
|
def updateAppUILang(self) -> None:
|
||||||
"""_summary_ Update the theme
|
|
||||||
|
|
||||||
Args:
|
|
||||||
theme (Theme): _description_ the theme (enum) to update
|
|
||||||
"""
|
|
||||||
self.theme = theme
|
|
||||||
self.userPref.set_theme_pref(theme.value)
|
|
||||||
|
|
||||||
def updateInstance(self, instance: Instance) -> None:
|
|
||||||
"""_summary_ #TODO : TBW
|
|
||||||
|
|
||||||
Args:
|
|
||||||
instance (Instance): _description_
|
|
||||||
"""
|
|
||||||
self.instanceMan.instance = instance
|
|
||||||
|
|
||||||
def updateLanguage(self, lang: str) -> None:
|
|
||||||
"""_summary_ update the language
|
"""_summary_ update the language
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
lang (str): _description_
|
lang (str): _description_
|
||||||
"""
|
"""
|
||||||
self.currentLang = lang
|
self.translator.load_lang(self.selectedLang)
|
||||||
self.translator.load_lang(lang)
|
|
||||||
|
|
||||||
def updateShowHolidayStatus(self, request: str) -> None:
|
|
||||||
"""_summary_ Update the show holiday status via boolean string "request"
|
|
||||||
|
|
||||||
Args:
|
|
||||||
request (str): _description_ the boolean string request to update the show holiday option.
|
|
||||||
"""
|
|
||||||
if request == "true":
|
|
||||||
self.showHolidayEnabled = True
|
|
||||||
else:
|
|
||||||
self.showHolidayEnabled = False
|
|
||||||
|
|
||||||
def updateSetDevMoodeStatus(self, request: str) -> None:
|
|
||||||
"""_summary_ Update the dev mode status via boolean string "request"
|
|
||||||
|
|
||||||
Args:
|
|
||||||
request (str): _description_ the boolean string request to update the developper mode option.
|
|
||||||
"""
|
|
||||||
if request == "true":
|
|
||||||
self.devModeEnabled = True
|
|
||||||
else:
|
|
||||||
self.devModeEnabled = False
|
|
||||||
|
|
||||||
def updateSetAccesbilityMoodeStatus(self, request: str) -> None:
|
|
||||||
"""_summary_ Update the dev mode status via boolean string "request"
|
|
||||||
|
|
||||||
Args:
|
|
||||||
request (str): _description_ the boolean string request to update the developper mode option.
|
|
||||||
"""
|
|
||||||
if request == "true":
|
|
||||||
self.accesibleModeEnabled = True
|
|
||||||
else:
|
|
||||||
self.accesibleModeEnabled = False
|
|
||||||
|
|||||||
@@ -1,58 +0,0 @@
|
|||||||
from importlib.metadata import PackageNotFoundError, metadata, version
|
|
||||||
from importlib.metadata._meta import PackageMetadata
|
|
||||||
|
|
||||||
from PySide6.QtCore import qVersion
|
|
||||||
|
|
||||||
from lce_qt_launcher import (
|
|
||||||
AUTHORS,
|
|
||||||
FALLBACK_APP_NAME,
|
|
||||||
FALLBACK_GIT_REPO_URL,
|
|
||||||
FALLBACK_LICENSE,
|
|
||||||
FALLBACK_LICENSE_LINK,
|
|
||||||
FALLBACK_VERSION_NUMBER,
|
|
||||||
INSTANCE_EXTENSION,
|
|
||||||
VERSION_TYPE,
|
|
||||||
)
|
|
||||||
import lce_qt_launcher.views.term_service as term_service
|
|
||||||
|
|
||||||
|
|
||||||
class BuildInfo:
|
|
||||||
"""Application Information and Metadata Information"""
|
|
||||||
|
|
||||||
def __init__(self) -> None:
|
|
||||||
self.version: str = FALLBACK_VERSION_NUMBER
|
|
||||||
self.app_name: str = FALLBACK_APP_NAME
|
|
||||||
self.git_repo_url: str = FALLBACK_GIT_REPO_URL
|
|
||||||
self.license_link: str = FALLBACK_LICENSE_LINK
|
|
||||||
self.license: str = FALLBACK_LICENSE
|
|
||||||
try:
|
|
||||||
app_metadata: PackageMetadata = metadata("LCE-Qt-Launcher")
|
|
||||||
|
|
||||||
version_metadata: str = version("LCE-Qt-Launcher")
|
|
||||||
app_name_metadata: str = app_metadata["Name"]
|
|
||||||
repo_url_metadata: str = app_metadata["Repository"]
|
|
||||||
license_url_metadata: str = app_metadata["LicenseURL"]
|
|
||||||
license_metadata: str = app_metadata["License"]
|
|
||||||
|
|
||||||
if version_metadata:
|
|
||||||
self.version = version_metadata
|
|
||||||
if app_name_metadata:
|
|
||||||
self.app_name = app_name_metadata
|
|
||||||
if repo_url_metadata:
|
|
||||||
self.git_repo_url = repo_url_metadata
|
|
||||||
if license_url_metadata:
|
|
||||||
self.license_link = license_url_metadata
|
|
||||||
if license_metadata:
|
|
||||||
self.license = license_metadata
|
|
||||||
|
|
||||||
except PackageNotFoundError as e:
|
|
||||||
term_service.print_error(f"Package not found! More info : {e.msg}")
|
|
||||||
except RuntimeError as e:
|
|
||||||
term_service.print_error(f"Metadata not found! More info : {e}")
|
|
||||||
except KeyError as e:
|
|
||||||
term_service.print_error(f"Metadata not found! More info : {e}")
|
|
||||||
|
|
||||||
self.qt_version: str = qVersion()
|
|
||||||
self.authors: str = AUTHORS
|
|
||||||
self.version_type: str = VERSION_TYPE
|
|
||||||
self.instance_extension: str = INSTANCE_EXTENSION
|
|
||||||
@@ -13,15 +13,24 @@ from PySide6.QtWidgets import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
from lce_qt_launcher.app_context import AppContext
|
from lce_qt_launcher.app_context import AppContext
|
||||||
from lce_qt_launcher.build_info import BuildInfo
|
|
||||||
from lce_qt_launcher.managers import import_managers
|
from lce_qt_launcher.managers import import_managers
|
||||||
from lce_qt_launcher.managers.instance_manager import Instance, InstanceManager
|
from lce_qt_launcher.managers.instance_manager import Instance, InstanceManager
|
||||||
from lce_qt_launcher.managers.system_manager import SystemManager
|
from lce_qt_launcher.managers.system_manager import SystemManager
|
||||||
from lce_qt_launcher.models.app_data import AppData
|
from lce_qt_launcher.models.app_data import AppData
|
||||||
from lce_qt_launcher.models.preferences import UserPref
|
from lce_qt_launcher.models.pref import UserPref
|
||||||
from lce_qt_launcher.ui_settingDialog import Ui_settingDialog
|
from lce_qt_launcher.ui_settingDialog import Ui_settingDialog
|
||||||
from lce_qt_launcher.views.browser_dialog import BrowserDialog
|
from lce_qt_launcher.views.browser_dialog import BrowserDialog
|
||||||
from lce_qt_launcher.views.setting_dialog import SettingDialog
|
from lce_qt_launcher.views.setting_dialog import SettingDialog
|
||||||
|
from lce_qt_launcher import (
|
||||||
|
app_name_str,
|
||||||
|
version_str,
|
||||||
|
licence_name_str,
|
||||||
|
qt_version_str,
|
||||||
|
license_link_str,
|
||||||
|
instance_extension_str
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
import lce_qt_launcher.views.cli as cli
|
import lce_qt_launcher.views.cli as cli
|
||||||
import lce_qt_launcher.views.term_service as term_service
|
import lce_qt_launcher.views.term_service as term_service
|
||||||
|
|
||||||
@@ -49,22 +58,24 @@ def install_game(
|
|||||||
progressLabel: QLabel = parent.ui.progressLabel
|
progressLabel: QLabel = parent.ui.progressLabel
|
||||||
progressBar: QProgressBar = parent.ui.progressBar
|
progressBar: QProgressBar = parent.ui.progressBar
|
||||||
try:
|
try:
|
||||||
reply: QNetworkReply = instanceManager.install_instance()
|
reply: QNetworkReply | str = instanceManager.install_instance()
|
||||||
_ = progressLabel.setVisible(True)
|
if isinstance(reply, QNetworkReply):
|
||||||
_ = progressBar.setVisible(True)
|
_ = progressLabel.setVisible(True)
|
||||||
_ = progressBar.setEnabled(True)
|
_ = progressBar.setVisible(True)
|
||||||
_ = progressLabel.setText(f"Downloading {instance.name} Progress")
|
_ = progressBar.setEnabled(True)
|
||||||
|
_ = progressLabel.setText(f"Downloading {instance.name} Progress")
|
||||||
|
|
||||||
# TODO - Verify this methodd
|
# TODO - Verify this methodd
|
||||||
def update_progress_bar(bytes_received, bytes_total) -> None: # pyright: ignore[reportUnknownParameterType, reportMissingParameterType]
|
def update_progress_bar(bytes_received, bytes_total) -> None: # pyright: ignore[reportUnknownParameterType, reportMissingParameterType]
|
||||||
if bytes_total > 0:
|
if bytes_total > 0:
|
||||||
_ = progressBar.setMaximum(bytes_total) # pyright: ignore[reportUnknownArgumentType]
|
_ = progressBar.setMaximum(bytes_total) # pyright: ignore[reportUnknownArgumentType]
|
||||||
_ = progressBar.setValue(bytes_received) # pyright: ignore[reportUnknownArgumentType]
|
_ = progressBar.setValue(bytes_received) # pyright: ignore[reportUnknownArgumentType]
|
||||||
else:
|
else:
|
||||||
_ = progressBar.setRange(0, 0)
|
_ = progressBar.setRange(0, 0)
|
||||||
|
|
||||||
_ = reply.downloadProgress.connect(update_progress_bar) # pyright: ignore[reportUnknownArgumentType]
|
|
||||||
|
|
||||||
|
_ = reply.downloadProgress.connect(update_progress_bar) # pyright: ignore[reportUnknownArgumentType]
|
||||||
|
else:
|
||||||
|
pass
|
||||||
except RuntimeError as e:
|
except RuntimeError as e:
|
||||||
_ = progressLabel.setVisible(True)
|
_ = progressLabel.setVisible(True)
|
||||||
_ = progressBar.setVisible(True)
|
_ = progressBar.setVisible(True)
|
||||||
@@ -114,7 +125,6 @@ def load_instance_from_file(
|
|||||||
parent: QWidget,
|
parent: QWidget,
|
||||||
instanceManager: InstanceManager,
|
instanceManager: InstanceManager,
|
||||||
appContext: AppContext,
|
appContext: AppContext,
|
||||||
buildInfo: BuildInfo,
|
|
||||||
appData: AppData,
|
appData: AppData,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Features : Load the Selected Instance"""
|
"""Features : Load the Selected Instance"""
|
||||||
@@ -122,7 +132,7 @@ def load_instance_from_file(
|
|||||||
parent,
|
parent,
|
||||||
"Load Instance File",
|
"Load Instance File",
|
||||||
appContext.sys_man.found_default_save_path(),
|
appContext.sys_man.found_default_save_path(),
|
||||||
f"{buildInfo.app_name} Instance (*{buildInfo.instance_extension})",
|
f"{app_name_str} Instance (*{instance_extension_str})",
|
||||||
)
|
)
|
||||||
instanceManager.load_instance(file_name[0])
|
instanceManager.load_instance(file_name[0])
|
||||||
try:
|
try:
|
||||||
@@ -192,7 +202,7 @@ def new_instance_from_form(mainWindow: QMainWindow) -> Instance:
|
|||||||
return newInstance
|
return newInstance
|
||||||
|
|
||||||
|
|
||||||
def show_webbrowser(parent: QWidget, url: str, buildInfo: BuildInfo):
|
def show_webbrowser(parent: QWidget, url: str):
|
||||||
"""_summary_ Create and show a Webbrowser view
|
"""_summary_ Create and show a Webbrowser view
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@@ -200,14 +210,13 @@ def show_webbrowser(parent: QWidget, url: str, buildInfo: BuildInfo):
|
|||||||
url (str): _description_ the url desired
|
url (str): _description_ the url desired
|
||||||
buildInfo (BuildInfo): _description_ : The Build info of the app info
|
buildInfo (BuildInfo): _description_ : The Build info of the app info
|
||||||
"""
|
"""
|
||||||
_ = BrowserDialog(parent, url, buildInfo)
|
_ = BrowserDialog(parent, url)
|
||||||
|
|
||||||
|
|
||||||
def save_instance_to_file(
|
def save_instance_to_file(
|
||||||
parent: QWidget,
|
parent: QWidget,
|
||||||
instanceManager: InstanceManager,
|
instanceManager: InstanceManager,
|
||||||
appContext: AppContext,
|
appContext: AppContext,
|
||||||
buildInfo: BuildInfo,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
"""_summary_ Save the instance to a file
|
"""_summary_ Save the instance to a file
|
||||||
|
|
||||||
@@ -221,7 +230,7 @@ def save_instance_to_file(
|
|||||||
parent,
|
parent,
|
||||||
"Save Instance option to a file",
|
"Save Instance option to a file",
|
||||||
appContext.sys_man.found_default_save_path(),
|
appContext.sys_man.found_default_save_path(),
|
||||||
f"{buildInfo.app_name} Instance File (*{buildInfo.instance_extension})",
|
f"{app_name_str} Instance File (*{instance_extension_str})",
|
||||||
)[0]
|
)[0]
|
||||||
instanceManager.save_instance(file_name)
|
instanceManager.save_instance(file_name)
|
||||||
|
|
||||||
@@ -245,16 +254,16 @@ def generate_user_config(userPref: UserPref) -> None:
|
|||||||
userPref.generate_default_config()
|
userPref.generate_default_config()
|
||||||
|
|
||||||
|
|
||||||
def display_license(buildInfo: BuildInfo) -> None:
|
def display_license() -> None:
|
||||||
"""_summary_ Display the license of the app on the console
|
"""_summary_ Display the license of the app on the console
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
buildInfo (BuildInfo): _description_ : The Build info for the App Info
|
buildInfo (BuildInfo): _description_ : The Build info for the App Info
|
||||||
"""
|
"""
|
||||||
term_service.print_information(
|
term_service.print_information(
|
||||||
f"{buildInfo.app_name} is licensed via the {buildInfo.license} License."
|
f"{app_name_str} is licensed via the {licence_name_str} License."
|
||||||
)
|
)
|
||||||
term_service.print_information(f"See {buildInfo.license_link} for more info")
|
term_service.print_information(f"See {license_link_str} for more info")
|
||||||
|
|
||||||
|
|
||||||
def display_help(help_str: str) -> None:
|
def display_help(help_str: str) -> None:
|
||||||
@@ -275,11 +284,11 @@ def display_about(about_str: str) -> None:
|
|||||||
term_service.print_pretty(about_str)
|
term_service.print_pretty(about_str)
|
||||||
|
|
||||||
|
|
||||||
def display_version(buildInfo: BuildInfo) -> None:
|
def display_version() -> None:
|
||||||
"""_summary_ Display the string version on the console
|
"""_summary_ Display the string version on the console
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
buildInfo (BuildInfo): _description_ Display the help string of the app for the cli on the console
|
buildInfo (BuildInfo): _description_ Display the help string of the app for the cli on the console
|
||||||
"""
|
"""
|
||||||
term_service.print_information(f"{buildInfo.app_name} Version {buildInfo.version}")
|
term_service.print_information(f"{app_name_str} Version {version_str}")
|
||||||
term_service.print_information(f"Qt Version {buildInfo.qt_version}")
|
term_service.print_information(f"Qt Version {qt_version_str}")
|
||||||
|
|||||||
@@ -6,14 +6,14 @@
|
|||||||
# nuitka-project: --include-data-dir=assets=assets
|
# nuitka-project: --include-data-dir=assets=assets
|
||||||
# nuitka-project: --include-data-dir=data=data
|
# nuitka-project: --include-data-dir=data=data
|
||||||
# nuitka-project: --include-qt-plugins=sensible
|
# nuitka-project: --include-qt-plugins=sensible
|
||||||
# nuitka-project: --product-version="0.2026.5.13"
|
# nuitka-project: --product-version="0.2026.5.17"
|
||||||
# nuitka-project: --file-version="0.2026.5.13"
|
# nuitka-project: --file-version="0.2026.5.17"
|
||||||
# nuitka-project: --file-description="Manage Minecraft Legacy Console Edition Instances."
|
# nuitka-project: --file-description="Manage Minecraft Legacy Console Edition Instances."
|
||||||
# nuitka-projet: --include-distribution-metadata=lce-qt-launcher
|
# nuitka-projet: --include-distribution-metadata=lce-qt-launcher
|
||||||
# nuitka-project: --copyright="Copyleft Xgui4 2026 (GPLv3)"
|
# nuitka-project: --copyright="Copyleft Xgui4 2026 (GPLv3)"
|
||||||
|
|
||||||
"""
|
"""
|
||||||
LCE Qt Launcher Manager
|
LCE Qt Launcher Alpha
|
||||||
Copyright (C) 2026 Xgui4
|
Copyright (C) 2026 Xgui4
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
@@ -30,13 +30,8 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with this program. If not, see https://www.gnu.org/licenses/.
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from lce_qt_launcher.models.preferences import UserPref
|
from lce_qt_launcher import instance_extension_str
|
||||||
|
from lce_qt_launcher.models.pref import UserPref
|
||||||
|
|
||||||
from PySide6.QtWidgets import QMessageBox, QFileDialog
|
|
||||||
|
|
||||||
from PySide6.QtGui import QFontDatabase
|
|
||||||
|
|
||||||
from lce_qt_launcher.models.app_data import AppData
|
from lce_qt_launcher.models.app_data import AppData
|
||||||
from lce_qt_launcher.views import term_service
|
from lce_qt_launcher.views import term_service
|
||||||
from lce_qt_launcher.views.cmd_arg import (
|
from lce_qt_launcher.views.cmd_arg import (
|
||||||
@@ -51,6 +46,11 @@ from lce_qt_launcher.managers.system_manager import SystemManager
|
|||||||
from lce_qt_launcher.models.theme import StrTheme
|
from lce_qt_launcher.models.theme import StrTheme
|
||||||
import lce_qt_launcher.models.theme as theme
|
import lce_qt_launcher.models.theme as theme
|
||||||
|
|
||||||
|
|
||||||
|
from PySide6.QtWidgets import QMessageBox, QFileDialog
|
||||||
|
from PySide6.QtGui import QFontDatabase
|
||||||
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@@ -67,18 +67,26 @@ def main() -> None:
|
|||||||
userPref: UserPref = appContext.userPref
|
userPref: UserPref = appContext.userPref
|
||||||
# user_language: str = userPref.get_language_pref() #FIXME : This should return a language, not aa theme file
|
# user_language: str = userPref.get_language_pref() #FIXME : This should return a language, not aa theme file
|
||||||
user_theme: str = userPref.get_theme_pref()
|
user_theme: str = userPref.get_theme_pref()
|
||||||
show_holiday: str = userPref.get_show_holiday()
|
show_holiday: str = userPref.get_show_holiday_pref()
|
||||||
developer_mode: str = userPref.get_developper_mode()
|
developer_mode: str = userPref.get_developper_mode_pref()
|
||||||
accessible_mode: str = userPref.get_accesible_mode()
|
accessible_mode: str = userPref.get_accesible_mode_pref()
|
||||||
|
experiment_mode: str = userPref.get_experimental_mode_pref()
|
||||||
|
username: str = userPref.get_username_pref()
|
||||||
|
default_instance_path : str = userPref.get_instance_path_pref()
|
||||||
try:
|
try:
|
||||||
selected_theme: StrTheme = theme.from_str_to_strTheme(user_theme)
|
selected_theme: StrTheme = theme.from_str_to_strTheme(user_theme)
|
||||||
appContext.updateTheme(selected_theme)
|
appContext.theme = selected_theme
|
||||||
appContext.updateShowHolidayStatus(show_holiday)
|
appContext.showHolidayEnabled = bool(show_holiday)
|
||||||
appContext.updateSetDevMoodeStatus(developer_mode)
|
appContext.devModeEnabled = bool(developer_mode)
|
||||||
appContext.updateSetAccesbilityMoodeStatus(accessible_mode)
|
appContext.experimentModeEnabled = bool(experiment_mode)
|
||||||
|
appContext.accesibleModeEnabled = bool(accessible_mode)
|
||||||
|
appContext.defaultUsername = str(username)
|
||||||
|
appContext.defaultInstancePath = str(default_instance_path)
|
||||||
except RuntimeError as err:
|
except RuntimeError as err:
|
||||||
term_service.print_error(str(err))
|
term_service.print_error(str(err))
|
||||||
# appContext.updateLanguage(user_language)
|
finally:
|
||||||
|
pass
|
||||||
|
#appContext.updateAppUILang()
|
||||||
except:
|
except:
|
||||||
term_service.print_error("They were a error while loading the system theme or user preference.")
|
term_service.print_error("They were a error while loading the system theme or user preference.")
|
||||||
|
|
||||||
@@ -92,7 +100,7 @@ def main() -> None:
|
|||||||
file_name: str = QFileDialog.getSaveFileName(
|
file_name: str = QFileDialog.getSaveFileName(
|
||||||
None,
|
None,
|
||||||
save_filedialog_title,
|
save_filedialog_title,
|
||||||
f'{appContext.sys_man.found_default_save_path()}("LCE Instance Save File" (*{appContext.buildInfo.instance_extension}))',
|
f'{appContext.sys_man.found_default_save_path()}("LCE Instance Save File" (*{instance_extension_str}))',
|
||||||
)[0]
|
)[0]
|
||||||
appContext.instanceMan.save_instance(file_name)
|
appContext.instanceMan.save_instance(file_name)
|
||||||
|
|
||||||
@@ -116,6 +124,5 @@ def main() -> None:
|
|||||||
|
|
||||||
sys.exit(app.exec())
|
sys.exit(app.exec())
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ from typing import TYPE_CHECKING
|
|||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from lce_qt_launcher.app_context import AppContext
|
from lce_qt_launcher.app_context import AppContext
|
||||||
|
|
||||||
from lce_qt_launcher.build_info import BuildInfo
|
from lce_qt_launcher import instance_extension_str
|
||||||
import lce_qt_launcher.views.term_service as term_service
|
import lce_qt_launcher.views.term_service as term_service
|
||||||
|
|
||||||
from PySide6.QtNetwork import QNetworkReply
|
from PySide6.QtNetwork import QNetworkReply
|
||||||
@@ -286,13 +286,11 @@ class Instance(QObject):
|
|||||||
class InstanceManager:
|
class InstanceManager:
|
||||||
"""_summary_ The Manager for Instances objects"""
|
"""_summary_ The Manager for Instances objects"""
|
||||||
|
|
||||||
def __init__(self, instance: Instance, build_info: BuildInfo, appContext: AppContext):
|
def __init__(self, instance: Instance, appContext: AppContext):
|
||||||
self.instance: Instance = instance
|
self.instance: Instance = instance
|
||||||
from lce_qt_launcher.managers.downloader import Downloader
|
from lce_qt_launcher.managers.downloader import Downloader
|
||||||
|
|
||||||
self._downloader: Downloader = Downloader(appContext)
|
self._downloader: Downloader = Downloader(appContext)
|
||||||
self._build_info: BuildInfo = build_info
|
|
||||||
|
|
||||||
def play(self) -> str:
|
def play(self) -> str:
|
||||||
"""_summary_ Launch an Instance
|
"""_summary_ Launch an Instance
|
||||||
|
|
||||||
@@ -361,8 +359,8 @@ class InstanceManager:
|
|||||||
)
|
)
|
||||||
except:
|
except:
|
||||||
json_string = json.dumps(obj=vars(self.instance), indent=4, default=str)
|
json_string = json.dumps(obj=vars(self.instance), indent=4, default=str)
|
||||||
if not save_file.endswith(self._build_info.instance_extension):
|
if not save_file.endswith(instance_extension_str):
|
||||||
full_save_file: str = save_file + self._build_info.instance_extension
|
full_save_file: str = save_file + instance_extension_str
|
||||||
with open(file=full_save_file, mode="w") as f:
|
with open(file=full_save_file, mode="w") as f:
|
||||||
_ = f.write(json_string)
|
_ = f.write(json_string)
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
from PySide6.QtCore import QSettings
|
from PySide6.QtCore import QSettings
|
||||||
|
|
||||||
from lce_qt_launcher.build_info import BuildInfo
|
|
||||||
from lce_qt_launcher.models.theme import StrTheme
|
from lce_qt_launcher.models.theme import StrTheme
|
||||||
|
from lce_qt_launcher import app_name_str
|
||||||
|
|
||||||
_THEME_OPTION: str = "customisation/theme"
|
_THEME_OPTION: str = "customisation/theme"
|
||||||
_INSTANCE_PATH_OPTION: str = "preferences/default_path"
|
_INSTANCE_PATH_OPTION: str = "preferences/default_path"
|
||||||
@@ -22,12 +22,12 @@ class UserPref(QSettings):
|
|||||||
QSettings (_type_): _description_ : Inherit QtSettings
|
QSettings (_type_): _description_ : Inherit QtSettings
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, buildInfo: BuildInfo) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__(
|
super().__init__(
|
||||||
QSettings.Format.IniFormat,
|
QSettings.Format.IniFormat,
|
||||||
QSettings.Scope.UserScope,
|
QSettings.Scope.UserScope,
|
||||||
"Xgui4",
|
"Xgui4",
|
||||||
buildInfo.app_name,
|
app_name_str,
|
||||||
)
|
)
|
||||||
self.default_theme: StrTheme = StrTheme.MINECRAFT
|
self.default_theme: StrTheme = StrTheme.MINECRAFT
|
||||||
self.default_instance_path: str = "{appData}/instances"
|
self.default_instance_path: str = "{appData}/instances"
|
||||||
@@ -73,18 +73,18 @@ class UserPref(QSettings):
|
|||||||
super().setValue(_INSTANCE_PATH_OPTION, instance_path)
|
super().setValue(_INSTANCE_PATH_OPTION, instance_path)
|
||||||
super().sync()
|
super().sync()
|
||||||
|
|
||||||
def get_instance_path(self) -> str:
|
def get_instance_path_pref(self) -> str:
|
||||||
"""_summary_ Default Instance Path Getter"""
|
"""_summary_ Default Instance Path Getter"""
|
||||||
return str(
|
return str(
|
||||||
self.value(_INSTANCE_PATH_OPTION, self.default_instance_path, type=str)
|
self.value(_INSTANCE_PATH_OPTION, self.default_instance_path, type=str)
|
||||||
)
|
)
|
||||||
|
|
||||||
def set_show_holiday(self, show_holiday_bool: bool) -> None:
|
def set_show_holiday_pref(self, show_holiday_bool: bool) -> None:
|
||||||
"""_summary_ Show Holiday Toggle Setter"""
|
"""_summary_ Show Holiday Toggle Setter"""
|
||||||
super().setValue(_SHOW_HOLIDAY_OPTION, show_holiday_bool)
|
super().setValue(_SHOW_HOLIDAY_OPTION, show_holiday_bool)
|
||||||
super().sync()
|
super().sync()
|
||||||
|
|
||||||
def get_show_holiday(self) -> str:
|
def get_show_holiday_pref(self) -> str:
|
||||||
"""_summary_ Show Holiday Toggle Getter
|
"""_summary_ Show Holiday Toggle Getter
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@@ -94,7 +94,7 @@ class UserPref(QSettings):
|
|||||||
self.value(_SHOW_HOLIDAY_OPTION, self.default_show_holiday, type=str)
|
self.value(_SHOW_HOLIDAY_OPTION, self.default_show_holiday, type=str)
|
||||||
)
|
)
|
||||||
|
|
||||||
def set_accesible_mode(self, accesbility_mode_bool: bool) -> None:
|
def set_accesible_mode_pref(self, accesbility_mode_bool: bool) -> None:
|
||||||
"""_summary_ Accessiblty Mode Sette
|
"""_summary_ Accessiblty Mode Sette
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@@ -103,7 +103,7 @@ class UserPref(QSettings):
|
|||||||
super().setValue(_ACCESIBLE_MODE_OPTION, accesbility_mode_bool)
|
super().setValue(_ACCESIBLE_MODE_OPTION, accesbility_mode_bool)
|
||||||
super().sync()
|
super().sync()
|
||||||
|
|
||||||
def get_accesible_mode(self) -> str:
|
def get_accesible_mode_pref(self) -> str:
|
||||||
"""_summary_ Accesiblity Toggle Getter
|
"""_summary_ Accesiblity Toggle Getter
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@@ -113,7 +113,7 @@ class UserPref(QSettings):
|
|||||||
self.value(_ACCESIBLE_MODE_OPTION, self.default_accesibility_mode, type=str)
|
self.value(_ACCESIBLE_MODE_OPTION, self.default_accesibility_mode, type=str)
|
||||||
)
|
)
|
||||||
|
|
||||||
def set_developper_mode(self, developper_mode_bool: bool) -> None:
|
def set_developper_mode_pref(self, developper_mode_bool: bool) -> None:
|
||||||
"""_summary_ Dev Mode Setter
|
"""_summary_ Dev Mode Setter
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@@ -122,7 +122,7 @@ class UserPref(QSettings):
|
|||||||
super().setValue(_DEVELOPPER_MODE_OPTION, developper_mode_bool)
|
super().setValue(_DEVELOPPER_MODE_OPTION, developper_mode_bool)
|
||||||
super().sync()
|
super().sync()
|
||||||
|
|
||||||
def get_developper_mode(self) -> str:
|
def get_developper_mode_pref(self) -> str:
|
||||||
"""_summary_ Dev Mode Getter
|
"""_summary_ Dev Mode Getter
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@@ -132,7 +132,7 @@ class UserPref(QSettings):
|
|||||||
self.value(_DEVELOPPER_MODE_OPTION, self.default_developper_mode, type=str)
|
self.value(_DEVELOPPER_MODE_OPTION, self.default_developper_mode, type=str)
|
||||||
)
|
)
|
||||||
|
|
||||||
def set_experimental_mode(self, experimental_mode_bool: bool) -> None:
|
def set_experimental_mode_pref(self, experimental_mode_bool: bool) -> None:
|
||||||
"""_summary_ Experimental Mode Setter
|
"""_summary_ Experimental Mode Setter
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@@ -141,7 +141,7 @@ class UserPref(QSettings):
|
|||||||
super().setValue(_EXPERIMENTAL_MODE_OPTION, experimental_mode_bool)
|
super().setValue(_EXPERIMENTAL_MODE_OPTION, experimental_mode_bool)
|
||||||
super().sync()
|
super().sync()
|
||||||
|
|
||||||
def get_experimental_mode(self) -> str:
|
def get_experimental_mode_pref(self) -> str:
|
||||||
"""_summary_ Experimental Mode Getter
|
"""_summary_ Experimental Mode Getter
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@@ -153,7 +153,7 @@ class UserPref(QSettings):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
def set_username(self, new_username: str) -> None:
|
def set_username_pref(self, new_username: str) -> None:
|
||||||
"""_summary_ Username Setter
|
"""_summary_ Username Setter
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@@ -162,7 +162,7 @@ class UserPref(QSettings):
|
|||||||
super().setValue(_USERNAME_OPTION, new_username)
|
super().setValue(_USERNAME_OPTION, new_username)
|
||||||
super().sync()
|
super().sync()
|
||||||
|
|
||||||
def get_username(self) -> str:
|
def get_username_pref(self) -> str:
|
||||||
"""_summary_ Experimental Mode Getter
|
"""_summary_ Experimental Mode Getter
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@@ -175,9 +175,9 @@ class UserPref(QSettings):
|
|||||||
self.set_theme_pref(self.default_theme)
|
self.set_theme_pref(self.default_theme)
|
||||||
self.set_language_pref(self.default_language)
|
self.set_language_pref(self.default_language)
|
||||||
self.set_instance_path_pref(self.default_instance_path)
|
self.set_instance_path_pref(self.default_instance_path)
|
||||||
self.set_show_holiday(self.default_show_holiday)
|
self.set_show_holiday_pref(self.default_show_holiday)
|
||||||
self.set_accesible_mode(self.default_accesibility_mode)
|
self.set_accesible_mode_pref(self.default_accesibility_mode)
|
||||||
self.set_accesible_mode(self.default_developper_mode)
|
self.set_accesible_mode_pref(self.default_developper_mode)
|
||||||
self.set_experimental_mode(self.default_experiment_mode)
|
self.set_experimental_mode_pref(self.default_experiment_mode)
|
||||||
self.set_username(self.default_username)
|
self.set_username_pref(self.default_username)
|
||||||
super().sync()
|
super().sync()
|
||||||
@@ -21,30 +21,30 @@ class MONTH(Enum):
|
|||||||
|
|
||||||
def monthEnumToStr(enum: MONTH) -> str:
|
def monthEnumToStr(enum: MONTH) -> str:
|
||||||
match enum:
|
match enum:
|
||||||
case 1:
|
case MONTH.JANUARY:
|
||||||
return ("January",)
|
return ("January")
|
||||||
case 2:
|
case MONTH.FEBRURAY:
|
||||||
return ("February",)
|
return ("February")
|
||||||
case 3:
|
case MONTH.MARCH:
|
||||||
return ("March",)
|
return ("March")
|
||||||
case 4:
|
case MONTH.APRIL:
|
||||||
return ("April",)
|
return ("April")
|
||||||
case 5:
|
case MONTH.MAY:
|
||||||
return ("May",)
|
return ("May")
|
||||||
case 6:
|
case MONTH.JUNE:
|
||||||
return ("June",)
|
return ("June")
|
||||||
case 7:
|
case MONTH.JULY:
|
||||||
return ("July",)
|
return ("July")
|
||||||
case 8:
|
case MONTH.AUGUST:
|
||||||
return ("August",)
|
return ("August")
|
||||||
case 9:
|
case MONTH.SEPTEMBER:
|
||||||
return ("September",)
|
return ("September")
|
||||||
case 10:
|
case MONTH.OCTOBER:
|
||||||
return ("October",)
|
return ("October")
|
||||||
case 11:
|
case MONTH.NOVEMBER:
|
||||||
return ("November",)
|
return ("November")
|
||||||
case 12:
|
case MONTH.DECEMBER:
|
||||||
return ("December",)
|
return ("December")
|
||||||
case _:
|
case _:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,13 @@ import os
|
|||||||
import lce_qt_launcher.models.app_data as AppData
|
import lce_qt_launcher.models.app_data as AppData
|
||||||
import lce_qt_launcher.views.term_service as term_service
|
import lce_qt_launcher.views.term_service as term_service
|
||||||
|
|
||||||
|
from enum import StrEnum
|
||||||
|
|
||||||
|
class Languages(StrEnum):
|
||||||
|
"""_summary_ : "Language Codes for JsonTrans"""
|
||||||
|
FALLBACK = "translations.json"
|
||||||
|
ENGLISH = "en"
|
||||||
|
FRENCH = "fr"
|
||||||
|
|
||||||
class JsonTrans(QObject):
|
class JsonTrans(QObject):
|
||||||
"""_summary_ The JSON Translators. Translating str with a json locales file
|
"""_summary_ The JSON Translators. Translating str with a json locales file
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ from PySide6.QtWidgets import QDialog, QHBoxLayout, QWidget
|
|||||||
from PySide6.QtWebEngineWidgets import QWebEngineView
|
from PySide6.QtWebEngineWidgets import QWebEngineView
|
||||||
from PySide6.QtCore import QUrl
|
from PySide6.QtCore import QUrl
|
||||||
|
|
||||||
from lce_qt_launcher.build_info import BuildInfo
|
from lce_qt_launcher import app_name_str
|
||||||
|
|
||||||
|
|
||||||
class BrowserDialog(QDialog):
|
class BrowserDialog(QDialog):
|
||||||
@@ -12,12 +12,12 @@ class BrowserDialog(QDialog):
|
|||||||
QDialog (_type_): _description_ inherited from QDialog
|
QDialog (_type_): _description_ inherited from QDialog
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, parent: QWidget, url: str, build_info: BuildInfo) -> None:
|
def __init__(self, parent: QWidget, url: str) -> None:
|
||||||
super().__init__()
|
super().__init__()
|
||||||
browser_dialog = QDialog(parent)
|
browser_dialog = QDialog(parent)
|
||||||
webview = QWebEngineView()
|
webview = QWebEngineView()
|
||||||
webview.load(QUrl(url))
|
webview.load(QUrl(url))
|
||||||
browser_dialog.setWindowTitle(build_info.app_name)
|
browser_dialog.setWindowTitle(app_name_str)
|
||||||
layout = QHBoxLayout()
|
layout = QHBoxLayout()
|
||||||
layout.addWidget(webview)
|
layout.addWidget(webview)
|
||||||
browser_dialog.setLayout(layout)
|
browser_dialog.setLayout(layout)
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ under certain conditions; type `show c' for details.
|
|||||||
|
|
||||||
if len(argv) < 1:
|
if len(argv) < 1:
|
||||||
user_output = input()
|
user_output = input()
|
||||||
if user_output == "1" or argv[2] == "play":
|
if user_output == "1" or argv[1] == "play":
|
||||||
print(instance_man.play())
|
print(instance_man.play())
|
||||||
if user_output == "2" or argv[2] == "install":
|
if user_output == "2" or argv[1] == "install":
|
||||||
print(instance_man.install_instance())
|
print(instance_man.install_instance())
|
||||||
else:
|
else:
|
||||||
term_service.print_information("Not implemented Yet!")
|
term_service.print_information("Not implemented Yet!")
|
||||||
|
|||||||
@@ -48,20 +48,27 @@ def parse_args(argv: list[str]) -> CmdArgAction:
|
|||||||
Returns:
|
Returns:
|
||||||
CmdArgAction: _description_ The Action of the flags/cmd_args to launch/activated
|
CmdArgAction: _description_ The Action of the flags/cmd_args to launch/activated
|
||||||
"""
|
"""
|
||||||
match argv:
|
match argv[1]:
|
||||||
case CmdArg.GEN_CONFIG_CMD_ARG | CmdArg.GEN_CONFIG_CMD_ARG_SHORT:
|
case CmdArg.GEN_CONFIG_CMD_ARG | CmdArg.GEN_CONFIG_CMD_ARG_SHORT:
|
||||||
|
print("config")
|
||||||
return CmdArgAction.GEN_CONFIG
|
return CmdArgAction.GEN_CONFIG
|
||||||
case CmdArg.VERSION_CMD_ARG | CmdArg.VERSION_CMD_ARG_SHORT:
|
case CmdArg.VERSION_CMD_ARG | CmdArg.VERSION_CMD_ARG_SHORT:
|
||||||
|
print("version")
|
||||||
return CmdArgAction.PRINT_VERSION
|
return CmdArgAction.PRINT_VERSION
|
||||||
case CmdArg.LICENSE_CMD_ARG | CmdArg.LICENSE_CMD_ARG_SHORT:
|
case CmdArg.LICENSE_CMD_ARG | CmdArg.LICENSE_CMD_ARG_SHORT:
|
||||||
|
print("license")
|
||||||
return CmdArgAction.PRINT_LICENSE
|
return CmdArgAction.PRINT_LICENSE
|
||||||
case CmdArg.ABOUT_CMD_ARG | CmdArg.ABOUT_CMD_ARG_SHORT:
|
case CmdArg.ABOUT_CMD_ARG | CmdArg.ABOUT_CMD_ARG_SHORT:
|
||||||
|
print("about")
|
||||||
return CmdArgAction.PRINT_ABOUT_INFO
|
return CmdArgAction.PRINT_ABOUT_INFO
|
||||||
case CmdArg.HELP_CMD_ARG, CmdArg.HELP_CMD_ARG_SHORT:
|
case CmdArg.HELP_CMD_ARG | CmdArg.HELP_CMD_ARG_SHORT:
|
||||||
|
print("help")
|
||||||
return CmdArgAction.PRINT_HELP
|
return CmdArgAction.PRINT_HELP
|
||||||
case CmdArg.CLI_VERSION_CMD_ARG, CmdArg.CLI_VERSION_CMD_ARG_SHORT:
|
case CmdArg.CLI_VERSION_CMD_ARG | CmdArg.CLI_VERSION_CMD_ARG_SHORT:
|
||||||
|
print("cli")
|
||||||
return CmdArgAction.CLI_VERSION
|
return CmdArgAction.CLI_VERSION
|
||||||
case _:
|
case _:
|
||||||
|
print("Not Args detected")
|
||||||
return CmdArgAction.NO_ARGS
|
return CmdArgAction.NO_ARGS
|
||||||
|
|
||||||
|
|
||||||
@@ -79,7 +86,7 @@ def launch_cmd_action(action: CmdArgAction, appContext: AppContext) -> None:
|
|||||||
if action == CmdArgAction.GEN_CONFIG:
|
if action == CmdArgAction.GEN_CONFIG:
|
||||||
features.generate_user_config(appContext.userPref)
|
features.generate_user_config(appContext.userPref)
|
||||||
elif action == CmdArgAction.PRINT_LICENSE:
|
elif action == CmdArgAction.PRINT_LICENSE:
|
||||||
features.display_license(appContext.buildInfo)
|
features.display_license()
|
||||||
elif action == CmdArgAction.PRINT_HELP:
|
elif action == CmdArgAction.PRINT_HELP:
|
||||||
features.display_help(
|
features.display_help(
|
||||||
appContext.translator.translate("help-message", FALLBACK_HELP_MESSAGE)
|
appContext.translator.translate("help-message", FALLBACK_HELP_MESSAGE)
|
||||||
@@ -89,7 +96,7 @@ def launch_cmd_action(action: CmdArgAction, appContext: AppContext) -> None:
|
|||||||
appContext.translator.translate("about_message", FALLBACK_ABOUT_MESSAGE)
|
appContext.translator.translate("about_message", FALLBACK_ABOUT_MESSAGE)
|
||||||
)
|
)
|
||||||
elif action == CmdArgAction.PRINT_VERSION:
|
elif action == CmdArgAction.PRINT_VERSION:
|
||||||
features.display_version(appContext.buildInfo)
|
features.display_version()
|
||||||
elif action == CmdArgAction.CLI_VERSION:
|
elif action == CmdArgAction.CLI_VERSION:
|
||||||
features.launch_cli_interface(appContext.instanceMan)
|
features.launch_cli_interface(appContext.instanceMan)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ from pathlib import Path
|
|||||||
from lce_qt_launcher.managers.system_manager import SystemManager
|
from lce_qt_launcher.managers.system_manager import SystemManager
|
||||||
from lce_qt_launcher.app_context import AppContext
|
from lce_qt_launcher.app_context import AppContext
|
||||||
from lce_qt_launcher.managers.instance_manager import Instance, InstanceManager
|
from lce_qt_launcher.managers.instance_manager import Instance, InstanceManager
|
||||||
from lce_qt_launcher.build_info import BuildInfo
|
|
||||||
from lce_qt_launcher.models.app_data import AppData
|
from lce_qt_launcher.models.app_data import AppData
|
||||||
from lce_qt_launcher.views.content_installer_dialog import ContentInstallerView
|
from lce_qt_launcher.views.content_installer_dialog import ContentInstallerView
|
||||||
from lce_qt_launcher.ui_about import Ui_AboutDialog
|
from lce_qt_launcher.ui_about import Ui_AboutDialog
|
||||||
@@ -37,6 +36,14 @@ from lce_qt_launcher.ui_system_info import Ui_sys_info_dialog
|
|||||||
from lce_qt_launcher.utils.json_trans import JsonTrans
|
from lce_qt_launcher.utils.json_trans import JsonTrans
|
||||||
from lce_qt_launcher.ui_form import Ui_launcher
|
from lce_qt_launcher.ui_form import Ui_launcher
|
||||||
from lce_qt_launcher.managers.steam_manager import add_instance_to_steam
|
from lce_qt_launcher.managers.steam_manager import add_instance_to_steam
|
||||||
|
from lce_qt_launcher import (
|
||||||
|
app_name_str,
|
||||||
|
version_str,
|
||||||
|
license_text_str,
|
||||||
|
version_type_str,
|
||||||
|
git_repo_url_str,
|
||||||
|
instance_extension_str
|
||||||
|
)
|
||||||
|
|
||||||
import lce_qt_launcher.views.term_service as term_service
|
import lce_qt_launcher.views.term_service as term_service
|
||||||
import lce_qt_launcher.features as features
|
import lce_qt_launcher.features as features
|
||||||
@@ -56,7 +63,6 @@ class LauncherView(QMainWindow):
|
|||||||
|
|
||||||
translator: JsonTrans = appContext.translator
|
translator: JsonTrans = appContext.translator
|
||||||
instanceManager: InstanceManager = appContext.instanceMan
|
instanceManager: InstanceManager = appContext.instanceMan
|
||||||
buildInfo: BuildInfo = appContext.buildInfo
|
|
||||||
|
|
||||||
self.image_label: str = instanceManager.instance.image
|
self.image_label: str = instanceManager.instance.image
|
||||||
self.news_feed: str = instanceManager.instance.news_feed
|
self.news_feed: str = instanceManager.instance.news_feed
|
||||||
@@ -89,14 +95,14 @@ class LauncherView(QMainWindow):
|
|||||||
|
|
||||||
def saveInstanceButtonCommand() -> None:
|
def saveInstanceButtonCommand() -> None:
|
||||||
"""_summary_ Save the instance on a file on disk"""
|
"""_summary_ Save the instance on a file on disk"""
|
||||||
features.save_instance_to_file(self, instanceManager, appContext, buildInfo)
|
features.save_instance_to_file(self, instanceManager, appContext)
|
||||||
|
|
||||||
def changeInstanceIconButtonCommand() -> None:
|
def changeInstanceIconButtonCommand() -> None:
|
||||||
file_name: str = QFileDialog.getOpenFileName(
|
file_name: str = QFileDialog.getOpenFileName(
|
||||||
self,
|
self,
|
||||||
"Select the image file for the instance",
|
"Select the image file for the instance",
|
||||||
appContext.sys_man.found_default_save_path(),
|
appContext.sys_man.found_default_save_path(),
|
||||||
f"{buildInfo.app_name} Instance File (*{buildInfo.instance_extension})",
|
f"{app_name_str} Instance File (*{instance_extension_str})",
|
||||||
)[0]
|
)[0]
|
||||||
instanceManager.instance.image = file_name
|
instanceManager.instance.image = file_name
|
||||||
self.ui.instance_img.setPixmap(QPixmap(file_name))
|
self.ui.instance_img.setPixmap(QPixmap(file_name))
|
||||||
@@ -106,20 +112,20 @@ class LauncherView(QMainWindow):
|
|||||||
|
|
||||||
def showAboutMinecraftActionCommand() -> None:
|
def showAboutMinecraftActionCommand() -> None:
|
||||||
"""_summary_ Open an QWebEngine at the Minecraft Website"""
|
"""_summary_ Open an QWebEngine at the Minecraft Website"""
|
||||||
features.show_webbrowser(self, appContext.MINECRAFT_WEBSITE, buildInfo)
|
features.show_webbrowser(self, appContext.MINECRAFT_WEBSITE)
|
||||||
|
|
||||||
def showMoreLCEProjectsActionCommand() -> None:
|
def showMoreLCEProjectsActionCommand() -> None:
|
||||||
"""_summary_ Open An QWebEngine at the Minecraft LCE collection website (not by me)"""
|
"""_summary_ Open An QWebEngine at the Minecraft LCE collection website (not by me)"""
|
||||||
features.show_webbrowser(self, appContext.MINECRAFT_LCE_WEBSITE, buildInfo)
|
features.show_webbrowser(self, appContext.MINECRAFT_LCE_WEBSITE)
|
||||||
|
|
||||||
def updateActionCommand() -> None:
|
def updateActionCommand() -> None:
|
||||||
"""_summary_ "Show the Update Page in a QWebEngine Popup"""
|
"""_summary_ "Show the Update Page in a QWebEngine Popup"""
|
||||||
features.show_webbrowser(self, buildInfo.git_repo_url, buildInfo)
|
features.show_webbrowser(self, git_repo_url_str)
|
||||||
|
|
||||||
def loadInstanceActionCommand() -> None:
|
def loadInstanceActionCommand() -> None:
|
||||||
"""_summary_ Open the Load Save File Dialog"""
|
"""_summary_ Open the Load Save File Dialog"""
|
||||||
features.load_instance_from_file(
|
features.load_instance_from_file(
|
||||||
self, instanceManager, appContext, buildInfo, appData
|
self, instanceManager, appContext, appData
|
||||||
)
|
)
|
||||||
self.loadInstanceInForm(instanceManager)
|
self.loadInstanceInForm(instanceManager)
|
||||||
|
|
||||||
@@ -201,32 +207,31 @@ class LauncherView(QMainWindow):
|
|||||||
self.aboutDialog: QDialog = QDialog()
|
self.aboutDialog: QDialog = QDialog()
|
||||||
|
|
||||||
self.about.setupUi(self.aboutDialog)
|
self.about.setupUi(self.aboutDialog)
|
||||||
self.aboutDialog.setWindowTitle(appContext.buildInfo.app_name)
|
self.aboutDialog.setWindowTitle(app_name_str)
|
||||||
|
|
||||||
self.about.title.setText(appContext.buildInfo.app_name)
|
self.about.title.setText(app_name_str)
|
||||||
self.about.versionLabel.setText(f"{appContext.buildInfo.version}")
|
self.about.versionLabel.setText(f"{version_str}")
|
||||||
self.about.urlLabel.setText(appContext.buildInfo.git_repo_url)
|
self.about.urlLabel.setText(git_repo_url_str)
|
||||||
self.about.creditsText.setText("Xgui4")
|
self.about.creditsText.setText("Xgui4")
|
||||||
self.about.copyLabel.setText("Copyleft (C) GPLv3 Xgui4")
|
self.about.copyLabel.setText("Copyleft (C) GPLv3 Xgui4")
|
||||||
self.about.channelLabel.setText(
|
self.about.channelLabel.setText(
|
||||||
f"**Channel** : {appContext.buildInfo.version_type}"
|
f"**Channel** : {version_type_str}"
|
||||||
)
|
)
|
||||||
self.about.platformLabel.setText(f"**Platform** : {platform.release()}")
|
self.about.platformLabel.setText(f"**Platform** : {platform.release()}")
|
||||||
from lce_qt_launcher import license_str
|
|
||||||
|
|
||||||
self.about.licenseText.setMarkdown(license_str)
|
self.about.licenseText.setMarkdown(license_text_str)
|
||||||
self.about.aboutQt.clicked.connect(showAboutQtActionCommand)
|
self.about.aboutQt.clicked.connect(showAboutQtActionCommand)
|
||||||
self.about.closeButton.clicked.connect(self.aboutDialog.close)
|
self.about.closeButton.clicked.connect(self.aboutDialog.close)
|
||||||
|
|
||||||
self.instance_window: QDialog = QDialog()
|
self.instance_window: QDialog = QDialog()
|
||||||
self.instance_editor: Ui_InstancesEditor = Ui_InstancesEditor()
|
self.instance_editor: Ui_InstancesEditor = Ui_InstancesEditor()
|
||||||
self.instance_editor.setupUi(self.instance_window)
|
self.instance_editor.setupUi(self.instance_window)
|
||||||
self.instance_window.setWindowTitle(appContext.buildInfo.app_name)
|
self.instance_window.setWindowTitle(app_name_str)
|
||||||
|
|
||||||
systemManager: SystemManager = appContext.sys_man
|
systemManager: SystemManager = appContext.sys_man
|
||||||
|
|
||||||
self.dialog_ui.appVersionLabel.setText(
|
self.dialog_ui.appVersionLabel.setText(
|
||||||
f"**App Version** : {buildInfo.app_name} {buildInfo.version_type} {buildInfo.version}"
|
f"**App Version** : {app_name_str} {version_type_str} {version_str}"
|
||||||
)
|
)
|
||||||
self.dialog_ui.qVersionLabel.setText(f"**Qt Version** : {qVersion()}")
|
self.dialog_ui.qVersionLabel.setText(f"**Qt Version** : {qVersion()}")
|
||||||
self.dialog_ui.pyVersionLabel.setText(f"**Python Version** : {sys.version}")
|
self.dialog_ui.pyVersionLabel.setText(f"**Python Version** : {sys.version}")
|
||||||
@@ -273,12 +278,12 @@ class LauncherView(QMainWindow):
|
|||||||
self.ui.actionInstances.triggered.connect(openAppInstancesData)
|
self.ui.actionInstances.triggered.connect(openAppInstancesData)
|
||||||
|
|
||||||
open_workshop = lambda: features.show_webbrowser(
|
open_workshop = lambda: features.show_webbrowser(
|
||||||
self, "https://lce-hub.github.io/piston/", buildInfo
|
self, "https://lce-hub.github.io/piston/"
|
||||||
)
|
)
|
||||||
self.ui.actionLCE_Hub_Workshop.triggered.connect(open_workshop)
|
self.ui.actionLCE_Hub_Workshop.triggered.connect(open_workshop)
|
||||||
|
|
||||||
open_legacymods = lambda: features.show_webbrowser(
|
open_legacymods = lambda: features.show_webbrowser(
|
||||||
self, "https://legacymods.org/", buildInfo
|
self, "https://legacymods.org/"
|
||||||
)
|
)
|
||||||
self.ui.actionLegacyMods_Coming_Soon.triggered.connect(open_legacymods)
|
self.ui.actionLegacyMods_Coming_Soon.triggered.connect(open_legacymods)
|
||||||
|
|
||||||
@@ -289,7 +294,7 @@ class LauncherView(QMainWindow):
|
|||||||
self.ui.actionApp_Root.triggered.connect(openAppConfig)
|
self.ui.actionApp_Root.triggered.connect(openAppConfig)
|
||||||
|
|
||||||
open_github_issues = lambda: webbrowser.open(
|
open_github_issues = lambda: webbrowser.open(
|
||||||
appContext.buildInfo.git_repo_url + "/issues"
|
git_repo_url_str + "/issues"
|
||||||
)
|
)
|
||||||
self.ui.actionReport_a_Bugs_or_Sugess_a_feature.triggered.connect(
|
self.ui.actionReport_a_Bugs_or_Sugess_a_feature.triggered.connect(
|
||||||
open_github_issues
|
open_github_issues
|
||||||
@@ -393,7 +398,7 @@ class LauncherView(QMainWindow):
|
|||||||
|
|
||||||
self.setup_web_engine()
|
self.setup_web_engine()
|
||||||
|
|
||||||
self.versionlabel: QLabel = QLabel(f"Version {buildInfo.version}")
|
self.versionlabel: QLabel = QLabel(f"Version {version_type_str} {version_str}")
|
||||||
self.ui.statusbar.addPermanentWidget(self.versionlabel)
|
self.ui.statusbar.addPermanentWidget(self.versionlabel)
|
||||||
holyday_label: QLabel = QLabel(holiday.get_holiday())
|
holyday_label: QLabel = QLabel(holiday.get_holiday())
|
||||||
self.ui.statusbar.addWidget(holyday_label)
|
self.ui.statusbar.addWidget(holyday_label)
|
||||||
|
|||||||
@@ -29,16 +29,16 @@ class SettingDialog(QDialog):
|
|||||||
self.ui_setting.settingsOptions.helpRequested.connect(comingSoonMsgBox)
|
self.ui_setting.settingsOptions.helpRequested.connect(comingSoonMsgBox)
|
||||||
|
|
||||||
self.ui_setting.accesibilitycheckBox.setChecked(
|
self.ui_setting.accesibilitycheckBox.setChecked(
|
||||||
bool(self.userPref.get_accesible_mode())
|
bool(self.userPref.get_accesible_mode_pref())
|
||||||
)
|
)
|
||||||
self.ui_setting.developperModeDheckBox.setChecked(
|
self.ui_setting.developperModeDheckBox.setChecked(
|
||||||
bool(self.userPref.get_developper_mode())
|
bool(self.userPref.get_developper_mode_pref())
|
||||||
)
|
)
|
||||||
self.ui_setting.holydayDheckBox.setChecked(
|
self.ui_setting.holydayDheckBox.setChecked(
|
||||||
bool(self.userPref.get_show_holiday())
|
bool(self.userPref.get_show_holiday_pref())
|
||||||
)
|
)
|
||||||
self.ui_setting.enableExperimentscheckBox.setChecked(
|
self.ui_setting.enableExperimentscheckBox.setChecked(
|
||||||
bool(self.userPref.get_experimental_mode())
|
bool(self.userPref.get_experimental_mode_pref())
|
||||||
)
|
)
|
||||||
|
|
||||||
self.ui_setting.languagesComboBox.setEditText(self.userPref.get_language_pref())
|
self.ui_setting.languagesComboBox.setEditText(self.userPref.get_language_pref())
|
||||||
@@ -53,11 +53,11 @@ class SettingDialog(QDialog):
|
|||||||
isExperimentsOn = self.ui_setting.enableExperimentscheckBox.isChecked()
|
isExperimentsOn = self.ui_setting.enableExperimentscheckBox.isChecked()
|
||||||
QMessageBox.information(self, "Setting", "Functionnal Setting Coming Later")
|
QMessageBox.information(self, "Setting", "Functionnal Setting Coming Later")
|
||||||
|
|
||||||
self.userPref.set_accesible_mode(isAccesbilityModeEnabled)
|
self.userPref.set_accesible_mode_pref(isAccesbilityModeEnabled)
|
||||||
self.userPref.set_developper_mode(isDevelopperModeEnabled)
|
self.userPref.set_developper_mode_pref(isDevelopperModeEnabled)
|
||||||
self.userPref.set_show_holiday(isHolidayEnabled)
|
self.userPref.set_show_holiday_pref(isHolidayEnabled)
|
||||||
self.userPref.set_theme_pref(
|
self.userPref.set_theme_pref(
|
||||||
str(theme.from_entity_to_strTheme(theme.ThemeEntity(themeSelectedIndex)))
|
str(theme.from_entity_to_strTheme(theme.ThemeEntity(themeSelectedIndex)))
|
||||||
)
|
)
|
||||||
self.userPref.set_language_pref(languageSelectedIndex)
|
self.userPref.set_language_pref(languageSelectedIndex)
|
||||||
self.userPref.set_experimental_mode(isExperimentsOn)
|
self.userPref.set_experimental_mode_pref(isExperimentsOn)
|
||||||
|
|||||||
Reference in New Issue
Block a user