diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d641d5e..76a5f35 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -4,7 +4,6 @@ on: push: branches: - dev - permissions: contents: write @@ -56,8 +55,8 @@ jobs: uses: Minionguyjpro/Inno-Setup-Action@v1.2.8 with: path: packages\windows\nigthly.iss - options: '/O+ /F"LCE_Qt_Launcher_Windows_Nigthly_Setup"' - + # HACK : temporaly removed the filename to see if the installer workflow work + - name: Upload Artifact uses: actions/upload-artifact@v7.0.1 with: @@ -66,17 +65,18 @@ jobs: # --- JOB 3 : Making Arch Linux Packages --- build_arch_package: + name : "Build Arch Packages" runs-on: ubuntu-latest container: image: archlinux options: --privileged steps: - uses: actions/checkout@v6.0.2 - - uses: actions/setup-python@v6.2.0 - name: Build Arch Linux package uses: FFY00/build-arch-package@v1 with: - PKGBUILD: packages/linux/nigthly/PKGBUILD + PKGBUILD: ${{ github.workspace }}packages/linux/nigthly/PKGBUILD # HACK : test to see if it will work + - name: Upload Artifact uses: actions/upload-artifact@v7.0.1 with: @@ -94,11 +94,14 @@ jobs: with: python-version: "3.12" cache: 'pip' + - name: Install dependencies run: | python -m pip install --upgrade pip - pip install . pyproject-appimage + pip install pyproject-appimage + pip install . python -m pyproject-appimage + - name: Upload Artifact uses: actions/upload-artifact@v7.0.1 with: diff --git a/data/defaults_instances/aether.lce_inst b/data/defaults_instances/aether.lce_inst index 03a69ee..b8052c8 100644 --- a/data/defaults_instances/aether.lce_inst +++ b/data/defaults_instances/aether.lce_inst @@ -1,7 +1,7 @@ { - "$schema": "https://raw.githubusercontent.com/xgui4/LCE-Qt-Launcher/refs/heads/master/schemas/x-application-lce_inst_config.json", + "$schema": "https://raw.githubusercontent.com/xgui4/LCE-Qt-Launcher/refs/heads/dev/schemas/x-application-lce_inst_config.json", "name": "aRockefeler Aether Mod", - "installation_path": ".lce-aether", + "installation_path": "{appInstancePath}/.lce-aether", "archive_file": "Release.zip", "image": ":/aether.png", "exe_name": "Minecraft.Client.exe", diff --git a/data/defaults_instances/mclce.lce_inst b/data/defaults_instances/mclce.lce_inst index cfbfeda..f693afb 100644 --- a/data/defaults_instances/mclce.lce_inst +++ b/data/defaults_instances/mclce.lce_inst @@ -1,7 +1,7 @@ { - "$schema" : "https://raw.githubusercontent.com/xgui4/LCE-Qt-Launcher/refs/heads/master/schemas/x-application-lce_inst_config.json", + "$schema" : "https://raw.githubusercontent.com/xgui4/LCE-Qt-Launcher/refs/heads/dev/schemas/x-application-lce_inst_config.json", "name": "MCLCE Source Code Backup", - "installation_path": ".mclce", + "installation_path": "{appInstancePath}/.mclce", "archive_file": "LCEWindows64.zip", "exe_name": "Minecraft.Client.exe", "repo_url": "https://git.minecraftlegacy.com/backups/MinecraftConsoles", diff --git a/data/defaults_instances/neoLegacy.lce_inst b/data/defaults_instances/neoLegacy.lce_inst index 03e7407..157cb0b 100644 --- a/data/defaults_instances/neoLegacy.lce_inst +++ b/data/defaults_instances/neoLegacy.lce_inst @@ -1,12 +1,12 @@ { - "$schema": "https://raw.githubusercontent.com/xgui4/LCE-Qt-Launcher/refs/heads/master/schemas/x-application-lce_inst_config.json", + "$schema": "https://raw.githubusercontent.com/xgui4/LCE-Qt-Launcher/refs/heads/dev/schemas/x-application-lce_inst_config.json", "name": "neoStudiosLCE neoLegacy", "instance_source": "InstanceSource.GITHUB_RELEASE", "image": ":/assets/neoLegacy.png", "archive_file": "neoLegacyWindows64.zip", "exe_name": "neoLegacyWindows64/Minecraft.Client.exe", "news_feed": "https://github.com/neoStudiosLCE/neoLegacy/commits/main/", - "installation_path": ".neoLegacy", + "installation_path": "{appInstancePath}/.neoLegacy", "repo_url": "https://github.com/neoStudiosLCE/neoLegacy", "version": "v1.0.5b" } diff --git a/data/defaults_instances/revelation.lce_inst b/data/defaults_instances/revelation.lce_inst index cd35cf4..f3c0cab 100644 --- a/data/defaults_instances/revelation.lce_inst +++ b/data/defaults_instances/revelation.lce_inst @@ -1,7 +1,7 @@ { - "$schema" : "https://raw.githubusercontent.com/xgui4/LCE-Qt-Launcher/refs/heads/master/schemas/x-application-lce_inst_config.json", + "$schema" : "https://raw.githubusercontent.com/xgui4/LCE-Qt-Launcher/refs/heads/dev/schemas/x-application-lce_inst_config.json", "name": "Revelations", - "installation_path": ".lce-revelation", + "installation_path": "{appInstancePath}/.lce-revelation", "archive_file": "LCE-Revelations-Client-Win64.zip", "exe_name": "LCE-Revelations-Client-Win64/Minecraft.Client.exe", "repo_url": "https://git.revela.dev/itsRevela/LCE-Revelations", diff --git a/data/guide.jsonc b/data/guide.jsonc index b6522c5..f223f2c 100644 --- a/data/guide.jsonc +++ b/data/guide.jsonc @@ -1,8 +1,8 @@ { "$schema" : "../schemas/x-application-lce_inst_config.json", "name" : "default", // Name of the instance - "installation_path": ".lce", // Installation Path of the game files - "username" : "Steve", // Your Username, DEPRECIATED : will be soon removed and replaced by the username config settnig + "installation_path": "{appInstancePath}/.lce", // Installation Path of the game files, {appInstancePath} is a variable that represent the default instances location path + "username" : "Steve", // Old way to setup your username, it is not recommended and is being replaced with the username config "exe_name" : "Minecraft.Client.exe", // The executable name "archive_name" : "LCEWindows64.zip", // The archive to download "repo_url" : "https://github.com/MCLCE/MinecraftConsoles", // The ur/repo of the project diff --git a/data/lce_qt_launcher.ini b/data/lce_qt_launcher.ini index c38aee6..033f602 100644 --- a/data/lce_qt_launcher.ini +++ b/data/lce_qt_launcher.ini @@ -2,7 +2,7 @@ theme="Default" [preferences] language="en" -default_path="{appData}/instances" +default_path="{appInstancePath}/instances" experimental_mode_enabled=0 [views] show_holyday_enabled=1 diff --git a/default.nix b/default.nix index ced8ccb..2cb1749 100644 --- a/default.nix +++ b/default.nix @@ -2,7 +2,7 @@ pkgs.python3Packages.buildPythonApplication rec { pname = "lce-qt-launcher"; - version = "0.0.20.6"; + version = "0.0.20.7"; format = "pyproject"; src = ./.; diff --git a/hatch_build.py b/hatch_build.py index fc427fc..d84c00c 100644 --- a/hatch_build.py +++ b/hatch_build.py @@ -9,12 +9,32 @@ class CustomBuildHook(BuildHookInterface): # pyright: ignore[reportMissingTypeA if os.name == "posix": _ = subprocess.run("./scripts/clean.sh", check=True) if os.name == "nt": - _ = subprocess.run(["powershell", "-ExecutionPolicy", "Bypass", "-File", "scripts\\clean.ps1"], check=True, shell=True) + _ = subprocess.run( + [ + "powershell", + "-ExecutionPolicy", + "Bypass", + "-File", + "scripts\\clean.ps1", + ], + check=True, + shell=True, + ) return super().clean(versions) def initialize(self, version, build_data) -> None: # pyright: ignore[reportMissingParameterType] if os.name == "posix": _ = subprocess.run("./scripts/build.sh", check=True) if os.name == "nt": - _ = subprocess.run(["powershell", "-ExecutionPolicy", "Bypass", "-File", "scripts\\build.ps1"], check=True, shell=True) + _ = subprocess.run( + [ + "powershell", + "-ExecutionPolicy", + "Bypass", + "-File", + "scripts\\build.ps1", + ], + check=True, + shell=True, + ) return super().initialize(version, build_data) diff --git a/packages.py b/packages.py index cc17271..348d33f 100644 --- a/packages.py +++ b/packages.py @@ -4,4 +4,8 @@ import subprocess if os.name == "posix": _ = subprocess.run("./scripts/packages.sh", check=True) if os.name == "nt": - _ = subprocess.run(["powershell", "-ExecutionPolicy", "Bypass", "-File", "scripts\\packages.ps1"], check=True, shell=True) + _ = subprocess.run( + ["powershell", "-ExecutionPolicy", "Bypass", "-File", "scripts\\packages.ps1"], + check=True, + shell=True, + ) diff --git a/pyproject.toml b/pyproject.toml index d894e76..e0be925 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "hatchling.build" [project] name = "LCE-Qt-Launcher" -version = "0.0.20a6" +version = "0.0.20a7" description = "A custom Free/Libre Minecraft LCE Launcher written with PySide6 (Python for Qt 6)." requires-python = ">3.10, <3.13" license = "GPL-3.0-or-later" diff --git a/shell.nix b/shell.nix index 69d8eba..87a3645 100644 --- a/shell.nix +++ b/shell.nix @@ -21,7 +21,7 @@ let in pkgs.mkShell rec { pname = "lce-qt-launcher"; - version = "0.0.20.6"; + version = "0.0.20.7"; format = "pyproject"; src = ./.; diff --git a/src/form.ui b/src/form.ui index 53a1b1d..4934758 100644 --- a/src/form.ui +++ b/src/form.ui @@ -67,7 +67,7 @@ QTabWidget::TabShape::Rounded - 1 + 0 false @@ -206,7 +206,7 @@ - Default (MCLCE) - Vanilla Client + Default Qt::TextInteractionFlag::LinksAccessibleByKeyboard|Qt::TextInteractionFlag::LinksAccessibleByMouse|Qt::TextInteractionFlag::TextBrowserInteraction|Qt::TextInteractionFlag::TextSelectableByKeyboard|Qt::TextInteractionFlag::TextSelectableByMouse @@ -626,7 +626,7 @@ - https://github.com/MCLCE/MinecraftConsoles/commits + https://github.com/neoStudiosLCE/neoLegacy @@ -712,7 +712,7 @@ Folders - + @@ -894,12 +894,15 @@ Logs - + Configuration + + false + Themes diff --git a/src/instance.ui b/src/instance.ui index 2dab7ba..92b52c0 100644 --- a/src/instance.ui +++ b/src/instance.ui @@ -227,7 +227,7 @@ - + diff --git a/src/lce_qt_launcher/__init__.py b/src/lce_qt_launcher/__init__.py index 23e5686..784a399 100644 --- a/src/lce_qt_launcher/__init__.py +++ b/src/lce_qt_launcher/__init__.py @@ -4,7 +4,7 @@ from importlib.metadata._meta import PackageMetadata from PySide6.QtCore import qVersion _FALLBACK_APP_NAME = "LCE Qt Launcher" -_FALLBACK_VERSION = "0.0.20b6" +_FALLBACK_VERSION = "0.0.20b7" _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" @@ -27,7 +27,7 @@ try: _repo_url_temp: str = app_metadata["Repository"] _license_url_temp: str = app_metadata["LicenseURL"] _license_temp: str = app_metadata["License"] - + if _version_temp: version_str = _version_temp if _app_name_temp: diff --git a/src/lce_qt_launcher/app.py b/src/lce_qt_launcher/app.py index 8ea5940..930fb8a 100644 --- a/src/lce_qt_launcher/app.py +++ b/src/lce_qt_launcher/app.py @@ -28,8 +28,8 @@ class App(QApplication): self.set_theme(theme) def set_theme(self, theme: StrTheme) -> None: - #"""Set Application Theme using a pretermined theme""" - """_summary_ Set/update the application theme + # """Set Application Theme using a pretermined theme""" + """_summary_ Set/update the application theme Args: theme (StrTheme): _description_ thre strThene to set the app to diff --git a/src/lce_qt_launcher/app_context.py b/src/lce_qt_launcher/app_context.py index b6d7632..388f9e2 100644 --- a/src/lce_qt_launcher/app_context.py +++ b/src/lce_qt_launcher/app_context.py @@ -10,6 +10,8 @@ from lce_qt_launcher.managers.instance_manager import InstanceManager, Instance from lce_qt_launcher.models.theme import StrTheme from lce_qt_launcher.utils.json_trans import JsonTrans, Languages +import os + _default_instance: Instance = Instance() _default_theme: StrTheme = StrTheme.MINECRAFT _default_language: str = "en" @@ -32,18 +34,21 @@ class AppContext: self.translator: JsonTrans = JsonTrans(appData, lang) self.selectedLang: str = Languages.FALLBACK.value - self.accesibleModeEnabled: bool = self.userPref.default_accesibility_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.defaultInstancePath: str = self.userPref.default_instance_path - self.defaultUsername: str = self.userPref.default_username + self.accesibleModeEnabled: bool = self.userPref.defaultAccesibilityMode + self.devModeEnabled: bool = self.userPref.defaultDevelopperMode + self.experimentModeEnabled: bool = self.userPref.defaultExperimentMode + self.showHolidayEnabled: bool = self.userPref.defaultShowHoliday + self.instancePath: str = self.expand_path(self.userPref.defaultInstancePath, appData) + self.username: str = self.userPref.defaultUsername self.BACKGROUND_PIXMAP_IMG: str = ":/assets/background.png" self.ICON: str = ":/assets/launcher_small.png" self.MINECRAFT_WEBSITE: str = "https://minecraft.net" self.MINECRAFT_LCE_WEBSITE: str = "https://minecraftlegacy.com/" + def expand_path(self, path : str, appData : AppData) -> str: + return path.replace("{appInstancePath}", os.path.join(appData.appDataDirs[0])) + def updateAppUILang(self) -> None: """_summary_ update the language diff --git a/src/lce_qt_launcher/features.py b/src/lce_qt_launcher/features.py index 4633e67..eb1fc3a 100644 --- a/src/lce_qt_launcher/features.py +++ b/src/lce_qt_launcher/features.py @@ -30,7 +30,7 @@ from lce_qt_launcher import ( licence_name_str, qt_version_str, license_link_str, - instance_extension_str + instance_extension_str, ) @@ -42,12 +42,12 @@ def install_game( parent: QWidget, instance: Instance, instanceManager: InstanceManager ) -> None: """_summary_ - Features : Install the game instance selected + Features : Install the game instance selected args: - parent : The QWidget parent - instance : The selected Instance - instanceManager : The instance manager to use""" - #FIXME : Separe the GUI with the logic of the model + # FIXME : Separe the GUI with the logic of the model button_reply = QMessageBox.question( parent, "Confirm Installation", @@ -69,9 +69,9 @@ def install_game( _ = progressBar.setEnabled(True) _ = progressLabel.setText(f"Downloading {instance.name} Progress") - def update_progress_bar(bytes_received : int, bytes_total : int) -> None: + def update_progress_bar(bytes_received: int, bytes_total: int) -> None: if bytes_total > 0: - _ = progressBar.setMaximum(bytes_total) + _ = progressBar.setMaximum(bytes_total) _ = progressBar.setValue(bytes_received) else: _ = progressBar.setRange(0, 0) @@ -232,7 +232,7 @@ def generate_user_config(userPref: UserPref) -> None: Args: userPref (UserPref): _description_ : UserPreference Manager """ - userPref.generate_default_config() + userPref.generateDefaultConfig() def display_license() -> None: @@ -274,6 +274,6 @@ def display_version() -> None: term_service.print_information(f"{app_name_str} Version {version_str}") term_service.print_information(f"Qt Version {qt_version_str}") -def launch_instance_with_steam(instanceManager : InstanceManager) -> None: + +def launch_instance_with_steam(instanceManager: InstanceManager) -> None: subprocess.run(["steam", instanceManager.instance.steam_link]) - diff --git a/src/lce_qt_launcher/main.py b/src/lce_qt_launcher/main.py index f22ab81..442387f 100755 --- a/src/lce_qt_launcher/main.py +++ b/src/lce_qt_launcher/main.py @@ -22,8 +22,8 @@ along with this program. If not, see https://www.gnu.org/licenses/. # nuitka-project-if: {OS} == "Windows": # nuitka-project: --windows-icon-from-ico=assets/app.ico # nuitka-project: --windows-product-name=LCE-Qt-Launcher -# nuitka-project: --product-version="0.0.20.6" -# nuitka-project: --file-version="0.0.20.6" +# nuitka-project: --product-version="0.0.20.7" +# nuitka-project: --file-version="0.0.20.7" # nuitka-project: --file-description="LCE Qt Launcher Alpha" # nuitka-project: --copyright="Copyleft Xgui4 2026 (GPLv3)" @@ -31,7 +31,6 @@ along with this program. If not, see https://www.gnu.org/licenses/. # nuitka-project: --include-data-dir=data=data # nuitka-projet: --include-distribution-metadata=lce-qt-launcher - from lce_qt_launcher import instance_extension_str from lce_qt_launcher.models.pref import UserPref from lce_qt_launcher.models.app_data import AppData @@ -66,29 +65,33 @@ def main() -> None: if "--disable-system-qt-plugins" not in sys.argv: sys_man.adapt_qt_system_theme() userPref: UserPref = appContext.userPref - user_language: str = userPref.get_language_pref() #FIXME : This should return a language - user_theme: str = userPref.get_theme_pref() - show_holiday: str = userPref.get_show_holiday_pref() - developer_mode: str = userPref.get_developper_mode_pref() - 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() + languagePref : str = userPref.getLanguagePref() # FIXME : This should return a language + userTheme: str = userPref.getThemePref() + showHoliday: str = userPref.getShowHolidayPref() + developerMode: str = userPref.getDevelopperModePref() + accessibleMode: str = userPref.getAccesibleModePref() + experimentMode: str = userPref.getExperimentalModePref() + username: str = userPref.getUsernamePref() + defaultInstancePath: str = userPref.getInstancePathPref() try: - selected_theme: StrTheme = theme.from_str_to_strTheme(user_theme) + selected_theme: StrTheme = theme.from_str_to_strTheme(userTheme) appContext.theme = selected_theme - appContext.showHolidayEnabled = bool(show_holiday) - appContext.devModeEnabled = bool(developer_mode) - appContext.experimentModeEnabled = bool(experiment_mode) - appContext.accesibleModeEnabled = bool(accessible_mode) - appContext.defaultUsername = str(username) - appContext.defaultInstancePath = str(default_instance_path) + appContext.selectedLang = languagePref + appContext.showHolidayEnabled = bool(showHoliday) + appContext.devModeEnabled = bool(developerMode) + appContext.experimentModeEnabled = bool(experimentMode) + appContext.accesibleModeEnabled = bool(accessibleMode) + appContext.username = username + appContext.instancePath = appContext.expand_path(defaultInstancePath, appData) + + print(appContext.instancePath) + except RuntimeError as err: term_service.print_error(str(err)) finally: appContext.updateAppUILang() except: - #FIXME do not use a bare except : https://docs.astral.sh/ruff/rules/bare-except/ + # FIXME do not use a bare except : https://docs.astral.sh/ruff/rules/bare-except/ term_service.print_error( "They were a error while loading the system theme or user preference." ) diff --git a/src/lce_qt_launcher/managers/display_manager.py b/src/lce_qt_launcher/managers/display_manager.py index 1ccd0d1..1bb8f28 100644 --- a/src/lce_qt_launcher/managers/display_manager.py +++ b/src/lce_qt_launcher/managers/display_manager.py @@ -14,6 +14,7 @@ class DisplayType(Enum): class DisplayManager: """_summary_ The Display Manager Handler that will us the correct dysplay type""" + def __init__(self, type: DisplayType, parentWindow: QWidget | None = None) -> None: self.type: DisplayType = type if parentWindow is not None: @@ -29,23 +30,19 @@ class DisplayManager: if self.type == DisplayType.CONSOLE or DisplayType.MIXED: term_service.print_information(msg) if self.type == DisplayType.QMESSAGE_BOX or DisplayType.MIXED: - QMessageBox.information( - self.parentWindow, title, msg - ) + QMessageBox.information(self.parentWindow, title, msg) def displayWarn(self, msg: str, title: str = "Warning") -> None: """_summary_ Display Warning with a msg and a title Args: - msg (str): _description_ : the body message + msg (str): _description_ : the body message title (str, optional): _description_. The title of the message (Do not apply if type is Console). Defaults to "Warning". """ if self.type == DisplayType.CONSOLE or DisplayType.MIXED: term_service.print_warning(msg) if self.type == DisplayType.QMESSAGE_BOX or DisplayType.MIXED: - QMessageBox.warning( - self.parentWindow, title, msg - ) + QMessageBox.warning(self.parentWindow, title, msg) def displayError(self, msg: str, title: str = "❗Error") -> None: """_summary_ @@ -58,5 +55,7 @@ class DisplayManager: term_service.print_error(msg) if self.type == DisplayType.QMESSAGE_BOX or DisplayType.MIXED: QMessageBox.critical( - self.parentWindow, title, msg # - ) + self.parentWindow, + title, + msg, + ) diff --git a/src/lce_qt_launcher/managers/downloader.py b/src/lce_qt_launcher/managers/downloader.py index 04a5428..86de570 100644 --- a/src/lce_qt_launcher/managers/downloader.py +++ b/src/lce_qt_launcher/managers/downloader.py @@ -5,9 +5,9 @@ if TYPE_CHECKING: from lce_qt_launcher.managers.instance_manager import Instance from lce_qt_launcher.app_context import AppContext +from lce_qt_launcher.managers.system_manager import SystemManager import lce_qt_launcher.views.term_service as term_service -from lce_qt_launcher.managers.system_manager import SystemManager from zipfile import ZipFile, BadZipFile @@ -78,7 +78,7 @@ class Downloader(QObject): return reply def download_inst_async(self, instance: Instance) -> QNetworkReply: - #FIXME : replace this function with the other independant function + # FIXME : replace this function with the other independant function """_summary_ Download and install the selected Instance Args: diff --git a/src/lce_qt_launcher/managers/instance_manager.py b/src/lce_qt_launcher/managers/instance_manager.py index 501b8b7..c6b6e0a 100644 --- a/src/lce_qt_launcher/managers/instance_manager.py +++ b/src/lce_qt_launcher/managers/instance_manager.py @@ -1,4 +1,4 @@ -#FIXME : Make Instance mode indpendant +# FIXME : Make Instance mode indpendant from __future__ import annotations from typing import TYPE_CHECKING @@ -19,11 +19,12 @@ import subprocess import json import os -SCHEME_VERSION = "https://raw.githubusercontent.com/xgui4/LCE-Qt-Launcher/refs/heads/beta/schemas/x-application-lce_inst.json" +SCHEME_VERSION = "https://raw.githubusercontent.com/xgui4/LCE-Qt-Launcher/refs/heads/dev/schemas/x-application-lce_inst_config.json" class InstanceSource(Enum): """_summary_ The 4 Type of Instances (2 functional, the othes coming soon)""" + GITHUB_RELEASE = 0 FORGEJO_RELEASE = 1 REMOTE_GIT_SOURCE = 2 @@ -84,16 +85,14 @@ def from_str_to_InstanceSource(string: str) -> InstanceSource: case _: raise RuntimeError(f"{string} is an Incorrect InstanceSource Type") - _DEFAULT_INST_NAME = "New Default (pieeebot neoLegacy)" -_DEFAULT_INSTALLATION_PATH = ".new-default" +_DEFAULT_INSTALLATION_PATH = "{appInstancePath}/.new-default" _DEFAULT_USERNAME = "Steve" _DEFAULT_ARCHIVE_FILE = "neoLegacyWindows64.zip" _DEFAULT_EXE_NAME = "neoLegacyWindows64/Minecraft.Client.exe" _DEFAULT_REPO_URL = "https://github.com/neoStudiosLCE/neoLegacy" _DEFAULT_INST_SOURCE = InstanceSource.GITHUB_RELEASE _DEFAULT_INST_SOURCE_STRING = "InstanceSource.GITHUB_RELEASE" -_DEFAULT_INST_TYPE_STRING = "InstanceType.CLIENT_VANILLA" _DEFAULT_IMAGE = ":/assets/neoLegacy.png" _DEFAULT_NEWS_FEED = "https://github.com/neoStudiosLCE/neoLegacy/commits/main/" _DEFAULT_VERSION = "v1.0.4b" @@ -195,7 +194,7 @@ class Instance(QObject): "image": self.image, "news_feed": self.news_feed, "version": self.version, - "steam_link": self.version, + "steam_link": self.version } return dict_to_return @@ -212,7 +211,6 @@ class Instance(QObject): print(f"news_feed : {self.news_feed}") print(f"version : {self.version}") print(f"steam link : {self.steam_link}") - # print(f"servers : {self.servers}") class InstanceManager: @@ -221,7 +219,6 @@ class InstanceManager: def __init__(self, instance: Instance, appContext: AppContext): self.instance: Instance = instance from lce_qt_launcher.managers.downloader import Downloader - self._downloader: Downloader = Downloader(appContext) def play(self) -> str: @@ -232,9 +229,7 @@ class InstanceManager: """ return_code: int = 0 try: - client_path: str = os.path.join( - self.instance.installation_path, self.instance.exe_name - ) + client_path: str = os.path.join(self.instance.installation_path, self.instance.exe_name) try: game_process_temp = subprocess.run( [client_path, "-name", self.instance.username] @@ -266,7 +261,7 @@ class InstanceManager: Returns: QNetworkReply: _description_ : the QtNetwork Reply Object of the download process """ - #FIXME do others types + # FIXME do others types if self.instance.instance_source in [ InstanceSource.GITHUB_RELEASE, InstanceSource.FORGEJO_RELEASE, @@ -288,7 +283,7 @@ class InstanceManager: indent=4, ) except: - #FIXME do not use a bare except : https://docs.astral.sh/ruff/rules/bare-except/ + # FIXME do not use a bare except : https://docs.astral.sh/ruff/rules/bare-except/ json_string = json.dumps(obj=vars(self.instance), indent=4, default=str) if not save_file.endswith(instance_extension_str): full_save_file: str = save_file + instance_extension_str @@ -315,3 +310,6 @@ class InstanceManager: return True else: return False + + def expanded_path(self, appContext : AppContext) -> str: + return self.instance.installation_path.replace("{appInstancePath}", appContext.instancePath) \ No newline at end of file diff --git a/src/lce_qt_launcher/managers/mod_manager.py b/src/lce_qt_launcher/managers/mod_manager.py index 809711d..fbdefe5 100755 --- a/src/lce_qt_launcher/managers/mod_manager.py +++ b/src/lce_qt_launcher/managers/mod_manager.py @@ -66,7 +66,7 @@ LEGAL_TEXT = """ def extract_zip(data: ZipFile, extraction_path: str) -> None: """ - _summary_ : + _summary_ : extract the zipfile of the content to the desired path Args: data : the zip file itself @@ -75,7 +75,9 @@ def extract_zip(data: ZipFile, extraction_path: str) -> None: data.extractall(extraction_path) -def install_content(instance_path: str, contentType: ContentType, archive_file: str) -> None: +def install_content( + instance_path: str, contentType: ContentType, archive_file: str +) -> None: """_summary_ install the content of the mode Args: @@ -113,7 +115,9 @@ def main(): if sys.argv[1] == "--gui": from PySide6.QtWidgets import QApplication from PySide6.QtGui import QFontDatabase - from lce_qt_launcher.views.content_installer_dialog import ContentInstallerView + from lce_qt_launcher.views.content_installer_dialog import ( + ContentInstallerView, + ) app = QApplication() app.setStyle("Fusion") @@ -129,7 +133,7 @@ def main(): app.setFont(family) sys.exit(app.exec()) - + parser = argparse.ArgumentParser( prog="LCE Mods Manager", description="Manage DLC, World and Mods for Minecraft LCE", diff --git a/src/lce_qt_launcher/managers/steam_manager.py b/src/lce_qt_launcher/managers/steam_manager.py index de71878..406a2cb 100644 --- a/src/lce_qt_launcher/managers/steam_manager.py +++ b/src/lce_qt_launcher/managers/steam_manager.py @@ -34,8 +34,9 @@ LEGAL_TEXT = """ STEAM_USERS_LOCATION = "~/.steam/steam/config/loginusers.vdf" STEAM_SHORTCUTS_LOCATION = "~/steam/steam/userdata/{steam-id}/config/" + def add_instance_to_steam(abs_instance_exe_path: str, instance_name: str, icon: str): - """ _summary_ + """_summary_ add the instance to the steam Args: instance_exe_path (str): _description_ the instance executable file path diff --git a/src/lce_qt_launcher/managers/system_manager.py b/src/lce_qt_launcher/managers/system_manager.py index bf6ebf7..d289bad 100644 --- a/src/lce_qt_launcher/managers/system_manager.py +++ b/src/lce_qt_launcher/managers/system_manager.py @@ -91,4 +91,3 @@ class SystemManager: url = QUrl(url_str) service = QDesktopServices() _ = service.openUrl(url) - diff --git a/src/lce_qt_launcher/models/app_data.py b/src/lce_qt_launcher/models/app_data.py index aff8c69..eff029f 100644 --- a/src/lce_qt_launcher/models/app_data.py +++ b/src/lce_qt_launcher/models/app_data.py @@ -43,7 +43,7 @@ class AppData(QObject): def load_insts_list_into_mem(self) -> None: """_summary_ load instances from app data into a memory list""" - #FIXME : make it so it also work on both user and system (site) dir if needed + # FIXME : make it so it also work on both user and system (site) dir if needed defaults_insts_dir: Path = Path(os.path.join(self.appDataDirs[0], "instances")) if not defaults_insts_dir.exists(): term_service.print_information( @@ -61,7 +61,7 @@ class AppData(QObject): if file_path.is_file(): try: with open(file=file_path, mode="r", encoding="utf-8") as file: - context_dict: dict[str, str] = json.load(file) + context_dict: dict[str, str] = json.load(file) new_inst = Instance() new_inst.load_inst_from_dict(context_dict) instancesLists.append(new_inst) @@ -120,5 +120,6 @@ class AppData(QObject): return dirs.user_log_dir def _get_app_config_dir(self) -> str: + # FIXME : it should return the same location as the qt app setting which it do not right now dirs: PlatformDirs = PlatformDirs("LCE-Qt-Launcher", "Xgui4") return dirs.user_config_dir diff --git a/src/lce_qt_launcher/models/pref.py b/src/lce_qt_launcher/models/pref.py index f46de99..ca10edc 100644 --- a/src/lce_qt_launcher/models/pref.py +++ b/src/lce_qt_launcher/models/pref.py @@ -1,4 +1,4 @@ -#FIXME make this module more python like with attributes instead of getter and setter +# FIXME make this module more python like with attributes instead of getter and setter from PySide6.QtCore import QSettings @@ -26,94 +26,94 @@ class UserPref(QSettings): super().__init__( QSettings.Format.IniFormat, QSettings.Scope.UserScope, - "Xgui4", - app_name_str, + "Xgui4", + app_name_str ) - self.default_theme: StrTheme = StrTheme.MINECRAFT - self.default_instance_path: str = "{appData}/instances" - self.default_language: str = "en" - self.default_show_holiday: bool = True - self.default_accesibility_mode: bool = False - self.default_developper_mode: bool = False - self.default_experiment_mode: bool = False - self.default_username: str = "Steve" + self.defaultTheme: StrTheme = StrTheme.MINECRAFT + self.defaultInstancePath: str = "{appInstancePath}/instances" + self.defaultLanguage: str = "en" + self.defaultShowHoliday: bool = True + self.defaultAccesibilityMode: bool = False + self.defaultDevelopperMode: bool = False + self.defaultExperimentMode: bool = False + self.defaultUsername: str = "Steve" - def set_theme_pref(self, theme: str) -> None: + def setThemePref(self, theme: str) -> None: super().setValue(_THEME_OPTION, theme) super().sync() - def get_theme_pref(self) -> str: - return str(self.value(_THEME_OPTION, self.default_theme, type=str)) + def getThemePref(self) -> str: + return str(self.value(_THEME_OPTION, self.defaultTheme, type=str)) - def set_language_pref(self, language: str) -> None: + def setLanguagePref(self, language: str) -> None: super().setValue(_LANGUAGE_OPTION, language) super().sync() - def get_language_pref(self) -> str: - return str(self.value(_LANGUAGE_OPTION, self.default_theme, type=str)) + def getLanguagePref(self) -> str: + return str(self.value(_LANGUAGE_OPTION, self.defaultTheme, type=str)) - def set_instance_path_pref(self, instance_path: str) -> None: - super().setValue(_INSTANCE_PATH_OPTION, instance_path) + def setInstancePathPref(self, instancePath: str) -> None: + super().setValue(_INSTANCE_PATH_OPTION, instancePath) super().sync() - def get_instance_path_pref(self) -> str: + def getInstancePathPref(self) -> str: return str( - self.value(_INSTANCE_PATH_OPTION, self.default_instance_path, type=str) + self.value(_INSTANCE_PATH_OPTION, self.defaultInstancePath, type=str) ) - def set_show_holiday_pref(self, show_holiday_bool: bool) -> None: - super().setValue(_SHOW_HOLIDAY_OPTION, show_holiday_bool) + def setShowHolidayPref(self, showHolidayBool: bool) -> None: + super().setValue(_SHOW_HOLIDAY_OPTION, showHolidayBool) super().sync() - def get_show_holiday_pref(self) -> str: + def getShowHolidayPref(self) -> str: return str( - self.value(_SHOW_HOLIDAY_OPTION, self.default_show_holiday, type=str) + self.value(_SHOW_HOLIDAY_OPTION, self.defaultShowHoliday, type=str) ) - def set_accesible_mode_pref(self, accesbility_mode_bool: bool) -> None: - super().setValue(_ACCESIBLE_MODE_OPTION, accesbility_mode_bool) + def setAccesibleModePref(self, accesbilityModeBool: bool) -> None: + super().setValue(_ACCESIBLE_MODE_OPTION, accesbilityModeBool) super().sync() - def get_accesible_mode_pref(self) -> str: + def getAccesibleModePref(self) -> str: return str( - self.value(_ACCESIBLE_MODE_OPTION, self.default_accesibility_mode, type=str) + self.value(_ACCESIBLE_MODE_OPTION, self.defaultAccesibilityMode, type=str) ) - def set_developper_mode_pref(self, developper_mode_bool: bool) -> None: - super().setValue(_DEVELOPPER_MODE_OPTION, developper_mode_bool) + def setDevelopperMode_pref(self, developperModeBool: bool) -> None: + super().setValue(_DEVELOPPER_MODE_OPTION, developperModeBool) super().sync() - def get_developper_mode_pref(self) -> str: + def getDevelopperModePref(self) -> str: return str( - self.value(_DEVELOPPER_MODE_OPTION, self.default_developper_mode, type=str) + self.value(_DEVELOPPER_MODE_OPTION, self.defaultDevelopperMode, type=str) ) - def set_experimental_mode_pref(self, experimental_mode_bool: bool) -> None: - super().setValue(_EXPERIMENTAL_MODE_OPTION, experimental_mode_bool) + def setExperimentalModePref(self, experimentalModeBool: bool) -> None: + super().setValue(_EXPERIMENTAL_MODE_OPTION, experimentalModeBool) super().sync() - def get_experimental_mode_pref(self) -> str: + def getExperimentalModePref(self) -> str: return str( self.value( - _EXPERIMENTAL_MODE_OPTION, self.default_experiment_mode, type=str + _EXPERIMENTAL_MODE_OPTION, self.defaultExperimentMode, type=str ) ) - def set_username_pref(self, new_username: str) -> None: - super().setValue(_USERNAME_OPTION, new_username) + def setUsernamePref(self, newUsername: str) -> None: + super().setValue(_USERNAME_OPTION, newUsername) super().sync() - def get_username_pref(self) -> str: - return str(self.value(_USERNAME_OPTION, self.default_username, type=str)) + def getUsernamePref(self) -> str: + return str(self.value(_USERNAME_OPTION, self.defaultUsername, type=str)) - def generate_default_config(self) -> None: + def generateDefaultConfig(self) -> None: """_summary_ Generate the default config for the users""" - self.set_theme_pref(self.default_theme) - self.set_language_pref(self.default_language) - self.set_instance_path_pref(self.default_instance_path) - self.set_show_holiday_pref(self.default_show_holiday) - self.set_accesible_mode_pref(self.default_accesibility_mode) - self.set_accesible_mode_pref(self.default_developper_mode) - self.set_experimental_mode_pref(self.default_experiment_mode) - self.set_username_pref(self.default_username) + self.setThemePref(self.defaultTheme) + self.setLanguagePref(self.defaultLanguage) + self.setInstancePathPref(self.defaultInstancePath) + self.setShowHolidayPref(self.defaultShowHoliday) + self.setAccesibleModePref(self.defaultAccesibilityMode) + self.setAccesibleModePref(self.defaultDevelopperMode) + self.setExperimentalModePref(self.defaultExperimentMode) + self.setUsernamePref(self.defaultUsername) super().sync() diff --git a/src/lce_qt_launcher/views/about_view.py b/src/lce_qt_launcher/views/about_view.py index a8b9db6..f538d59 100644 --- a/src/lce_qt_launcher/views/about_view.py +++ b/src/lce_qt_launcher/views/about_view.py @@ -1,4 +1,3 @@ - import platform from PySide6.QtWidgets import QDialog, QWidget @@ -12,13 +11,15 @@ from lce_qt_launcher import ( version_str, version_type_str, git_repo_url_str, - license_text_str + license_text_str, ) + class AboutView(QDialog): def showAboutQtActionCommand(self) -> None: """_summary_ Show the About Qt Dialog""" features.show_about_qt(self) + def __init__(self, parent: QWidget): super().__init__(parent) @@ -39,4 +40,4 @@ class AboutView(QDialog): self.about.aboutQt.clicked.connect(self.showAboutQtActionCommand) self.about.closeButton.clicked.connect(self.aboutDialog.close) - self.aboutDialog.show() \ No newline at end of file + self.aboutDialog.show() diff --git a/src/lce_qt_launcher/views/content_installer_dialog.py b/src/lce_qt_launcher/views/content_installer_dialog.py index 045d8aa..f6ed5c5 100644 --- a/src/lce_qt_launcher/views/content_installer_dialog.py +++ b/src/lce_qt_launcher/views/content_installer_dialog.py @@ -17,9 +17,9 @@ class ContentInstallerView(QDialog): self.dialog: QDialog = QDialog() self.ui_dialog.setupUi(self.dialog) - self.contentToInstallPath : str = "" - self.instancePath : str = "" - self.contentTypeStr : str = "" + self.contentToInstallPath: str = "" + self.instancePath: str = "" + self.contentTypeStr: str = "" self.contentToInstallPath = self.ui_dialog.contentToInstallInputBox.text() self.contentTypeStr = self.ui_dialog.contentTypeComboBox.currentText() diff --git a/src/lce_qt_launcher/views/instance_editor_view.py b/src/lce_qt_launcher/views/instance_editor_view.py index 154cde2..9f2f95c 100644 --- a/src/lce_qt_launcher/views/instance_editor_view.py +++ b/src/lce_qt_launcher/views/instance_editor_view.py @@ -1,11 +1,14 @@ from PySide6.QtWidgets import QDialog, QWidget +from PySide6.QtGui import QPixmap +from lce_qt_launcher.managers.instance_manager import Instance from lce_qt_launcher.ui_instance import Ui_InstancesEditor from lce_qt_launcher import ( app_name_str, ) + class InstanceEditorView(QDialog): def __init__(self, parent: QWidget): super().__init__(parent) @@ -16,3 +19,13 @@ class InstanceEditorView(QDialog): self.instance_window.setWindowTitle(app_name_str) self.instance_window.show() + + def loadInstance(self, instance : Instance): + self.instance_editor.instanceNameInputBox.setText(instance.name) + self.instance_editor.usernameInputBox.setText(instance.username) + self.instance_editor.repoURLInputBox.setText(instance.repo_url) + self.instance_editor.versionsComboBox.setCurrentText(instance.version) + self.instance_editor.pathInputBox.setText(instance.installation_path) + image_pixmap = QPixmap(instance.image) + self.instance_editor.instanceLogo.setPixmap(image_pixmap) + self.instance_editor.steamLinkValue.setText(instance.image) \ No newline at end of file diff --git a/src/lce_qt_launcher/views/launcher.py b/src/lce_qt_launcher/views/launcher.py index a510d96..bbb7796 100644 --- a/src/lce_qt_launcher/views/launcher.py +++ b/src/lce_qt_launcher/views/launcher.py @@ -5,7 +5,7 @@ from PySide6.QtWidgets import ( QLabel, QListWidgetItem, QInputDialog, - QMessageBox, + QMessageBox ) from PySide6.QtGui import ( QPalette, @@ -22,7 +22,7 @@ from PySide6.QtCore import ( from PySide6.QtWebEngineCore import ( QWebEnginePage, QWebEngineProfile, - QWebEngineDownloadRequest, + QWebEngineDownloadRequest ) import json @@ -49,8 +49,8 @@ from lce_qt_launcher import ( git_repo_url_str, instance_extension_str ) - from lce_qt_launcher.views.system_info_view import SystemInfoView + import lce_qt_launcher.views.term_service as term_service import lce_qt_launcher.features as features import lce_qt_launcher.utils.holiday as holiday @@ -78,7 +78,7 @@ class LauncherView(QMainWindow): self.news_feed: str = instanceManager.instance.news_feed self.instance_name: str = instanceManager.instance.name self.instances: list[Instance] = list[Instance]() - self.username: str = appContext.userPref.get_username_pref() + self.username: str = appContext.username STARTING_GAME_MSG: str = translator.translate("start_game_msg") @@ -121,7 +121,9 @@ class LauncherView(QMainWindow): def showInstanceEditorButtonCommand() -> None: """_summary_ Open the instance editor button command""" - InstanceEditorView(self) + editor = InstanceEditorView(self) + editor.loadInstance(instanceManager.instance) + def showAboutMinecraftActionCommand() -> None: """_summary_ Open an QWebEngine at the Minecraft Website""" @@ -138,7 +140,7 @@ class LauncherView(QMainWindow): def loadInstanceActionCommand() -> None: """_summary_ Open the Load Save File Dialog""" features.load_instance_from_file(self, instanceManager, appContext, appData) - self.loadInstanceInForm(instanceManager) + self.loadInstanceInForm(instanceManager, appContext) def showSystemInformationActionCommand() -> None: """_summary_ Show the system info dialog""" @@ -165,31 +167,32 @@ class LauncherView(QMainWindow): def openWorkshopCommand() -> None: features.show_webbrowser(self, "https://lce-hub.github.io/piston/") - + def openLegacymodsCommand() -> None: features.show_webbrowser(self, "https://legacymods.org/") - + def openAppRootCommand() -> None: systemManager.open_url_with_system(appData.projectRootDir) - + def openAppConfigCommand() -> None: + # FIXME appData do not give the correct path systemManager.open_url_with_system(appData.appConfigDir) - + def openGitHubIssuesCommand() -> None: webbrowser.open(git_repo_url_str + "/issues") def loadDefaultInstanceCommand() -> None: - self.loadInstanceData(dict(), instanceManager) + self.loadInstanceData(dict(), instanceManager, appContext) def loadInstanceFromItemDataCommand() -> None: item = self.ui.listWidget.currentItem() if item is not None: - instance : Instance = item.data(Qt.UserRole) # type: ignore + instance: Instance = item.data(Qt.UserRole) # type: ignore else: raise RuntimeError("Could not load instance") instanceManager.instance = instance - self.loadInstanceInForm(instanceManager) - + self.loadInstanceInForm(instanceManager, appContext) + def addSteamLinkIntegrationButtonCommand(): steamIntegrationDialog = QInputDialog(self) value = steamIntegrationDialog.getText( @@ -229,7 +232,7 @@ class LauncherView(QMainWindow): item = QListWidgetItem() item.setText(inst.name) item.setIcon(QPixmap(inst.image)) - item.setData(Qt.UserRole, inst) # type: ignore + item.setData(Qt.UserRole, inst) # type: ignore self.ui.listWidget.addItem(item) arguments: list[str] = ( @@ -287,7 +290,6 @@ class LauncherView(QMainWindow): self.ui.loadSelectedInstanceButton.clicked.connect(loadInstanceFromItemDataCommand) self.ui.addInstanceButton.clicked.connect(loadInstanceActionCommand) - self.ui.actionSetting.triggered.connect(showSettingDialogCommand) self.ui.actionSetting_2.triggered.connect(showSettingDialogCommand) self.ui.actionSetting_3.triggered.connect(showSettingDialogCommand) @@ -305,10 +307,12 @@ class LauncherView(QMainWindow): self.ui.actionLCE_Hub_Workshop.triggered.connect(openWorkshopCommand) self.ui.actionLegacyMods_Coming_Soon.triggered.connect(openLegacymodsCommand) self.ui.actionApp_Root.triggered.connect(openAppRootCommand) - self.ui.actionApp_Root.triggered.connect(openAppConfigCommand) + # self.ui.actionConfigPath.triggered.connect(openAppConfigCommand) + # Action for opening configuration is temporaly disabled until it is fixed + self.ui.actionConfigPath.setEnabled(False) + self.ui.actionConfigPath.setText("Configuration (Broken)") self.ui.actionReport_a_Bugs_or_Sugess_a_feature.triggered.connect(openGitHubIssuesCommand) - self.ui.actionLoadDefaultInstance.triggered.connect(loadDefaultInstanceCommand) self.ui.actionLoadmclceInstance.setEnabled(False) self.ui.actionLoadmclceInstance.setText("MCLCE Source Code Backup (Remote Git Not supported yet)") @@ -323,7 +327,7 @@ class LauncherView(QMainWindow): data_neo = json.loads(raw_text_neo) self.ui.actionLoadmclceInstance.triggered.connect( - lambda : self.loadInstanceData(data_neo, instanceManager) + lambda: self.loadInstanceData(data_neo, instanceManager, appContext) ) revelationJson = QFile(":/instances/revelations.lce_inst") @@ -336,7 +340,7 @@ class LauncherView(QMainWindow): data_rev = json.loads(raw_text_rev) self.ui.actionLoadRevelationsInstance.triggered.connect( - lambda : self.loadInstanceData(data_rev, instanceManager) + lambda: self.loadInstanceData(data_rev, instanceManager, appContext) ) aetherJson = QFile(":/instances/aether.lce_inst") @@ -349,9 +353,9 @@ class LauncherView(QMainWindow): data_aether = json.loads(raw_text_aether) self.ui.actionLoadAetherInstance.triggered.connect( - lambda : self.loadInstanceData(data_aether, instanceManager) + lambda: self.loadInstanceData(data_aether, instanceManager, appContext) ) - + self.setup_web_engine() self.versionLabel: QLabel = QLabel(f"Version {version_type_str} {version_str}") @@ -364,7 +368,7 @@ class LauncherView(QMainWindow): holyday_label: QLabel = QLabel(holiday.get_holiday()) self.ui.statusbar.addWidget(holyday_label) - self.loadInstanceInForm(instanceManager) + self.loadInstanceInForm(instanceManager, appContext) def setup_web_engine(self): page: QWebEnginePage = self.ui.marketplacesWebsiteEngine.page() @@ -392,19 +396,21 @@ class LauncherView(QMainWindow): self, data: dict[str, str], instanceManager: InstanceManager, + appContext : AppContext ) -> None: """_summary_ Loas insance from data json in instance manager Args: data (dict[str, str]): _description_ the json data to load instanceManager (InstanceManager): _description_ the instance manager to use + appContext (AppContext): _description_ the App Context to use """ instance: Instance = Instance() instance.load_inst_from_dict(data) instanceManager.instance = instance - self.loadInstanceInForm(instanceManager) + self.loadInstanceInForm(instanceManager, appContext) - def loadInstanceInForm(self, instanceManager: InstanceManager) -> None: + def loadInstanceInForm(self, instanceManager: InstanceManager, appContext : AppContext) -> None: """_summary_ Load Instance in form Args: @@ -414,15 +420,16 @@ class LauncherView(QMainWindow): self.image_label = instanceManager.instance.image self.news_feed = instanceManager.instance.news_feed self.instance_name = instanceManager.instance.name - self.ui.usernameInputBox.setText(instanceManager.instance.username) + self.ui.usernameInputBox.setText(appContext.username if instanceManager.instance.username is "Steve" or "" else instanceManager.instance.username) self.ui.versionsComboBox.setEditText(instanceManager.instance.version) - self.ui.pathInputBox.setText(instanceManager.instance.installation_path) + self.ui.pathInputBox.setText(instanceManager.expanded_path(appContext)) self.ui.repoURLInputBox.setText(instanceManager.instance.repo_url) pixmap: QPixmap = QPixmap(self.image_label) self.ui.instance_img.setPixmap(pixmap) self.ui.repo_name_branch.setText(self.instance_name) self.ui.newsEngineView.setUrl(self.news_feed) instanceManager.instance.display() + if not instanceManager.is_installable(): self.ui.installButton.setEnabled(False) else: diff --git a/src/lce_qt_launcher/views/setting_dialog.py b/src/lce_qt_launcher/views/setting_dialog.py index 7a6a33d..86a407d 100644 --- a/src/lce_qt_launcher/views/setting_dialog.py +++ b/src/lce_qt_launcher/views/setting_dialog.py @@ -27,20 +27,20 @@ class SettingDialog(QDialog): self.ui_setting.settingsOptions.helpRequested.connect(comingSoonMsgBox) self.ui_setting.accesibilitycheckBox.setChecked( - bool(self.userPref.get_accesible_mode_pref()) + bool(self.userPref.getAccesibleModePref()) ) self.ui_setting.developperModeDheckBox.setChecked( - bool(self.userPref.get_developper_mode_pref()) + bool(self.userPref.getDevelopperModePref()) ) self.ui_setting.holydayDheckBox.setChecked( - bool(self.userPref.get_show_holiday_pref()) + bool(self.userPref.getShowHolidayPref()) ) self.ui_setting.enableExperimentscheckBox.setChecked( - bool(self.userPref.get_experimental_mode_pref()) + bool(self.userPref.getExperimentalModePref()) ) - self.ui_setting.languagesComboBox.setEditText(self.userPref.get_language_pref()) - self.ui_setting.themesComboBox.setEditText(self.userPref.get_theme_pref()) + self.ui_setting.languagesComboBox.setEditText(self.userPref.getLanguagePref()) + self.ui_setting.themesComboBox.setEditText(self.userPref.getThemePref()) def applyButtonCommand(self): isDevelopperModeEnabled = self.ui_setting.developperModeDheckBox.isChecked() @@ -51,11 +51,11 @@ class SettingDialog(QDialog): isExperimentsOn = self.ui_setting.enableExperimentscheckBox.isChecked() QMessageBox.information(self, "Setting", "Functionnal Setting Coming Later") - self.userPref.set_accesible_mode_pref(isAccesbilityModeEnabled) - self.userPref.set_developper_mode_pref(isDevelopperModeEnabled) - self.userPref.set_show_holiday_pref(isHolidayEnabled) - self.userPref.set_theme_pref( + self.userPref.setAccesibleModePref(isAccesbilityModeEnabled) + self.userPref.setDevelopperMode_pref(isDevelopperModeEnabled) + self.userPref.setShowHolidayPref(isHolidayEnabled) + self.userPref.setThemePref( str(theme.from_entity_to_strTheme(theme.ThemeEntity(themeSelectedIndex))) ) - self.userPref.set_language_pref(languageSelectedIndex) - self.userPref.set_experimental_mode_pref(isExperimentsOn) + self.userPref.setLanguagePref(languageSelectedIndex) + self.userPref.setExperimentalModePref(isExperimentsOn) diff --git a/src/lce_qt_launcher/views/system_info_view.py b/src/lce_qt_launcher/views/system_info_view.py index 88e43f4..f1e016f 100644 --- a/src/lce_qt_launcher/views/system_info_view.py +++ b/src/lce_qt_launcher/views/system_info_view.py @@ -1,4 +1,3 @@ - import sys from PySide6.QtWidgets import QDialog, QWidget @@ -14,13 +13,13 @@ from lce_qt_launcher import ( ) class SystemInfoView(QDialog): - def __init__(self, parent: QWidget, systemManager : SystemManager): + def __init__(self, parent: QWidget, systemManager: SystemManager): super().__init__(parent) self.sysinfo_dialog: QDialog = QDialog() self.dialog_ui: Ui_sys_info_dialog = Ui_sys_info_dialog() self.dialog_ui.setupUi(self.sysinfo_dialog) - + self.dialog_ui.appVersionLabel.setText( f"**App Version** : {app_name_str} {version_type_str} {version_str}" ) @@ -33,4 +32,4 @@ class SystemInfoView(QDialog): self.dialog_ui.pluginsInfoLabel.setText("") self.dialog_ui.runnersLabel.setText("") - self.sysinfo_dialog.show() \ No newline at end of file + self.sysinfo_dialog.show() diff --git a/uv.lock b/uv.lock index 8b6e110..6d13a49 100644 --- a/uv.lock +++ b/uv.lock @@ -408,7 +408,7 @@ wheels = [ [[package]] name = "lce-qt-launcher" -version = "0.0.20a6" +version = "0.0.20a7" source = { editable = "." } dependencies = [ { name = "hatch" },