diff --git a/assets/images/chest.png b/assets/images/chest.png
new file mode 100644
index 0000000..77b35fa
Binary files /dev/null and b/assets/images/chest.png differ
diff --git a/assets/images/chest.webp b/assets/images/chest.webp
deleted file mode 100644
index 7c0f51b..0000000
Binary files a/assets/images/chest.webp and /dev/null differ
diff --git a/assets/lce_inst.png b/assets/lce_inst.png
new file mode 100644
index 0000000..77b35fa
Binary files /dev/null and b/assets/lce_inst.png differ
diff --git a/packages/lce_inst-mime.xml b/packages/lce_inst-mime.xml
index af7bb7c..c49ab4c 100644
--- a/packages/lce_inst-mime.xml
+++ b/packages/lce_inst-mime.xml
@@ -7,5 +7,5 @@
-
+
\ No newline at end of file
diff --git a/packages/linux/dev/PKGBUILD b/packages/linux/dev/PKGBUILD
index 4a81df1..eca072d 100644
--- a/packages/linux/dev/PKGBUILD
+++ b/packages/linux/dev/PKGBUILD
@@ -1,6 +1,6 @@
# Maintainer: Xgui4
pkgname=lce-qt-launcher-beta
-pkgver=nightly.r4.g033b43a
+pkgver=nightly.r5.g29b65dd
pkgrel=1
pkgdesc="A custom Minecraft LCE Launcher written in Python and Qt with GNU/Linux support in mind. (Beta Build)"
arch=('any')
@@ -58,4 +58,5 @@ package() {
install -Dm644 "readme.md" "code-of-conduct.md" -t "$pkgdir/usr/share/doc/$pkgname/"
install -Dm644 "packages/io.github.xgui4.lce_qt_launcher.metainfo.xml" "$pkgdir/usr/share/metainfo/io.github.xgui4.lce_qt_launcher.gtk.metainfo.xml"
install -Dm644 "assets/io.github.xgui4.lce_qt_launcher.png" "$pkgdir/usr/share/icons/hicolor/128x128/apps/io.github.xgui4.lce_qt_launcher.png"
+ install -Dm644 "assets/lce_inst.png" "$pkgdir/usr/share/icons/hicolor/128x128/mimetypes/application-lce_inst.png"
}
diff --git a/packages/linux/nigthly/PKGBUILD b/packages/linux/nigthly/PKGBUILD
index 65793dd..17a2109 100644
--- a/packages/linux/nigthly/PKGBUILD
+++ b/packages/linux/nigthly/PKGBUILD
@@ -58,4 +58,5 @@ package() {
install -Dm644 "readme.md" "code-of-conduct.md" -t "$pkgdir/usr/share/doc/$pkgname/"
install -Dm644 "packages/io.github.xgui4.lce_qt_launcher.metainfo.xml" "$pkgdir/usr/share/metainfo/io.github.xgui4.lce_qt_launcher.gtk.metainfo.xml"
install -Dm644 "assets/io.github.xgui4.lce_qt_launcher.png" "$pkgdir/usr/share/icons/hicolor/128x128/apps/io.github.xgui4.lce_qt_launcher.png"
+ install -Dm644 "assets/lce_inst.png" "$pkgdir/usr/share/icons/hicolor/128x128/mimetypes/application-lce_inst.png"
}
diff --git a/packages/linux/stable/PKGBUILD b/packages/linux/stable/PKGBUILD
index 284b9f2..965efad 100644
--- a/packages/linux/stable/PKGBUILD
+++ b/packages/linux/stable/PKGBUILD
@@ -51,4 +51,5 @@ package() {
install -Dm644 "readme.md" "code-of-conduct.md" -t "$pkgdir/usr/share/doc/$pkgname/"
install -Dm644 "packages/io.github.xgui4.lce_qt_launcher.metainfo.xml" "$pkgdir/usr/share/metainfo/io.github.xgui4.lce_qt_launcher.gtk.metainfo.xml"
install -Dm644 "assets/io.github.xgui4.lce_qt_launcher.png" "$pkgdir/usr/share/icons/hicolor/128x128/apps/io.github.xgui4.lce_qt_launcher.png"
+ install -Dm644 "assets/lce_inst.png" "$pkgdir/usr/share/icons/hicolor/128x128/mimetypes/application-lce_inst.png"
}
diff --git a/packages/windows/windows-setup.iss b/packages/windows/windows-setup.iss
index 8eb787b..f466959 100644
--- a/packages/windows/windows-setup.iss
+++ b/packages/windows/windows-setup.iss
@@ -34,15 +34,15 @@ ArchitecturesAllowed=x64compatible
; the 64-bit view of the registry.
ArchitecturesInstallIn64BitMode=x64compatible
ChangesAssociations=yes
-LicenseFile=..\license.md
-InfoBeforeFile=..\code-of-conduct.md
-InfoAfterFile=..\lisezmoi.md
+LicenseFile=..\..\license.md
+InfoBeforeFile=..\..\code-of-conduct.md
+InfoAfterFile=..\..\lisezmoi.md
; Uncomment the following line to run in non administrative install mode (install for current user only).
;PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
OutputDir=.
OutputBaseFilename=lce-qt-launcher-windows-setup
-SetupIconFile=..\assets\setup.ico
+SetupIconFile=..\..\assets\setup.ico
SolidCompression=yes
WizardStyle=modern dark polar
@@ -54,8 +54,8 @@ Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
-Source: "..\dist\main.dist\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
-Source: "..\dist\main.dist\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
+Source: "..\..\dist\main.dist\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
+Source: "..\..\dist\main.dist\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Registry]
diff --git a/pyproject.toml b/pyproject.toml
index 0a22e05..f351dbe 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -25,7 +25,7 @@ dependencies = [
lce-qt-launcher = "lce_qt_launcher.main:main"
[project.urls]
-Repository = "https://:github.com/xgui4/LCE-QT-Launcher"
+Repository = "https://github.com/xgui4/LCE-QT-Launcher"
LicenseURL = "https://www.gnu.org/licenses/gpl-3.0"
[tool.hatch.build.targets.wheel.hooks.custom]
@@ -35,6 +35,9 @@ path = "hatch_build.py"
packages = "python packages.py"
run-app = "python run.py"
+[tool.pyright]
+reportImportCycles="hint"
+
[tool.hatch.build]
artifacts = [
"src/lce_qt_launcher/ui_*.py",
diff --git a/readme.md b/readme.md
index 09db576..1c6d3f7 100644
--- a/readme.md
+++ b/readme.md
@@ -3,22 +3,22 @@
[French Version](lisezmoi.md)

-
+
> [!WARNING]
> This launcher is work in progress and its feature could be changes or remove at any time.
> PR are more than welcome to fix or add features. Just be compliant with the [GPLv3 license](license.md) and the [Code of Respect](code-of-conduct.md)
-## About
+## About
This is a custom Minecraft LCE Launcher written in Python and Qt with Freedom and with GNU/Linux support in mind.
-## Features
+## Features
- Command Line interface (CLI)
- Qt 6 GUI (Native like Interface)
- Written in Python (No Electron or Rust)
-- Customisable
+- Customisable
- Free Software (GPLv3)
- Multiple Instances (Work in progress)
- localisations (Work in progress)
@@ -30,22 +30,22 @@ This is a custom Minecraft LCE Launcher written in Python and Qt with Freedom an
- in-app news
- Minecraft Theme pre-configured
-## Long Term Goal
+## Long Term Goal
-- Accessibility
+- Accessibility
- GNU/Linux compatibility
- Windows support
-- Experimental FreeBSD support
-- Focus on being the main hub for Minecraft LCE on GNU/Linux
+- Experimental FreeBSD support
+- Focus on being the main hub for Minecraft LCE on GNU/Linux
-## How to run
+## How to run
### VSCode
1. Create a Python Virtual Env via a tool like UV
2. Set VSCode to that Python Virtual Env
3. Run "Pyside : Sync Virtual Env and Launch"
-4. Run the app via Vscode debug mode or directly the [`src/main.py`](src/main.py) file.
+4. Run the app via Vscode debug mode or directly the [`src/main.py`](src/main.py) file.
### Others
@@ -54,61 +54,61 @@ Guide coming laters
## How to build
Coming in the next stable release when the program will be more stable
-
+
## Nigthly Build
> [!NOTE]
> This automatic nighly build is currently not-stable and is very experimental and in active developpement
-> This branch is not stable and changes are made almost daily so this branch can sometimes break. Also, MacOS is not avaiable in the Nigthly Build due to Apple restriction and that I do now own a mac.
+> This branch is not stable and changes are made almost daily so this branch can sometimes break. Also, MacOS is not avaiable in the Nigthly Build due to Apple restriction and that I do now own a mac.
In this [GitHub Release](https://github.com/xgui4/LCE-Qt-Launcher/releases/tag/nightly) page you will found Nighly Build which are made automatically via GitHub Action when change are made in the `nighly` branch
-## Software Requirement
+## Software Requirement
- [Python 3.11 (For FreeBSD) to Python 3.12 (GNU/Linux, Windows and MacOS)](https://www.python.org)
- - with a virtual env with the required library install (specified in the readme and [`pyproject.toml`](pyproject.toml))
+ - with a virtual env with the required library install (specified in the readme and [`pyproject.toml`](pyproject.toml))
- [PySide6](https://pypi.org/project/PySide6/)
-- [Monocraft Font](https://github.com/IdreesInc/Monocraft) installed
+- [Monocraft Font](https://github.com/IdreesInc/Monocraft) installed
- For UNIX like system
- - A display server or compositor (Except on MacOS where it use its own proprietary one)
- - Bash (normally pre-installed on Linux but often demand installation in *BSD and MacOS)
+ - A display server or compositor (Except on MacOS where it use its own proprietary one)
+ - Bash (normally pre-installed on Linux but often demand installation in *BSD and MacOS)
-## Python Library and Tools Used
+## Python Library and Tools Used
- - PySide 6
- - requests
- - rich
- - hatch
- - uv
+- PySide 6
+- requests
+- rich
+- hatch
+- uv
## Compatible Operating System
### Golden Support
- Windows 10 and later
-- GNU/Linux
+- GNU/Linux
-### Experimental Support
+### Experimental Support
- FreeBSD
### Unsupported OS
- Other *BSD system, as Minecraft LCE is not supported on those and Wine is not available.
-- Minecraft LCE on Android is currently quite laggy and buggy
+- Minecraft LCE on Android is currently quite laggy and buggy
- macOS: LCE Qt Launcher does not officially support MacOS and is not tested during PRs, but POISX compatibility should allow its use.
-## Thank to
+## Thank to
-- [Prism Launcher](https://github.com/PrismLauncher/PrismLauncher) for certain UI elements and ui files
+- [Prism Launcher](https://github.com/PrismLauncher/PrismLauncher) for certain UI elements and ui files
- [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
-## Code of Respect
+## Code of Respect
- [English](code-of-conduct.md)
- [French](CODE-DE-CONDUITE.md)
## License
-[GPLV3](license.md)
\ No newline at end of file
+[GPLV3](license.md)
diff --git a/res.qrc b/res.qrc
index d2cac35..316a8db 100644
--- a/res.qrc
+++ b/res.qrc
@@ -18,7 +18,7 @@
assets/images/internet-4jcraft-ico.png
assets/images/internet-lce-evolved-ico.png
assets/images/internet-lce-hub-ico.png
- assets/images/chest.webp
+ assets/images/chest.png
assets/styles/minecraft.qss
diff --git a/src/lce_qt_launcher/__init__.py b/src/lce_qt_launcher/__init__.py
index f515d40..a95898f 100644
--- a/src/lce_qt_launcher/__init__.py
+++ b/src/lce_qt_launcher/__init__.py
@@ -1,7 +1,7 @@
from enum import StrEnum
FALLBACK_APP_NAME = "LCE Qt Launcher"
-FALLBACK_VERSION_NUMBER = "0.0.1b0"
+FALLBACK_VERSION_NUMBER = "0.0.1b1"
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"
@@ -11,9 +11,7 @@ INSTANCE_EXTENSION = ".lce_inst"
AUTHORS = "Xgui4"
class Languages(StrEnum):
- """
- _summary_ : "Language Codes for JsonTrans"
- """
+ """ _summary_ : "Language Codes for JsonTrans """
FALLBACK = "translations.json"
ENGLISH = "en"
FRENCH = "fr"
diff --git a/src/lce_qt_launcher/app_context.py b/src/lce_qt_launcher/app_context.py
index 15ca6d7..090c311 100644
--- a/src/lce_qt_launcher/app_context.py
+++ b/src/lce_qt_launcher/app_context.py
@@ -1,6 +1,8 @@
from __future__ import annotations
from typing import TYPE_CHECKING
+from lce_qt_launcher.views import term_service
+
if TYPE_CHECKING:
from lce_qt_launcher.models.app_data import AppData
@@ -32,7 +34,7 @@ class AppContext():
self.translator: JsonTrans = JsonTrans(appData, lang)
self.accesibleModeEnabled : bool = self.userPref.default_accesibility_mode
self.devModeEnabled : bool = self.userPref.default_developper_mode
- self.showHolydayEnabled : bool = self.userPref.default_show_holyday
+ self.showHolidayEnabled : bool = self.userPref.default_show_holiday
self.currentLang : str = Languages.FALLBACK.value
self.BACKGROUND_PIXMAP_IMG : str = ":/assets/background.png"
@@ -49,14 +51,6 @@ class AppContext():
self.theme = theme
self.userPref.set_theme_pref(theme.value)
- def updateInstanceWithFile(self, instance_file_path : str) -> None:
- """_summary_ TODO : WAS BROKEN, to be fixed.
-
- Args:
- instance_file_path (str): _description_
- """
- pass
-
def updateInstance(self, instance : Instance) -> None:
"""_summary_ #TODO : TBW
@@ -72,4 +66,37 @@ class AppContext():
lang (str): _description_
"""
self.currentLang = lang
- self.translator.load_lang(lang)
\ No newline at end of file
+ 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
\ No newline at end of file
diff --git a/src/lce_qt_launcher/features.py b/src/lce_qt_launcher/features.py
index d490a69..3f6c034 100644
--- a/src/lce_qt_launcher/features.py
+++ b/src/lce_qt_launcher/features.py
@@ -170,14 +170,14 @@ def save_instance_to_file(parent : QWidget, instanceManager : InstanceManager,
f"{buildInfo.app_name} Instance File (*{buildInfo.instance_extension})")[0]
instanceManager.save_instance(file_name)
-def launch_cli_interface(instance_man : InstanceManager, buildInfo : BuildInfo) -> None:
+def launch_cli_interface(instance_man : InstanceManager) -> None:
"""_summary_ Launch the cli version of the app
Args:
instance_man (InstanceManager): _description_ : The instance manager to use
buildInfo (BuildInfo): _description_ : The The Build info for the app info
"""
- cli.launch_cli(instance_man, buildInfo)
+ cli.launch_cli(instance_man)
def generate_user_config(userPref : UserPref) -> None:
"""_summary_ Generate the default config
diff --git a/src/lce_qt_launcher/main.py b/src/lce_qt_launcher/main.py
index 166e0e4..af2856b 100755
--- a/src/lce_qt_launcher/main.py
+++ b/src/lce_qt_launcher/main.py
@@ -7,8 +7,8 @@
# nuitka-project: --include-data-dir=data=data
# nuitka-project: --include-qt-plugins=sensible
# nuitka-project: --windows-console-mode=force
-# nuitka-project: --product-version="1.0.0.1"
-# nuitka-project: --file-version="1.0.0.1"
+# nuitka-project: --product-version="1.0.0.11"
+# nuitka-project: --file-version="1.0.0.11"
# nuitka-project: --file-description="Custom Free/Libre Minecraft LCE Launcher (Nightly)"
# nuitka-projet: --include-distribution-metadata=lce-qt-launcher
# nuitka-project: --copyright="Copyleft Xgui4 2026 (GPLv3)"
@@ -31,8 +31,6 @@
along with this program. If not, see .
"""
-from lce_qt_launcher.managers.system_manager import SystemManager
-
from PySide6.QtWidgets import (
QMessageBox,
QFileDialog
@@ -43,6 +41,9 @@ from lce_qt_launcher.views import term_service
from lce_qt_launcher.views.cmd_arg import CmdArgAction, parse_args, argsDetected, launch_cmd_action
from lce_qt_launcher.app_context import AppContext
from lce_qt_launcher.app import App
+from lce_qt_launcher.managers.system_manager import SystemManager
+from lce_qt_launcher.views.theme import Theme
+import lce_qt_launcher.views.theme as theme
import sys
import os
@@ -60,21 +61,29 @@ def main() -> None:
userPref = appContext.userPref
- user_language = userPref.get_language_pref()
- user_theme = userPref.get_theme_pref()
- show_holyday = userPref.get_show_holyday()
- developer_mode = userPref.get_developper_mode()
- accessible_mode = userPref.get_accesible_mode()
+ user_language: str = userPref.get_language_pref()
+ user_theme: str = userPref.get_theme_pref()
+ show_holiday: str = userPref.get_show_holiday()
+ developer_mode: str = userPref.get_developper_mode()
+ accessible_mode: str = userPref.get_accesible_mode()
+
+ try:
+ selected_theme: Theme = theme.from_str_to_theme(user_theme)
+ appContext.updateTheme(selected_theme)
+ appContext.updateShowHolidayStatus(show_holiday)
+ appContext.updateSetDevMoodeStatus(developer_mode)
+ appContext.updateSetAccesbilityMoodeStatus(accessible_mode)
+ except RuntimeError as err:
+ term_service.print_error(str(err))
appContext.updateLanguage(user_language)
- # appContext.updateTheme(user_theme) # TODO : convert str to Theme Enum
except:
term_service.print_error("They were a error while loading the system theme or user preference.")
- def about_to_quit_event():
- instance_manager_label = appContext.translator.translate("instance_manager_label")
- save_instance_msg_box_label = appContext.translator.translate("save_instance_msg_box_label")
- save_filedialog_title = appContext.translator.translate("save_filedialog_title")
+ def about_to_quit_event() -> None:
+ instance_manager_label: str = appContext.translator.translate("instance_manager_label")
+ save_instance_msg_box_label: str = appContext.translator.translate("save_instance_msg_box_label")
+ save_filedialog_title: str = appContext.translator.translate("save_filedialog_title")
question_options = QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No
anwser = QMessageBox.question(None, instance_manager_label, save_instance_msg_box_label, question_options)
if anwser == QMessageBox.StandardButton.Yes:
diff --git a/src/lce_qt_launcher/managers/system_manager.py b/src/lce_qt_launcher/managers/system_manager.py
index cfa6304..8b8b305 100644
--- a/src/lce_qt_launcher/managers/system_manager.py
+++ b/src/lce_qt_launcher/managers/system_manager.py
@@ -19,8 +19,7 @@ class OperatingSystemType(StrEnum):
UNKNOWN = "Unknown"
class SystemManager():
- """_summary_ Multiples Utilises to interact with the system
- """
+ """_summary_ Multiples Utilises to interact with the system """
def __init__(self) -> None:
self.type : OperatingSystemType = OperatingSystemType.UNKNOWN
self.name : str = "Unknown"
@@ -29,8 +28,7 @@ class SystemManager():
self.determine_os_info()
def determine_os_info(self) -> None:
- """_summary_ Assert the OS and its Info
- """
+ """_summary_ Assert the OS and its Info """
if (platform.system() == "Linux") :
self.type = OperatingSystemType.LINUX
self.name = self.type.name
@@ -57,6 +55,7 @@ class SystemManager():
self.version = platform.version()
def adapt_qt_system_theme(self) -> None:
+ """_summary_ Set the Qt Theme to the System on GNU/Linux and FreeBSD"""
if platform.system() == "Linux":
_LINUX_QT6_PATH = "/usr/lib/qt6/plugins"
os.environ["QT_PLUGIN_PATH"] = _LINUX_QT6_PATH
@@ -80,13 +79,18 @@ class SystemManager():
return "Non POSIX System."
def open_url_with_system(self, url_str : str) -> None:
+ """_summary_ Open a URL/file with the system
+
+ Args:
+ url_str (str): _description_ the url of the file
+ """
url = QUrl(url_str)
service = QDesktopServices()
- service.openUrl(url)
+ _ = service.openUrl(url)
def found_default_save_path(self) -> str:
"""
- ! DEPRECIATED
+ #! DEPRECIATED
FIXME - REMOVE THIS FUNCTION AND REPLACE IT WITH OTHERS
"""
diff --git a/src/lce_qt_launcher/models/app_data.py b/src/lce_qt_launcher/models/app_data.py
index c40a2f8..3876295 100644
--- a/src/lce_qt_launcher/models/app_data.py
+++ b/src/lce_qt_launcher/models/app_data.py
@@ -32,7 +32,9 @@ class AppData(QObject):
self.load_insts_list_into_mem()
def load_insts_list_into_mem(self) -> None:
- """#TODO : make it so it also work on both user and system (site) dir if needed. """
+ """#TODO : make it so it also work on both user and system (site) dir if needed.
+ #TODO : docstring
+ """
defaults_insts_dir : Path = Path(os.path.join(self.appDataDirs[0], "instances"))
if not defaults_insts_dir.exists():
return
@@ -50,6 +52,11 @@ class AppData(QObject):
self.instsList = instancesLists
def _get_source_dir(self) -> str:
+ """_summary_ TODO : docstring
+
+ Returns:
+ str: _description_
+ """
if _is_compiled() or _is_installed():
return os.path.dirname(os.path.abspath(__file__))
else:
@@ -57,6 +64,11 @@ class AppData(QObject):
return str(dir.parent)
def _get_project_root_dir(self) -> str:
+ """_summary_ TODO : docstring
+
+ Returns:
+ str: _description_
+ """
if _is_compiled() or _is_installed():
return os.path.dirname(os.path.abspath(__file__))
else:
@@ -64,23 +76,53 @@ class AppData(QObject):
return str(dir.parent.parent.parent)
def _get_locales_dir(self) -> str:
+ """_summary_ TODO : docstring
+
+ Returns:
+ str: _description_
+ """
return os.path.join(self._get_project_root_dir(),"assets", "languages")
def _get_assets_dir(self) -> str:
+ """_summary_ TODO : docstring
+
+ Returns:
+ str: _description_
+ """
return os.path.join(self._get_project_root_dir(), "assets")
def _get_user_app_data_dir(self) -> str:
+ """_summary_ TODO : docstring
+
+ Returns:
+ str: _description_
+ """
dirs: PlatformDirs = PlatformDirs("Xgui4", "LCE-Qt-Launcher")
return dirs.user_data_dir
def _get_site_app_data_dir(self) -> str:
+ """_summary_ TODO : docstring
+
+ Returns:
+ str: _description_
+ """
dirs: PlatformDirs = PlatformDirs("Xgui4", "LCE-Qt-Launcher")
return dirs.site_data_dir
def _get_app_cache_dir(self) -> str:
+ """_summary_ TODO : docstring
+
+ Returns:
+ str: _description_
+ """
dirs: PlatformDirs = PlatformDirs("Xgui4", "LCE-Qt-Launcher")
return dirs.user_cache_dir
def _get_app_log_dir(self) -> str:
+ """_summary_ TODO : docstring
+
+ Returns:
+ str: _description_
+ """
dirs: PlatformDirs = PlatformDirs("Xgui4", "LCE-Qt-Launcher")
return dirs.user_log_dir
\ No newline at end of file
diff --git a/src/lce_qt_launcher/models/image_class.py b/src/lce_qt_launcher/models/image_class.py
index 4f424bf..27cf1a2 100644
--- a/src/lce_qt_launcher/models/image_class.py
+++ b/src/lce_qt_launcher/models/image_class.py
@@ -8,6 +8,11 @@ from lce_qt_launcher.managers.downloader import Downloader
import os
class SourceType(Enum):
+ """_summary_ The type of source of a image
+
+ Args:
+ Enum (_type_): _description_ : inherited from Enum
+ """
LOCAL = 0
QT_RESSOURCE = 1
INTERNET = 2
@@ -24,7 +29,6 @@ class Image(QObject):
def __init__(self,
location : str,
filename : str,
- img_type : str,
source : SourceType,
appContext : AppContext) -> None:
super().__init__(None)
diff --git a/src/lce_qt_launcher/models/preferences.py b/src/lce_qt_launcher/models/preferences.py
index 08f8a32..74432a0 100644
--- a/src/lce_qt_launcher/models/preferences.py
+++ b/src/lce_qt_launcher/models/preferences.py
@@ -8,7 +8,7 @@ from lce_qt_launcher.views.theme import Theme
_THEME_OPTION : str = "customisation/theme"
_INSTANCE_PATH_OPTION : str = "preferences/default_path"
_LANGUAGE_OPTION : str = "preferences/languages"
-_SHOW_HOLYDAY_OPTION : str = "views/show_hoyday_enabled"
+_SHOW_HOLIDAY_OPTION : str = "views/show_hoyday_enabled"
_DEVELOPPER_MODE_OPTION : str = "developper/dev_mode_enabled"
_ACCESIBLE_MODE_OPTION : str = "accesibility/accesibility_mode_enabled"
@@ -23,7 +23,7 @@ class UserPref (QSettings):
self.default_theme : Theme = Theme.MINECRAFT
self.default_instance_path : str = "~/.local/share/lce_qt_launcher/default"
self.default_language : str = "en"
- self.default_show_holyday : bool = True
+ self.default_show_holiday : bool = True
self.default_accesibility_mode : bool = False
self.default_developper_mode : bool = False
@@ -64,18 +64,18 @@ class UserPref (QSettings):
"""
return str(self.value(_INSTANCE_PATH_OPTION, self.default_instance_path, type=str))
- def set_show_holyday(self, show_holyday_bool : bool) -> None:
- """_summary_ Show Holyday Toggle Setter
+ def set_show_holiday(self, show_holiday_bool : bool) -> None:
+ """_summary_ Show Holiday Toggle Setter
"""
- super().setValue(_SHOW_HOLYDAY_OPTION, show_holyday_bool)
+ super().setValue(_SHOW_HOLIDAY_OPTION, show_holiday_bool)
super().sync()
- def get_show_holyday(self) -> str:
- """_summary_ Show Holyday Toggle Getter
+ def get_show_holiday(self) -> str:
+ """_summary_ Show Holiday Toggle Getter
Returns:
str: _description_ show holyday preference
"""
- return str(self.value(_SHOW_HOLYDAY_OPTION, self.default_show_holyday, type=str))
+ return str(self.value(_SHOW_HOLIDAY_OPTION, self.default_show_holiday, type=str))
def set_accesible_mode(self, accesbility_mode_bool : bool) -> None:
"""_summary_ Accessiblty Mode Sette
@@ -115,7 +115,7 @@ class UserPref (QSettings):
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_holyday(self.default_show_holyday)
+ self.set_show_holiday(self.default_show_holiday)
self.set_accesible_mode(self.default_accesibility_mode)
self.set_accesible_mode(self.default_developper_mode)
super().sync()
diff --git a/src/lce_qt_launcher/utils/holiday.py b/src/lce_qt_launcher/utils/holiday.py
index eb61c78..61cb0d2 100644
--- a/src/lce_qt_launcher/utils/holiday.py
+++ b/src/lce_qt_launcher/utils/holiday.py
@@ -2,6 +2,7 @@ from datetime import datetime
from enum import Enum
class MONTH(Enum):
+ """_summary_ The 12 Month as Enum (Start from 1 and go to 12) d"""
JANUARY = 1
FEBRURAY = 2
MARCH = 3
@@ -15,7 +16,7 @@ class MONTH(Enum):
NOVEMBER = 11
DECEMBER = 12
-HOLIDAYS = {
+HOLIDAYS: dict[str, str] = {
f"{MONTH.JANUARY.value}-1": "Happy New Years Day! π",
f"{MONTH.FEBRURAY.value}-14": "Happy Valentine Day! π",
f"{MONTH.APRIL.value}-1": "April Fool Day π",
@@ -29,7 +30,7 @@ HOLIDAYS = {
f"{MONTH.DECEMBER.value}-31": "New Year Eve π"
}
-HOLIDAYS_FRENCH = {
+HOLIDAYS_FRENCH: dict[str, str] = {
f"{MONTH.JANUARY.value}-1": "Bonne annΓ©e ! π",
f"{MONTH.FEBRURAY.value}-14": "Bonne Saint-Valentin ! π",
f"{MONTH.APRIL.value}-1": "Poisson d'avril π",
diff --git a/src/lce_qt_launcher/views/cli.py b/src/lce_qt_launcher/views/cli.py
index f651c5f..d510b45 100644
--- a/src/lce_qt_launcher/views/cli.py
+++ b/src/lce_qt_launcher/views/cli.py
@@ -1,10 +1,9 @@
from sys import argv
from lce_qt_launcher.managers.instance_manager import InstanceManager
-from lce_qt_launcher.build_info import BuildInfo
import lce_qt_launcher.views.term_service as term_service
-def launch_cli(instance_man : InstanceManager, build_info : BuildInfo) -> None:
+def launch_cli(instance_man : InstanceManager) -> None:
"""
_summary_ : launch the cli interface
diff --git a/src/lce_qt_launcher/views/cmd_arg.py b/src/lce_qt_launcher/views/cmd_arg.py
index 5ac6700..661f512 100644
--- a/src/lce_qt_launcher/views/cmd_arg.py
+++ b/src/lce_qt_launcher/views/cmd_arg.py
@@ -89,6 +89,6 @@ def launch_cmd_action(action : CmdArgAction, appContext : AppContext) -> None:
elif action == CmdArgAction.PRINT_VERSION:
features.display_version(appContext.buildInfo)
elif action == CmdArgAction.CLI_VERSION:
- features.launch_cli_interface(appContext.instanceMan, appContext.buildInfo)
+ features.launch_cli_interface(appContext.instanceMan)
else:
term_service.print_information("Not Implemented Yet!")
\ No newline at end of file
diff --git a/src/lce_qt_launcher/views/setting_dialog.py b/src/lce_qt_launcher/views/setting_dialog.py
index 8940365..f327070 100644
--- a/src/lce_qt_launcher/views/setting_dialog.py
+++ b/src/lce_qt_launcher/views/setting_dialog.py
@@ -8,5 +8,5 @@ class SettingDialog(QDialog):
super().__init__()
self.setting_dialog: QDialog = QDialog(parent)
self.ui_setting: Ui_settingDialog = ui_setting
- self.ui_setting.setupUi(self.setting_dialog)
+ self.ui_setting.setupUi(self.setting_dialog) # pyright: ignore[reportUnknownMemberType]
self.setting_dialog.show()
\ No newline at end of file
diff --git a/src/lce_qt_launcher/views/theme.py b/src/lce_qt_launcher/views/theme.py
index 66a712e..2b8b8a5 100644
--- a/src/lce_qt_launcher/views/theme.py
+++ b/src/lce_qt_launcher/views/theme.py
@@ -1,3 +1,4 @@
+from ctypes import ArgumentError
from enum import StrEnum
class Theme(StrEnum):
@@ -5,4 +6,12 @@ class Theme(StrEnum):
MINECRAFT = ":/styles/minecraft.qss"
DARK = ":/styles/dark.qss"
LIGHT = ":/sytles/light.qss"
- SYSTEM = ""
\ No newline at end of file
+ SYSTEM = ""
+
+def from_str_to_theme(string : str) -> Theme:
+ match string:
+ case ":/styles/minecraft.qss": return Theme.MINECRAFT
+ case ":/styles/dark.qss": return Theme.DARK
+ case ":/sytles/light.qss" : return Theme.LIGHT
+ case "": return Theme.SYSTEM
+ case _ : raise ArgumentError(f"{string} is not a valid theme")
\ No newline at end of file