From d76556b86f76f9f22212cf50dc32d7dcd9ce6a77 Mon Sep 17 00:00:00 2001 From: xgui4 <134389196+xgui4@users.noreply.github.com> Date: Wed, 6 May 2026 17:01:15 -0400 Subject: [PATCH] disabled unused features and add vdf python package for future steam integration --- .github/workflows/nightly.yml | 2 +- PKGBUILD | 3 +- default.nix | 1 + flake.nix | 1 + packages/linux/dev/PKGBUILD | 3 +- packages/linux/nigthly/PKGBUILD | 3 +- packages/linux/stable/PKGBUILD | 3 +- pyproject.toml | 3 +- readme.md | 1 + src/contentInstaller.ui | 152 ++++++---- src/form.ui | 270 ++++++++++-------- src/lce_qt_launcher/app.py | 4 +- src/lce_qt_launcher/managers/steam_manager.py | 20 +- .../views/content_installer_dialog.py | 8 +- src/lce_qt_launcher/views/launcher.py | 31 +- uv.lock | 11 + 16 files changed, 311 insertions(+), 205 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 3374b04..463f145 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -81,7 +81,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: installer-arch - path: "*.pkg.tar.zst" + path: "*.pkg.*.*" # --- JOB 4 : Publish the Nightly Release --- release: diff --git a/PKGBUILD b/PKGBUILD index be65a07..e031f46 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Xgui4 pkgname=lce-qt-launcher-git pkgver=nightly -pkgrel=1 +pkgrel=2 pkgdesc="A custom Minecraft LCE Launcher written in Python and Qt with GNU/Linux support in mind. (Nigthly/Git Build)" arch=('any') url="https://github.com/xgui4/LCE-Qt-Launcher" @@ -11,6 +11,7 @@ depends=( 'pyside6' 'python-requests' 'python-platformdirs' + 'python-vdf' 'python-rich' ) makedepends=( diff --git a/default.nix b/default.nix index 0229a38..293de84 100644 --- a/default.nix +++ b/default.nix @@ -25,6 +25,7 @@ pkgs.python3Packages.buildPythonApplication rec { pyside6 requests platformdirs + vdf rich ]; diff --git a/flake.nix b/flake.nix index e401cf8..4241047 100644 --- a/flake.nix +++ b/flake.nix @@ -24,6 +24,7 @@ python3Packages.requests python3Packages.platformdirs python3Packages.rich + python3Packages.vdf qt6.wrapQtAppsHook python3Packages.shiboken6 qt6.wrapQtAppsHook diff --git a/packages/linux/dev/PKGBUILD b/packages/linux/dev/PKGBUILD index 6fb3d3e..f8f9a50 100644 --- a/packages/linux/dev/PKGBUILD +++ b/packages/linux/dev/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Xgui4 pkgname=lce-qt-launcher-beta pkgver=nightly.r59.gc46cf72 -pkgrel=1 +pkgrel=2 pkgdesc="A custom Minecraft LCE Launcher written in Python and Qt with GNU/Linux support in mind. (Beta Build)" arch=('any') url="https://github.com/xgui4/LCE-Qt-Launcher" @@ -9,6 +9,7 @@ license=('GPL-3.0-or-later') depends=( 'python' 'pyside6' + 'python-vdf' 'python-requests' 'python-platformdirs' 'python-rich' diff --git a/packages/linux/nigthly/PKGBUILD b/packages/linux/nigthly/PKGBUILD index c69ac72..5bf34d1 100644 --- a/packages/linux/nigthly/PKGBUILD +++ b/packages/linux/nigthly/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Xgui4 pkgname=lce-qt-launcher-git pkgver=r149.804311b -pkgrel=1 +pkgrel=2 pkgdesc="A custom Minecraft LCE Launcher written in Python and Qt with GNU/Linux support in mind. (Nigthly/Git Build)" arch=('any') url="https://github.com/xgui4/LCE-Qt-Launcher" @@ -9,6 +9,7 @@ license=('GPL-3.0-or-later') depends=( 'python' 'pyside6' + 'python-vdf' 'python-requests' 'python-platformdirs' 'python-rich' diff --git a/packages/linux/stable/PKGBUILD b/packages/linux/stable/PKGBUILD index 033e5cd..add629a 100644 --- a/packages/linux/stable/PKGBUILD +++ b/packages/linux/stable/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Xgui4 pkgname=lce-qt-launcher pkgver=0.0.2.0 -pkgrel=1 +pkgrel=2 pkgdesc="A custom Minecraft LCE Launcher written with PySide6 (Python) with GNU/Linux support in mind. (Master/Stable Branch)" arch=('any') url="https://github.com/xgui4/LCE-Qt-Launcher" @@ -9,6 +9,7 @@ license=('GPL-3.0-or-later') depends=( 'python' 'pyside6' + 'python-vdf' 'python-requests' 'python-platformdirs' 'python-rich' diff --git a/pyproject.toml b/pyproject.toml index 5b963ae..cee4754 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,8 @@ dependencies = [ "rich>=14.3.3", "hatch<=1.16.5", "Nuitka<=4.0.7", - "patchelf<=0.17.2.4; sys_platform == 'linux'" + "patchelf<=0.17.2.4; sys_platform == 'linux'", + "vdf<=3.4" ] [project.scripts] diff --git a/readme.md b/readme.md index 31e1f59..f82a911 100644 --- a/readme.md +++ b/readme.md @@ -165,6 +165,7 @@ In this [GitHub Release](https://github.com/xgui4/LCE-Qt-Launcher/releases/tag/n - [MCLCE/MinecraftConsoles](https://github.com/MCLCE/MinecraftConsoles) for the port of the game for PC - [pieeebot/neoLegacy](https://github.com/pieeebot/neoLegacy) for backporting updates for the PC port - [LCE Hub](https://github.com/LCE-Hub) for the Marketplace/Workshop +- [MinecraftLegacy Community](https://github.com/MinecraftConsole) to include my lancher in their list ## Code of Respect diff --git a/src/contentInstaller.ui b/src/contentInstaller.ui index e705602..1d3e065 100644 --- a/src/contentInstaller.ui +++ b/src/contentInstaller.ui @@ -1,13 +1,13 @@ - Dialog - + contentInstallerDialog + 0 0 400 - 473 + 308 @@ -18,16 +18,6 @@ :/assets/piston.png:/assets/piston.png - - - - - - - Explore - - - @@ -41,6 +31,69 @@ + + + + + true + + + + Content Type + + + + + + + + + + :/assets/jigsaw-ico.png + + + false + + + + + + + 0 + + + + + + + + true + + + + Progression de l'installation + + + + + + + + DLC + + + + + World + + + + + Mod + + + + @@ -53,6 +106,19 @@ + + + + + + + Explore + + + + + + @@ -65,7 +131,20 @@ - + + + + + + + Explore + + + + + + + Qt::Orientation::Horizontal @@ -75,47 +154,6 @@ - - - - - - - Explore - - - - - - - - true - - - - Content Type - - - - - - - - World - - - - - DLC - - - - - Mod - - - - @@ -125,7 +163,7 @@ mainButtonBox accepted() - Dialog + contentInstallerDialog accept() @@ -141,7 +179,7 @@ mainButtonBox rejected() - Dialog + contentInstallerDialog reject() diff --git a/src/form.ui b/src/form.ui index 952f444..fa4108d 100644 --- a/src/form.ui +++ b/src/form.ui @@ -105,40 +105,59 @@ - - - - false - - - + + + + + true + - Play On Steam + Progress - - - - Install - - - - - - - Play - - - - - + + false - Setting + Open Instances Editor + + + false + + + false + + + false + + + + + + + + 182 + 71 + + + + + 182 + 16777215 + + + + + + + :/assets/minecraft.png + + + Qt::AlignmentFlag::AlignCenter @@ -177,7 +196,111 @@ - + + + + Change Instance Icon + + + + + + + + + + false + + + Setting + + + + + + + false + + + + + + Play On Steam + + + + + + + Play + + + + + + + false + + + + true + + + + Steam Link : + + + + + + + false + + + Add Steam Integration Link + + + + + + + Install + + + + + + + + 16777215 + 16777215 + + + + + + + :/assets/minecraft_lce_title.png + + + false + + + 0 + + + + + + + false + + + + + + + @@ -372,101 +495,6 @@ - - - - false - - - Open Instances Editor - - - false - - - false - - - false - - - - - - - - 182 - 71 - - - - - 182 - 16777215 - - - - - - - :/assets/minecraft.png - - - Qt::AlignmentFlag::AlignCenter - - - - - - - - true - - - - Progress - - - - - - - - 16777215 - 16777215 - - - - - - - :/assets/minecraft_lce_title.png - - - false - - - 0 - - - - - - - Change Instance Icon - - - - - - - - - - Add Steam Integration Link - - - diff --git a/src/lce_qt_launcher/app.py b/src/lce_qt_launcher/app.py index f33c409..183bd95 100644 --- a/src/lce_qt_launcher/app.py +++ b/src/lce_qt_launcher/app.py @@ -5,7 +5,7 @@ from PySide6.QtWidgets import QApplication, QMessageBox from lce_qt_launcher.app_context import AppContext from lce_qt_launcher.models.app_data import AppData -from lce_qt_launcher.views.launcher import Launcher +from lce_qt_launcher.views.launcher import LauncherView from lce_qt_launcher.views.theme import Theme import lce_qt_launcher.views.term_service as term_service @@ -21,7 +21,7 @@ class App(QApplication): _ = self.setStyle("Fusion") - self.widget: Launcher = Launcher(self.appContext, self.appData, self) + self.widget: LauncherView = LauncherView(self.appContext, self.appData, self) self.widget.show() self.set_theme(theme) diff --git a/src/lce_qt_launcher/managers/steam_manager.py b/src/lce_qt_launcher/managers/steam_manager.py index 1a6e255..2ea1100 100644 --- a/src/lce_qt_launcher/managers/steam_manager.py +++ b/src/lce_qt_launcher/managers/steam_manager.py @@ -17,8 +17,13 @@ along with this program. If not, see . """ +from PySide6.QtWidgets import ( + QMessageBox +) + import argparse -import subprocess +# import subprocess +# import os import sys LEGAL_TEXT = """ @@ -29,10 +34,15 @@ LEGAL_TEXT = """ """ def add_instance_to_steam(instance_exe_path : str, instance_name : str, icon : str): + """#TODO _summary_ + + #TODO Args: + instance_exe_path (str): _description_ + instance_name (str): _description_ + icon (str): _description_ + """ try: - # subprocess.run(["steam-shortcuts-cli", "add", instance_name, instance_exe_path, f"--icon=\"{icon}\"", "--tags=\"Sandbox,Minecraft\""]) - - pass + QMessageBox.critical(None, "Critical Error", "Not Implemented Yet") except RuntimeError as err: print(f"Error while adding program to steam : {err}") @@ -60,10 +70,8 @@ def main(): if parsed_cmd_args[0].intance_exe_path == "None": instance_exe_path = input("Enter the instance of path of the exe to add on steam") - if parsed_cmd_args[0].intance_name == "None": instance_name = input("Enter the name of instance to add on steam") - if parsed_cmd_args[0].icon == "None": icon = input("Enter the path of the icon of the instance to add on steam") diff --git a/src/lce_qt_launcher/views/content_installer_dialog.py b/src/lce_qt_launcher/views/content_installer_dialog.py index 379995a..4d2ef20 100644 --- a/src/lce_qt_launcher/views/content_installer_dialog.py +++ b/src/lce_qt_launcher/views/content_installer_dialog.py @@ -1,9 +1,7 @@ -from PySide6.QtWidgets import QDialog, QHBoxLayout, QWidget -from PySide6.QtWebEngineWidgets import QWebEngineView -from PySide6.QtCore import QUrl +from PySide6.QtWidgets import QDialog from lce_qt_launcher.managers import mod_manager -from lce_qt_launcher.ui_contentInstaller import Ui_Dialog +from lce_qt_launcher.ui_contentInstaller import Ui_contentInstallerDialog from lce_qt_launcher.views import term_service @@ -15,7 +13,7 @@ class ContentInstallerView(QDialog): """ def __init__(self) -> None: super().__init__() - self.ui_dialog: Ui_Dialog = Ui_Dialog() + self.ui_dialog: Ui_contentInstallerDialog = Ui_contentInstallerDialog() self.dialog: QDialog = QDialog() self.ui_dialog.setupUi(self.dialog) diff --git a/src/lce_qt_launcher/views/launcher.py b/src/lce_qt_launcher/views/launcher.py index 9db666f..24ea718 100644 --- a/src/lce_qt_launcher/views/launcher.py +++ b/src/lce_qt_launcher/views/launcher.py @@ -1,13 +1,12 @@ -import os -import subprocess - from PySide6.QtWidgets import ( QApplication, QFileDialog, QMainWindow, QLabel, QDialog, - QListWidgetItem + QListWidgetItem, + QInputDialog, + QMessageBox ) from PySide6.QtGui import ( QPalette, @@ -23,6 +22,8 @@ import sys import platform import json import webbrowser +import os +import subprocess from pathlib import Path @@ -38,12 +39,13 @@ from lce_qt_launcher.ui_settingDialog import Ui_settingDialog 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.ui_form import Ui_launcher +from lce_qt_launcher.managers.steam_manager import add_instance_to_steam 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 -class Launcher(QMainWindow): +class LauncherView(QMainWindow): """_summary_ The Main Window / playButtonCommander of the QApplcation Args: @@ -63,7 +65,6 @@ class Launcher(QMainWindow): self.image_label: str = instanceManager.instance.image self.news_feed: str = instanceManager.instance.news_feed self.instance_name: str = instanceManager.instance.name - self.instances : list[Instance] = list() STARTING_GAME_MSG = translator.translate("start_game_msg") @@ -158,6 +159,8 @@ class Launcher(QMainWindow): features.show_about_app(self) def installContentActionCommand() -> None: + """_summary_ Open the Content Installer Window + """ ContentInstallerView() background_pixmap = QPixmap(appContext.BACKGROUND_PIXMAP_IMG) @@ -170,7 +173,6 @@ class Launcher(QMainWindow): term_service.print_error("Cannot set the background") self.ui: Ui_launcher = Ui_launcher() - self.ui.setupUi(self) arguments: list[str] = QApplication.instance().arguments() if not None else "Error" # pyright: ignore[reportOptionalMemberAccess] @@ -185,7 +187,6 @@ class Launcher(QMainWindow): if len(arguments) > 1: file_arg: str = arguments[1] - try: path = Path(file_arg) if path.is_file(): @@ -302,6 +303,20 @@ class Launcher(QMainWindow): open_github_issues = lambda : webbrowser.open(appContext.buildInfo.git_repo_url + "/issues") _ = self.ui.actionReport_a_Bugs_or_Sugess_a_feature.triggered.connect(open_github_issues) + def addSteamLinkIntegrationButtonCommand(): + steamIntegrationDialog = QInputDialog(self) + value = steamIntegrationDialog.getText(self, "Add Steam Integration", "steamid") + if value[1] == True: + self.ui.steamLinkValue.setText(value[0]) + question = QMessageBox() + answer = question.question(self, "Add Instance to Steam Non-Steam Game Shortcuts ?", "Add ") + if answer == QMessageBox.StandardButton.Yes: + full_extention_path = os.path.join(instanceManager.instance.installation_path, instanceManager.instance.exe_name) + add_instance_to_steam(full_extention_path, instanceManager.instance.name, instanceManager.instance.image) + instanceManager.instance.steam_link = value[0] + + _ = self.ui.addSteamLinkIntegration.clicked.connect(addSteamLinkIntegrationButtonCommand) + self.versionlabel: QLabel = QLabel(f"Version {buildInfo.version}") self.ui.statusbar.addPermanentWidget(self.versionlabel) holyday_label: QLabel = QLabel(holiday.get_holiday()) diff --git a/uv.lock b/uv.lock index 51b6d36..354f9cc 100644 --- a/uv.lock +++ b/uv.lock @@ -475,6 +475,7 @@ dependencies = [ { name = "pyside6", marker = "sys_platform == 'darwin' or sys_platform == 'linux' or sys_platform == 'win32'" }, { name = "requests" }, { name = "rich" }, + { name = "vdf" }, ] [package.metadata] @@ -486,6 +487,7 @@ requires-dist = [ { name = "pyside6", marker = "sys_platform == 'darwin' or sys_platform == 'linux' or sys_platform == 'win32'", specifier = ">=6.11.0" }, { name = "requests", specifier = ">=2.33.1" }, { name = "rich", specifier = ">=14.3.3" }, + { name = "vdf" }, ] [[package]] @@ -865,6 +867,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/61/5d/defa29fe617e6f07d4e514089e9d36fd9f44ede869e597e39ff7d69f6917/uv-0.11.8-py3-none-win_arm64.whl", hash = "sha256:a9853456696d579f206135c9dda7227a6ed8311b8a9a0b9b2008c4ae81950efe", size = 23914243, upload-time = "2026-04-27T13:15:07.717Z" }, ] +[[package]] +name = "vdf" +version = "3.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/44/7f/74192f47d67c8bf3c47bf0d8487b3457614c2c98d58b6617721d217f3f79/vdf-3.4.tar.gz", hash = "sha256:fd5419f41e07a1009e5ffd027c7dcbe43d1f7e8ef453aeaa90d9d04b807de2af", size = 11132, upload-time = "2021-05-22T09:26:05.252Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/96/60/6456b687cf55cf60020dcd01f9bc51561c3cc84f05fd8e0feb71ce60f894/vdf-3.4-py2.py3-none-any.whl", hash = "sha256:68c1a125cc49e343d535af2dd25074e9cb0908c6607f073947c4a04bbe234534", size = 10357, upload-time = "2021-05-22T09:26:03.948Z" }, +] + [[package]] name = "virtualenv" version = "21.3.0"