new tool for quitting app from child windows
This commit is contained in:
@@ -7,6 +7,7 @@ from PySide6.QtGui import QColor
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
NO_STAFF = True
|
||||
NO_WHITELIST = True
|
||||
|
||||
REDIRECT_URI = "http://localhost:5000/callback"
|
||||
SCOPES = ["identify"]
|
||||
|
||||
@@ -7,16 +7,18 @@ from PySide6.QtWidgets import QApplication
|
||||
|
||||
# Imports pour la gestion de la configuration
|
||||
from config.config_manager import ConfigManager
|
||||
from config.constants import Resources
|
||||
|
||||
# Imports pour la vérification Discord
|
||||
from discord.discord_tools import CheckDiscord
|
||||
|
||||
# Import pour la partie ui
|
||||
from ui.custom_message_box import CustomMessageBox
|
||||
from ui.main_window import MainWindow
|
||||
|
||||
# Ne pas supprimer ! Enregistre les ressources Qt
|
||||
import resources # noqa: F401 - required to register Qt resources
|
||||
|
||||
from ui.main_window import MainWindow
|
||||
from config.constants import Resources
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Bundle path resolution
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from PySide6.QtWidgets import QApplication
|
||||
|
||||
PROJECT_ROOT = Path(__file__).resolve().parents[2]
|
||||
|
||||
@@ -17,3 +18,10 @@ def get_executable_dir() -> Path:
|
||||
# sys.executable est le chemin complet vers l'application .exe
|
||||
return Path(sys.executable).parent.resolve()
|
||||
return Path(__file__).resolve().parents[2]
|
||||
|
||||
def quit_application(exit_code: int = 0) -> None:
|
||||
app = QApplication.instance()
|
||||
if app is not None:
|
||||
app.closeAllWindows()
|
||||
app.exit(exit_code)
|
||||
sys.exit(exit_code)
|
||||
|
||||
@@ -12,7 +12,9 @@ from controllers.audio_controller import AudioController
|
||||
from controllers.glow_animator import GlowAnimator
|
||||
from controllers.window_dragger import WindowDragger
|
||||
from discord import discord_oauth
|
||||
from config.constants import NO_STAFF, Urls
|
||||
from config.constants import NO_STAFF, Urls, NO_WHITELIST
|
||||
from ui.custom_message_box import CustomMessageBox
|
||||
from tools.utils import quit_application
|
||||
|
||||
from fake_patch_notes import patch_note
|
||||
|
||||
@@ -61,6 +63,18 @@ class MainWindow(QMainWindow):
|
||||
self._center_window()
|
||||
self.show()
|
||||
|
||||
if NO_WHITELIST:
|
||||
msg = CustomMessageBox(
|
||||
title="La Tanière: Non whitelisté",
|
||||
message="\n\nTu n'est pas whitelisté sur le serveur\n\n"
|
||||
"Assure-toi de te faire whitelister.\n\n"
|
||||
"Lorsque cela sera fait, relance le launcher.",
|
||||
icon_type=CustomMessageBox.WARNING,
|
||||
buttons=CustomMessageBox.OK
|
||||
)
|
||||
msg.exec()
|
||||
quit_application()
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Setup
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
@@ -239,7 +239,8 @@ QWidget#MsgBoxMainContainer QLabel,
|
||||
QWidget#MsgBoxMainContainer QPushButton
|
||||
{
|
||||
color: white;
|
||||
font-family: 'Segoe UI';
|
||||
/*font-size: 18px;
|
||||
/* font-family: 'Segoe UI';*/
|
||||
}
|
||||
|
||||
QPushButton#MsgBoxOkButton,
|
||||
@@ -283,7 +284,7 @@ QPushButton#MsgBoxCloseButton:hover {
|
||||
|
||||
QLabel#MsgBoxTitleLabel {
|
||||
font-weight: bold;
|
||||
font-size: 10px;
|
||||
font-size: 14px;
|
||||
color: rgba(255,255,255,0.7);
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user