diff --git a/pyproject.toml b/pyproject.toml index c9f7965..713b829 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,6 +5,6 @@ description = "Add your description here" readme = "README.md" requires-python = ">=3.14" dependencies = [ - "pyside6>=6.10.2", + "pyqt6>=6.10.2", ] diff --git a/requirements.txt b/requirements.txt index 5252412..d4059f6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,22 @@ PyQt6==6.10.2 PyQt6-Qt6==6.10.2 PyQt6_sip==13.11.0 -PySide6==6.10.2 -PySide6_Addons==6.10.2 -PySide6_Essentials==6.10.2 shiboken6==6.10.2 librt==0.8.1 mypy==1.19.1 mypy_extensions==1.1.0 +typing_extensions==4.15.0 +win11toast==0.36.3 +winrt-runtime==3.2.1 +winrt-Windows.Data.Xml.Dom==3.2.1 +winrt-Windows.Foundation==3.2.1 +winrt-Windows.Foundation.Collections==3.2.1 +winrt-Windows.Globalization==3.2.1 +winrt-Windows.Graphics.Imaging==3.2.1 +winrt-Windows.Media.Core==3.2.1 +winrt-Windows.Media.Ocr==3.2.1 +winrt-Windows.Media.Playback==3.2.1 +winrt-Windows.Media.SpeechSynthesis==3.2.1 +winrt-Windows.Storage==3.2.1 +winrt-Windows.Storage.Streams==3.2.1 +winrt-Windows.UI.Notifications==3.2.1 diff --git a/src/mainwindow.py b/src/mainwindow.py index 02e1dae..7ac40b2 100644 --- a/src/mainwindow.py +++ b/src/mainwindow.py @@ -1,5 +1,6 @@ import sys import os +from pathlib import Path from PyQt6 import uic from PyQt6.QtCore import Qt from PyQt6.QtGui import QFontDatabase, QFont @@ -17,6 +18,11 @@ if sys.platform.startswith('linux'): if sys.platform=='windows' or sys.platform=="win32": from win11toast import toast # type: ignore +if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'): + bundle_dir = Path(sys._MEIPASS) +else: + bundle_dir = Path(__file__).parent + # Remove this into final release from fake_patch_notes import patch_note NO_STAFF = True @@ -48,7 +54,7 @@ class MainWindow(QMainWindow): # Track mouse position for dragging self._drag_pos = None - uic.loadUi(f"{os.path.dirname(CURRENT)}/ui/mainwindow.ui", self) + uic.loadUi(f"{bundle_dir}/ui/mainwindow.ui", self) # Fixe some qss properties not taken into account self.subtitle_label.setStyleSheet("color: rgb(163, 177, 198);") @@ -66,7 +72,8 @@ class MainWindow(QMainWindow): self.minimize_btn.clicked.connect(self.minimize_link) self.connexion_btn.clicked.connect(self.connexion_btn_link) - def close_link(self): + @staticmethod + def close_link(): sys.exit(app.exec()) def minimize_link(self): @@ -90,7 +97,8 @@ class MainWindow(QMainWindow): self._drag_pos = None event.accept() - def connexion_btn_link(self): + @staticmethod + def connexion_btn_link(): icon = { 'src': ':/assets/background.png', 'placement': 'appLogoOverride' @@ -104,7 +112,7 @@ class MainWindow(QMainWindow): if __name__ == "__main__": app = QApplication(sys.argv) - with open(f"{os.path.dirname(CURRENT)}/styles/styles.qss", 'r') as f: + with open(f"{bundle_dir}/styles/styles.qss", 'r') as f: style = f.read() # Load and set the global font diff --git a/src/resources.py b/src/resources.py index 8c95d41..23e919a 100644 --- a/src/resources.py +++ b/src/resources.py @@ -3,7 +3,7 @@ # Created by: The Resource Compiler for Qt version 6.10.2 # WARNING! All changes made in this file will be lost! -from PySide6 import QtCore +from PyQt6 import QtCore qt_resource_data = b"\ \x00\x00\x0bp\ diff --git a/ui/mainwindow_ui.py b/ui/mainwindow_ui.py index dd219ed..55af743 100644 --- a/ui/mainwindow_ui.py +++ b/ui/mainwindow_ui.py @@ -8,14 +8,14 @@ ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ -from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, +from PyQt6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, QMetaObject, QObject, QPoint, QRect, QSize, QTime, QUrl, Qt) -from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, +from PyQt6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, QFont, QFontDatabase, QGradient, QIcon, QImage, QKeySequence, QLinearGradient, QPainter, QPalette, QPixmap, QRadialGradient, QTransform) -from PySide6.QtWidgets import (QApplication, QFrame, QHBoxLayout, QLabel, +from PyQt6.QtWidgets import (QApplication, QFrame, QHBoxLayout, QLabel, QMainWindow, QPushButton, QSizePolicy, QSlider, QSpacerItem, QTextEdit, QVBoxLayout, QWidget) import resources_rc