diff --git a/assets/information-point.svg b/assets/information-point.svg new file mode 100644 index 0000000..5740974 --- /dev/null +++ b/assets/information-point.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/settings.svg b/assets/settings.svg new file mode 100644 index 0000000..7526cd7 --- /dev/null +++ b/assets/settings.svg @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/assets/shortcut.svg b/assets/shortcut.svg new file mode 100644 index 0000000..9e6739e --- /dev/null +++ b/assets/shortcut.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/resources.qrc b/resources.qrc index 5ed8b72..53a66ff 100644 --- a/resources.qrc +++ b/resources.qrc @@ -1,5 +1,8 @@ + assets/settings.svg + assets/shortcut.svg + assets/information-point.svg assets/no_whitelist.svg assets/closed-store-info.svg assets/letter-i-info.svg diff --git a/src/config/constants.py b/src/config/constants.py index fc14623..6b81523 100644 --- a/src/config/constants.py +++ b/src/config/constants.py @@ -3,6 +3,11 @@ from enum import Enum from PySide6.QtGui import QColor +# --------------------------------------------------------------------------- +# Launcher Version +# --------------------------------------------------------------------------- +VERSION = "0.9.0" + # --------------------------------------------------------------------------- # Callback return message. ⚠️ Ne pas supprimer $LOGO$ # --------------------------------------------------------------------------- diff --git a/src/fivemserver/fivemlauncher.py b/src/fivemserver/fivemlauncher.py index 9205ffd..d02f296 100644 --- a/src/fivemserver/fivemlauncher.py +++ b/src/fivemserver/fivemlauncher.py @@ -20,7 +20,7 @@ class FiveMLauncher: self.fivem_path = os.path.expandvars(fivem_path) @staticmethod - def launch(): + def launch(fimveurl: str): """ Launches an external application by opening the specified URL using the subprocess module. @@ -35,5 +35,4 @@ class FiveMLauncher: :return: None """ - subprocess.Popen(f"explorer {Urls.FIVEMURL.value}") - #subprocess.Popen(r'explorer fivem://connect/prod.la-taniere.fun') + subprocess.Popen(f"explorer {fimveurl}") diff --git a/src/resources.py b/src/resources.py index 3a36819..86229cd 100644 --- a/src/resources.py +++ b/src/resources.py @@ -167871,6 +167871,260 @@ c-0.2,0.5-0.6,0.\ 6.5,91.5,76.9z\x22/\ >\x0a\x0d\x0a\x0d\x0a\x0d<\ /svg>\ +\x00\x00\x01\xd7\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22utf\ +-8\x22?>\x0d\x0a\ +\ +\x00\x00\x06\x88\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22iso\ +-8859-1\x22?>\x0d\x0a\x0d\x0a\x0d\x0a\x0d\x0a\x0d\ +\x0a\ +\x00\x00\x07\x10\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22iso\ +-8859-1\x22?>\x0d\x0a\x0d\x0a\x0d\x0a\ +\x0d\x0a\x09\x0d\x0a\x09\x0d\x0a\x09\x0d\x0a\x09\x0d\x0a\x09\x0d\x0a\x09\x0d\x0a\x09\x0d\x0a\x09\x0d\ +\x0a\x09\ +\x0d\x0a\x09\x0d\x0a\x09\x0d\x0a\x0d\x0a\ \x00\x00\x87\xd4\ \x00\ \x00\x01\x00\x06\x00\x00\x00\x00\x00\x01\x00\x18\x00%,\x00\ @@ -181286,6 +181540,19 @@ qt_resource_name = b"\ \x00c\ \x00l\x00o\x00s\x00e\x00d\x00-\x00s\x00t\x00o\x00r\x00e\x00-\x00i\x00n\x00f\x00o\ \x00.\x00s\x00v\x00g\ +\x00\x0c\ +\x05\xf9\x89\x87\ +\x00s\ +\x00h\x00o\x00r\x00t\x00c\x00u\x00t\x00.\x00s\x00v\x00g\ +\x00\x0c\ +\x0b\xdf,\xc7\ +\x00s\ +\x00e\x00t\x00t\x00i\x00n\x00g\x00s\x00.\x00s\x00v\x00g\ +\x00\x15\ +\x052\xb4\xa7\ +\x00i\ +\x00n\x00f\x00o\x00r\x00m\x00a\x00t\x00i\x00o\x00n\x00-\x00p\x00o\x00i\x00n\x00t\ +\x00.\x00s\x00v\x00g\ \x00\x08\ \x0aaF\x7f\ \x00I\ @@ -181339,33 +181606,39 @@ qt_resource_name = b"\ qt_resource_struct = b"\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ \x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00\x00\x00\x02\x00\x00\x00\x0e\x00\x00\x00\x02\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x11\x00\x00\x00\x02\ \x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x01\xba\x00\x00\x00\x00\x00\x01\x00+\xdd\xc1\ +\x00\x00\x02&\x00\x00\x00\x00\x00\x01\x00+\xed<\ \x00\x00\x01\x9c\x0ft\xac\xa3\ -\x00\x00\x01\x0a\x00\x00\x00\x00\x00\x01\x00)\x91\xbe\ +\x00\x00\x01v\x00\x00\x00\x00\x00\x01\x00)\xa19\ \x00\x00\x01\x9c\xeb\xa8\xd4\xe5\ -\x00\x00\x01F\x00\x00\x00\x00\x00\x01\x00+\xce\x0b\ +\x00\x00\x01\xb2\x00\x00\x00\x00\x00\x01\x00+\xdd\x86\ \x00\x00\x01\x9c\xc2[\x94\xd7\ -\x00\x00\x00\xde\x00\x00\x00\x00\x00\x01\x00)\x8c\xe7\ +\x00\x00\x01J\x00\x00\x00\x00\x00\x01\x00)\x9cb\ \x00\x00\x01\x9c\xb4\xac\xf5\xd6\ -\x00\x00\x010\x00\x00\x00\x00\x00\x01\x00)\x9c\x9b\ +\x00\x00\x00\xd8\x00\x00\x00\x00\x00\x01\x00)\x03\x91\ +\x00\x00\x01\x9d>\x0fF\xc1\ +\x00\x00\x01\x9c\x00\x00\x00\x00\x00\x01\x00)\xac\x16\ \x00\x00\x01\x9c\xbe/\x16\xe5\ +\x00\x00\x00\x9c\x00\x00\x00\x00\x00\x01\x00(\xfb*\ +\x00\x00\x01\x9d>\x1b|\xe4\ \x00\x00\x00l\x00\x00\x00\x00\x00\x01\x00(\xeb\xa0\ \x00\x00\x01\x9c\xed\xb0\x12q\ \x00\x00\x00\x12\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ \x00\x00\x01\x9c\xd8\xa1X\x0f\ -\x00\x00\x00\x9c\x00\x00\x00\x00\x00\x01\x00(\xfb*\ +\x00\x00\x01\x08\x00\x00\x00\x00\x00\x01\x00)\x0a\xa5\ \x00\x00\x01\x9c\xd9\xa2\xfa\xf9\ -\x00\x00\x02\x0e\x00\x00\x00\x00\x00\x01\x00,7\xc6\ +\x00\x00\x02z\x00\x00\x00\x00\x00\x01\x00,GA\ \x00\x00\x01\x9d\x16B\x01\xc7\ -\x00\x00\x00\xb2\x00\x00\x00\x00\x00\x01\x00)\x83\x02\ +\x00\x00\x01\x1e\x00\x00\x00\x00\x00\x01\x00)\x92}\ \x00\x00\x01\x9c\xed\xb0@\xf2\ -\x00\x00\x01\xea\x00\x00\x00\x00\x00\x01\x00,1\x15\ +\x00\x00\x00\xba\x00\x00\x00\x00\x00\x01\x00(\xfd\x05\ +\x00\x00\x01\x9d>\x1d/I\ +\x00\x00\x02V\x00\x00\x00\x00\x00\x01\x00,@\x90\ \x00\x00\x01\x9c\xc2_\xde\x0e\ -\x00\x00\x01l\x00\x00\x00\x00\x00\x01\x00+\xd3\x19\ +\x00\x00\x01\xd8\x00\x00\x00\x00\x00\x01\x00+\xe2\x94\ \x00\x00\x01\x9c\xed\xb1\xd6d\ -\x00\x00\x01\x94\x00\x00\x00\x00\x00\x01\x00+\xd5\xc6\ +\x00\x00\x02\x00\x00\x00\x00\x00\x00\x01\x00+\xe5A\ \x00\x00\x01\x9c\xdb\xd8Z\xd7\ \x00\x00\x00D\x00\x00\x00\x00\x00\x01\x00(\xe0,\ \x00\x00\x01\x9c\xc2i;\xb8\ diff --git a/src/tools/windows_shortcuts.py b/src/tools/windows_shortcuts.py new file mode 100644 index 0000000..0a815bf --- /dev/null +++ b/src/tools/windows_shortcuts.py @@ -0,0 +1,88 @@ +import os +import sys +from win32com.client import Dispatch +from ui.custom_message_box import CustomMessageBox + + +def _get_executable_path(): + """ + Determines the path of the currently executing script or executable. + + For Python scripts, it returns the absolute path of the script being executed. + For frozen applications created with PyInstaller, it returns the path of the + frozen executable. + + :return: The path of the currently running script or executable. + :rtype: str + """ + if getattr(sys, "frozen", False): + # Cas PyInstaller + return sys.executable + else: + # Cas script Python + return os.path.abspath(sys.argv[0]) + + +def create_start_menu_shortcut(app_name: str, icon_path: str | None = None): + """ + Creates a shortcut for the specified application in the Windows start menu. + + The function checks if a shortcut already exists and skips creation if the shortcut + is found. If the shortcut does not exist, it creates a new one, optionally setting + the specified icon file for the shortcut. + + :param app_name: The name of the application to create the shortcut for. + :type app_name: str + :param icon_path: The optional path to the icon file to assign to the shortcut. + If not provided or if the file does not exist, the application's + executable will be used as the icon. + :type icon_path: str | None + :return: The full path to the created or existing shortcut. + :rtype: str + """ + exe_path = _get_executable_path() + + start_menu_dir = os.path.join( + os.environ["APPDATA"], + r"Microsoft\Windows\Start Menu\Programs", + app_name + ) + + os.makedirs(start_menu_dir, exist_ok=True) + + shortcut_path = os.path.join(start_menu_dir, f"{app_name}.lnk") + + # ✅ Ne recrée pas le raccourci s'il existe déjà + if os.path.exists(shortcut_path): + msg = CustomMessageBox( + title="La Tanière: raccourci", + message="Le raccourci existe déjà.\n\n", + icon_type=CustomMessageBox.WARNING, + buttons=CustomMessageBox.OK + ) + msg.exec() + return shortcut_path + + shell = Dispatch("WScript.Shell") + shortcut = shell.CreateShortCut(shortcut_path) + + shortcut.Targetpath = exe_path + shortcut.WorkingDirectory = os.path.dirname(exe_path) + + if icon_path and os.path.exists(icon_path): + shortcut.IconLocation = icon_path + else: + shortcut.IconLocation = exe_path + + shortcut.save() + + msg = CustomMessageBox( + title="La Tanière: Racourci", + message="Le raccourci pour le launcher\n\n" + "a été créé dans le menu démarrer.\n\n", + icon_type=CustomMessageBox.WARNING, + buttons=CustomMessageBox.OK + ) + msg.exec() + + return shortcut_path diff --git a/src/ui/main_window.py b/src/ui/main_window.py index 7f66764..18fb383 100644 --- a/src/ui/main_window.py +++ b/src/ui/main_window.py @@ -8,7 +8,7 @@ from PySide6.QtGui import QIcon, QMouseEvent, QGuiApplication from PySide6.QtWidgets import QMainWindow from config.config_manager import ConfigManager -from config.constants import PlayerServerInfo, Urls +from config.constants import PlayerServerInfo, Urls, VERSION from controllers.audio_controller import AudioController from controllers.glow_animator import GlowAnimator from controllers.window_dragger import WindowDragger @@ -25,6 +25,7 @@ from uitools.countdown_manager import CountdownManager from uitools.queue_thread import QueueThread from uitools.ui_builder import set_en_chantier, replace_with_hazard_button, hide_staff_btn_and_recenter from uitools.window_utility import center_window +from tools.windows_shortcuts import create_start_menu_shortcut # For Linux Wayland to authorize moving window if platform.startswith('linux'): @@ -146,6 +147,9 @@ class MainWindow(QMainWindow): self._connect_signals() center_window(self) # delegated to window_utils + # VERSION + self.ui.version_lbl.setText(f"{VERSION}") + self.show() # ------------------------------------------------------------------ @@ -161,10 +165,13 @@ class MainWindow(QMainWindow): self.ui.close_btn.clicked.connect(self.close) self.ui.minimize_btn.clicked.connect(self.showMinimized) self.ui.connexion_btn.clicked.connect(self._on_connexion) + self.ui.staff_btn.clicked.connect(self._on_staff) self.ui.discord_btn.clicked.connect(self._on_discord) self.ui.intranet_btn.clicked.connect(self._on_intranet) self.ui.discord_auth_btn.clicked.connect(self._on_discord_auth_btn) self.ui.no_whitelist_btn.clicked.connect(self.close) + self.ui.about_config_btn.clicked.connect(lambda: self._on_about_config(self.ui.stackedWidget.currentIndex())) + self.ui.create_shortcut_btn.clicked.connect(self.on_create_start_menu_shortcut) # ------------------------------------------------------------------ # Button handlers @@ -194,6 +201,11 @@ class MainWindow(QMainWindow): self.auth_worker.finished.connect(self.auth_worker.deleteLater) self.auth_worker.start() + @staticmethod + def _on_staff() -> None: + FiveMLauncher.launch("test.anycat.fr:30120") + QGuiApplication.setOverrideCursor(Qt.WaitCursor) + @staticmethod def _on_discord() -> None: """ @@ -270,6 +282,34 @@ class MainWindow(QMainWindow): show_qt_error(self, "Erreur Serveur", f"L'authentification a réussi mais l'enregistrement a échoué.\n\n{error_message}") + def _on_about_config(self, current_index) -> None: + """ + Handles the behavior of the configuration screen when the associated + index is selected or deselected. Switches to the previous index state + or saves the current index for future navigation. + + :param current_index: The index currently selected in the stack. + :type current_index: int + :return: None + """ + if current_index == 3: + self.ui.stackedWidget.setCurrentIndex(self.previous_index) + else: + self.previous_index = current_index + self.ui.stackedWidget.setCurrentIndex(3) + + @staticmethod + def on_create_start_menu_shortcut() -> None: + """ + Creates a Start Menu shortcut for the application. + + This method is responsible for invoking the function to create a + Start Menu shortcut with the specified application name. + + :return: None + """ + create_start_menu_shortcut("La Tanière Laucher") + # ------------------------------------------------------------------ # Mouse events → delegated to WindowDragger # ------------------------------------------------------------------ @@ -453,7 +493,7 @@ class MainWindow(QMainWindow): show_qt_error(self, "Attente", f"Position actuelle : {self.queue_position_value}") return - FiveMLauncher.launch() + FiveMLauncher.launch(Urls.FIVEMURL.value) self.ui.connexion_btn.setEnabled(False) self.schedule_close() diff --git a/src/ui/ui_mainwindow_vertical_pager.py b/src/ui/ui_mainwindow_vertical_pager.py index 9f369f0..2153f31 100644 --- a/src/ui/ui_mainwindow_vertical_pager.py +++ b/src/ui/ui_mainwindow_vertical_pager.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ################################################################################ -## Form generated from reading UI file 'mainwindow_vertical_pageryBuDUs.ui' +## Form generated from reading UI file 'mainwindow_vertical_pagerApTesA.ui' ## ## Created by: Qt User Interface Compiler version 6.10.2 ## @@ -14,8 +14,8 @@ from PySide6.QtGui import (QIcon, QPixmap) from PySide6.QtWidgets import (QFrame, QHBoxLayout, QLabel, QPushButton, QSizePolicy, QSlider, - QSpacerItem, QStackedWidget, QTextEdit, QVBoxLayout, - QWidget) + QSpacerItem, QStackedWidget, QTextBrowser, QTextEdit, + QVBoxLayout, QWidget) class Ui_MainWindow(object): @@ -57,6 +57,19 @@ class Ui_MainWindow(object): self.horizontalLayout.addItem(self.horizontalSpacer) + self.about_config_btn = QPushButton(self.title_bar) + self.about_config_btn.setObjectName(u"about_config_btn") + icon1 = QIcon() + icon1.addFile(u":/assets/settings.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + self.about_config_btn.setIcon(icon1) + self.about_config_btn.setIconSize(QSize(32, 32)) + + self.horizontalLayout.addWidget(self.about_config_btn) + + self.horizontalSpacer_17 = QSpacerItem(80, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum) + + self.horizontalLayout.addItem(self.horizontalSpacer_17) + self.minimize_btn = QPushButton(self.title_bar) self.minimize_btn.setObjectName(u"minimize_btn") self.minimize_btn.setMinimumSize(QSize(0, 0)) @@ -74,9 +87,9 @@ class Ui_MainWindow(object): self.close_btn.setObjectName(u"close_btn") self.close_btn.setMaximumSize(QSize(42, 42)) self.close_btn.setStyleSheet(u"") - icon1 = QIcon() - icon1.addFile(u":/assets/system-shutdown.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off) - self.close_btn.setIcon(icon1) + icon2 = QIcon() + icon2.addFile(u":/assets/system-shutdown.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + self.close_btn.setIcon(icon2) self.close_btn.setIconSize(QSize(32, 32)) self.horizontalLayout.addWidget(self.close_btn) @@ -188,9 +201,9 @@ class Ui_MainWindow(object): self.mute_btn = QPushButton(self.frame_4) self.mute_btn.setObjectName(u"mute_btn") self.mute_btn.setMinimumSize(QSize(32, 32)) - icon2 = QIcon() - icon2.addFile(u":/assets/sound-speaker.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) - self.mute_btn.setIcon(icon2) + icon3 = QIcon() + icon3.addFile(u":/assets/sound-speaker.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + self.mute_btn.setIcon(icon3) self.mute_btn.setFlat(True) self.horizontalLayout_7.addWidget(self.mute_btn) @@ -293,9 +306,9 @@ class Ui_MainWindow(object): self.connexion_btn.setObjectName(u"connexion_btn") self.connexion_btn.setMinimumSize(QSize(250, 50)) self.connexion_btn.setStyleSheet(u"") - icon3 = QIcon() - icon3.addFile(u":/assets/padlock-lock.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) - self.connexion_btn.setIcon(icon3) + icon4 = QIcon() + icon4.addFile(u":/assets/padlock-lock.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + self.connexion_btn.setIcon(icon4) self.connexion_btn.setIconSize(QSize(32, 32)) self.verticalLayout_6.addWidget(self.connexion_btn) @@ -307,9 +320,9 @@ class Ui_MainWindow(object): self.staff_btn = QPushButton(self.btn_frame) self.staff_btn.setObjectName(u"staff_btn") self.staff_btn.setMinimumSize(QSize(250, 50)) - icon4 = QIcon() - icon4.addFile(u":/assets/tools-repair.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) - self.staff_btn.setIcon(icon4) + icon5 = QIcon() + icon5.addFile(u":/assets/tools-repair.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + self.staff_btn.setIcon(icon5) self.staff_btn.setIconSize(QSize(32, 32)) self.verticalLayout_6.addWidget(self.staff_btn) @@ -326,9 +339,9 @@ class Ui_MainWindow(object): self.discord_btn = QPushButton(self.btn_frame) self.discord_btn.setObjectName(u"discord_btn") self.discord_btn.setMinimumSize(QSize(250, 50)) - icon5 = QIcon() - icon5.addFile(u":/assets/discord-icon.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) - self.discord_btn.setIcon(icon5) + icon6 = QIcon() + icon6.addFile(u":/assets/discord-icon.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + self.discord_btn.setIcon(icon6) self.discord_btn.setIconSize(QSize(32, 32)) self.verticalLayout_9.addWidget(self.discord_btn) @@ -340,9 +353,9 @@ class Ui_MainWindow(object): self.intranet_btn = QPushButton(self.btn_frame) self.intranet_btn.setObjectName(u"intranet_btn") self.intranet_btn.setMinimumSize(QSize(250, 50)) - icon6 = QIcon() - icon6.addFile(u":/assets/computer-tv.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) - self.intranet_btn.setIcon(icon6) + icon7 = QIcon() + icon7.addFile(u":/assets/computer-tv.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + self.intranet_btn.setIcon(icon7) self.intranet_btn.setIconSize(QSize(32, 32)) self.verticalLayout_9.addWidget(self.intranet_btn) @@ -472,7 +485,7 @@ class Ui_MainWindow(object): self.discord_auth_btn.setObjectName(u"discord_auth_btn") self.discord_auth_btn.setMinimumSize(QSize(380, 50)) self.discord_auth_btn.setMaximumSize(QSize(250, 50)) - self.discord_auth_btn.setIcon(icon5) + self.discord_auth_btn.setIcon(icon6) self.discord_auth_btn.setIconSize(QSize(32, 32)) self.horizontalLayout_3.addWidget(self.discord_auth_btn) @@ -585,9 +598,9 @@ class Ui_MainWindow(object): self.no_whitelist_btn.setObjectName(u"no_whitelist_btn") self.no_whitelist_btn.setMinimumSize(QSize(380, 50)) self.no_whitelist_btn.setMaximumSize(QSize(250, 50)) - icon7 = QIcon() - icon7.addFile(u":/assets/no_whitelist.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) - self.no_whitelist_btn.setIcon(icon7) + icon8 = QIcon() + icon8.addFile(u":/assets/no_whitelist.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + self.no_whitelist_btn.setIcon(icon8) self.no_whitelist_btn.setIconSize(QSize(32, 32)) self.horizontalLayout_10.addWidget(self.no_whitelist_btn) @@ -607,6 +620,107 @@ class Ui_MainWindow(object): self.verticalLayout_8.addWidget(self.frame_7) self.stackedWidget.addWidget(self.whitelist) + self.about_config = QWidget() + self.about_config.setObjectName(u"about_config") + self.frame_10 = QFrame(self.about_config) + self.frame_10.setObjectName(u"frame_10") + self.frame_10.setGeometry(QRect(0, 0, 700, 114)) + self.frame_10.setMaximumSize(QSize(700, 16777215)) + self.frame_10.setFrameShape(QFrame.Shape.NoFrame) + self.frame_10.setFrameShadow(QFrame.Shadow.Raised) + self.verticalLayout_11 = QVBoxLayout(self.frame_10) + self.verticalLayout_11.setSpacing(0) + self.verticalLayout_11.setObjectName(u"verticalLayout_11") + self.verticalLayout_11.setContentsMargins(0, 0, 0, 0) + self.about_config_title = QFrame(self.frame_10) + self.about_config_title.setObjectName(u"about_config_title") + self.about_config_title.setMinimumSize(QSize(0, 80)) + self.about_config_title.setMaximumSize(QSize(16777215, 80)) + self.about_config_title.setFrameShape(QFrame.Shape.NoFrame) + self.about_config_title.setFrameShadow(QFrame.Shadow.Raised) + self.horizontalLayout_11 = QHBoxLayout(self.about_config_title) + self.horizontalLayout_11.setSpacing(0) + self.horizontalLayout_11.setObjectName(u"horizontalLayout_11") + self.horizontalLayout_11.setContentsMargins(0, 0, 0, 0) + self.horizontalSpacer_14 = QSpacerItem(292, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum) + + self.horizontalLayout_11.addItem(self.horizontalSpacer_14) + + self.about_config_icon_label = QLabel(self.about_config_title) + self.about_config_icon_label.setObjectName(u"about_config_icon_label") + self.about_config_icon_label.setMinimumSize(QSize(64, 64)) + self.about_config_icon_label.setMaximumSize(QSize(64, 64)) + self.about_config_icon_label.setFrameShape(QFrame.Shape.NoFrame) + self.about_config_icon_label.setPixmap(QPixmap(u":/assets/information-point.svg")) + self.about_config_icon_label.setScaledContents(True) + + self.horizontalLayout_11.addWidget(self.about_config_icon_label) + + self.horizontalSpacer_16 = QSpacerItem(20, 20, QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Minimum) + + self.horizontalLayout_11.addItem(self.horizontalSpacer_16) + + self.about_config_title_label_2 = QLabel(self.about_config_title) + self.about_config_title_label_2.setObjectName(u"about_config_title_label_2") + self.about_config_title_label_2.setMinimumSize(QSize(180, 30)) + self.about_config_title_label_2.setScaledContents(True) + + self.horizontalLayout_11.addWidget(self.about_config_title_label_2) + + self.horizontalSpacer_15 = QSpacerItem(291, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum) + + self.horizontalLayout_11.addItem(self.horizontalSpacer_15) + + + self.verticalLayout_11.addWidget(self.about_config_title) + + self.frame_11 = QFrame(self.about_config) + self.frame_11.setObjectName(u"frame_11") + self.frame_11.setGeometry(QRect(0, 95, 700, 390)) + self.frame_11.setMinimumSize(QSize(0, 0)) + self.frame_11.setFrameShape(QFrame.Shape.NoFrame) + self.frame_11.setFrameShadow(QFrame.Shadow.Raised) + self.textBrowser = QTextBrowser(self.frame_11) + self.textBrowser.setObjectName(u"textBrowser") + self.textBrowser.setGeometry(QRect(10, 110, 681, 281)) + self.textBrowser.setFrameShape(QFrame.Shape.NoFrame) + self.frame_12 = QFrame(self.frame_11) + self.frame_12.setObjectName(u"frame_12") + self.frame_12.setGeometry(QRect(0, 0, 700, 68)) + self.frame_12.setMinimumSize(QSize(700, 0)) + self.frame_12.setFrameShape(QFrame.Shape.NoFrame) + self.frame_12.setFrameShadow(QFrame.Shadow.Raised) + self.horizontalLayout_12 = QHBoxLayout(self.frame_12) + self.horizontalLayout_12.setObjectName(u"horizontalLayout_12") + self.create_shortcut_btn = QPushButton(self.frame_12) + self.create_shortcut_btn.setObjectName(u"create_shortcut_btn") + self.create_shortcut_btn.setMinimumSize(QSize(380, 50)) + self.create_shortcut_btn.setMaximumSize(QSize(380, 16777215)) + icon9 = QIcon() + icon9.addFile(u":/assets/shortcut.svg", QSize(), QIcon.Mode.Normal, QIcon.State.Off) + self.create_shortcut_btn.setIcon(icon9) + self.create_shortcut_btn.setIconSize(QSize(32, 32)) + + self.horizontalLayout_12.addWidget(self.create_shortcut_btn) + + self.horizontalSpacer_18 = QSpacerItem(120, 20, QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Minimum) + + self.horizontalLayout_12.addItem(self.horizontalSpacer_18) + + self.label = QLabel(self.frame_12) + self.label.setObjectName(u"label") + + self.horizontalLayout_12.addWidget(self.label) + + self.version_lbl = QLabel(self.frame_12) + self.version_lbl.setObjectName(u"version_lbl") + + self.horizontalLayout_12.addWidget(self.version_lbl) + + self.label_3 = QLabel(self.frame_11) + self.label_3.setObjectName(u"label_3") + self.label_3.setGeometry(QRect(20, 75, 221, 31)) + self.stackedWidget.addWidget(self.about_config) self.verticalLayout1.addWidget(self.stackedWidget) @@ -620,7 +734,7 @@ class Ui_MainWindow(object): self.retranslateUi(MainWindow) - self.stackedWidget.setCurrentIndex(2) + self.stackedWidget.setCurrentIndex(3) QMetaObject.connectSlotsByName(MainWindow) @@ -628,6 +742,7 @@ class Ui_MainWindow(object): def retranslateUi(self, MainWindow): MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None)) + self.about_config_btn.setText("") self.minimize_btn.setText("") self.close_btn.setText("") self.queue_lbl.setText(QCoreApplication.translate("MainWindow", u"Position en file d'attente: ", None)) @@ -648,5 +763,14 @@ class Ui_MainWindow(object): self.whitelist_info_text.setText(QCoreApplication.translate("MainWindow", u"Tu n\u2019es pas whitelist\u00e9 sur le serveur.\n" "Inscris-toi sur Discord, puis relance le launcher.", None)) self.no_whitelist_btn.setText(QCoreApplication.translate("MainWindow", u" Compris !", None)) + self.about_config_icon_label.setText("") + self.about_config_title_label_2.setText(QCoreApplication.translate("MainWindow", u"A propos", None)) +#if QT_CONFIG(tooltip) + self.create_shortcut_btn.setToolTip(QCoreApplication.translate("MainWindow", u"Cr\u00e9e un raccourcis du launcher dans le menu d\u00e9marrer", None)) +#endif // QT_CONFIG(tooltip) + self.create_shortcut_btn.setText(QCoreApplication.translate("MainWindow", u"Cr\u00e9e un raccourcis", None)) + self.label.setText(QCoreApplication.translate("MainWindow", u"Version", None)) + self.version_lbl.setText(QCoreApplication.translate("MainWindow", u"0.0.1", None)) + self.label_3.setText(QCoreApplication.translate("MainWindow", u"Licences", None)) # retranslateUi diff --git a/styles/styles.qss b/styles/styles.qss index 6c6d813..715b9b6 100644 --- a/styles/styles.qss +++ b/styles/styles.qss @@ -164,6 +164,13 @@ QPushButton#minimize_btn { padding-top: 0 } +QPushButton#about_config_btn { + background-color: transparent; + border: none; + padding: 0px; + padding-top: 0 +} + HazardButton#connexion_btn { color: #0A1A3A; /* color: #0D2A6B;*/ diff --git a/ui/mainwindow_vertical_pager.ui b/ui/mainwindow_vertical_pager.ui index f3be914..b25227e 100644 --- a/ui/mainwindow_vertical_pager.ui +++ b/ui/mainwindow_vertical_pager.ui @@ -119,6 +119,36 @@ + + + + + + + + :/assets/settings.svg:/assets/settings.svg + + + + 32 + 32 + + + + + + + + Qt::Orientation::Horizontal + + + + 80 + 20 + + + + @@ -640,7 +670,7 @@ QFrame::Shape::NoFrame - 2 + 3 @@ -1673,6 +1703,306 @@ Inscris-toi sur Discord, puis relance le launcher. + + + + + 0 + 0 + 700 + 114 + + + + + 700 + 16777215 + + + + QFrame::Shape::NoFrame + + + QFrame::Shadow::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 80 + + + + + 16777215 + 80 + + + + QFrame::Shape::NoFrame + + + QFrame::Shadow::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Orientation::Horizontal + + + + 292 + 20 + + + + + + + + + 64 + 64 + + + + + 64 + 64 + + + + QFrame::Shape::NoFrame + + + + + + :/assets/information-point.svg + + + true + + + + + + + Qt::Orientation::Horizontal + + + QSizePolicy::Policy::Fixed + + + + 20 + 20 + + + + + + + + + 180 + 30 + + + + A propos + + + true + + + + + + + Qt::Orientation::Horizontal + + + + 291 + 20 + + + + + + + + + + + + + 0 + 95 + 700 + 390 + + + + + 0 + 0 + + + + QFrame::Shape::NoFrame + + + QFrame::Shadow::Raised + + + + + 10 + 110 + 681 + 281 + + + + QFrame::Shape::NoFrame + + + + + + 0 + 0 + 700 + 68 + + + + + 700 + 0 + + + + QFrame::Shape::NoFrame + + + QFrame::Shadow::Raised + + + + + + + 380 + 50 + + + + + 380 + 16777215 + + + + Crée un raccourcis du launcher dans le menu démarrer + + + Crée un raccourcis + + + + :/assets/shortcut.svg:/assets/shortcut.svg + + + + 32 + 32 + + + + + + + + Qt::Orientation::Horizontal + + + QSizePolicy::Policy::Fixed + + + + 120 + 20 + + + + + + + + Version + + + + + + + 0.0.1 + + + + + + + + + 20 + 75 + 221 + 31 + + + + Licences + + + +