diff --git a/statapp-onefile.spec b/statapp-onefile.spec index bea3955..8bf46a7 100644 --- a/statapp-onefile.spec +++ b/statapp-onefile.spec @@ -1,11 +1,14 @@ # -*- mode: python ; coding: utf-8 -*- +from PyInstaller.utils.hooks import copy_metadata +datas = [('statapp/images/sticker.gif', 'images')] +datas += copy_metadata('statapp') a = Analysis( ['statapp/__main__.py'], pathex=[], binaries=[], - datas=[], + datas=datas, hiddenimports=[], hookspath=[], hooksconfig={}, diff --git a/statapp.spec b/statapp.spec index 247ce69..917e58e 100644 --- a/statapp.spec +++ b/statapp.spec @@ -1,11 +1,15 @@ # -*- mode: python ; coding: utf-8 -*- +from PyInstaller.utils.hooks import copy_metadata + +datas = [('statapp/images/sticker.gif', 'images')] +datas += copy_metadata('statapp') a = Analysis( ['statapp/__main__.py'], pathex=[], binaries=[], - datas=[('statapp/images/sticker.gif', 'images')], + datas=datas, hiddenimports=[], hookspath=[], hooksconfig={}, @@ -25,7 +29,7 @@ exe = EXE( bootloader_ignore_signals=False, strip=False, upx=True, - console=True, + console=False, disable_windowed_traceback=False, argv_emulation=False, target_arch=None, diff --git a/statapp/about_window.py b/statapp/about_window.py index 8795fbc..af51e9f 100644 --- a/statapp/about_window.py +++ b/statapp/about_window.py @@ -1,12 +1,18 @@ +import sys from PySide2.QtGui import QMovie from PySide2.QtWidgets import QMainWindow from statapp.ui.ui_about_window import Ui_AboutWindow from statapp.utils import resource_path +if sys.version_info < (3, 8): + import importlib_metadata +else: + import importlib.metadata as importlib_metadata + class AboutWindow(QMainWindow): - pixmap = None + movie = None def __init__(self): super().__init__() @@ -14,10 +20,11 @@ class AboutWindow(QMainWindow): self.ui.setupUi(self) image_path = resource_path('images/sticker.gif') - movie = QMovie(image_path) self.ui.labelgif.setMovie(movie) movie.start() - - self.pixmap = movie + self.movie = movie self.setFixedSize(self.size()) + + version = importlib_metadata.version(__package__ or __name__) + self.ui.versionLabel.setText(f"Версия: {version}") diff --git a/statapp/ui/about_window.ui b/statapp/ui/about_window.ui index 22bbbb0..0b81161 100644 --- a/statapp/ui/about_window.ui +++ b/statapp/ui/about_window.ui @@ -9,7 +9,7 @@ 0 0 - 476 + 483 543 @@ -23,70 +23,7 @@ - - - - - 14 - false - false - false - false - PreferDefault - true - - - - Донецкий Национальный Технический Университет - - - Qt::AlignCenter - - - - - - - - 14 - false - false - false - false - PreferDefault - true - - - - Разработчики: Слипенко М., Лазуренко Е. - - - Qt::AlignCenter - - - - - - - - 14 - false - false - false - false - PreferDefault - true - - - - Теоретический фундамент: Дмитрюк Т. Г. - - - Qt::AlignCenter - - - - + @@ -103,6 +40,7 @@ 14 + 50 false false false @@ -122,6 +60,102 @@ + + + + + 12 + 50 + false + false + false + false + PreferDefault + true + + + + Донецкий Национальный Технический Университет + + + Qt::AlignCenter + + + + + + + + 14 + 50 + false + false + false + false + PreferDefault + true + + + + Разработчики: Слипенко М., Лазуренко Е. + + + Qt::AlignCenter + + + + + + + + 12 + + + + Версия: + + + Qt::AlignCenter + + + + + + + + 14 + 50 + false + false + false + false + PreferDefault + true + + + + Теоретический фундамент: Дмитрюк Т. Г. + + + Qt::AlignCenter + + + + + + + + 20 + + + + Statapp + + + Qt::AlignCenter + + + diff --git a/statapp/ui/ui_about_window.py b/statapp/ui/ui_about_window.py index 725f828..2bafd32 100644 --- a/statapp/ui/ui_about_window.py +++ b/statapp/ui/ui_about_window.py @@ -18,7 +18,7 @@ class Ui_AboutWindow(object): if not AboutWindow.objectName(): AboutWindow.setObjectName(u"AboutWindow") AboutWindow.setEnabled(True) - AboutWindow.resize(476, 543) + AboutWindow.resize(483, 543) AboutWindow.setAutoFillBackground(False) self.centralwidget = QWidget(AboutWindow) self.centralwidget.setObjectName(u"centralwidget") @@ -26,44 +26,72 @@ class Ui_AboutWindow(object): self.gridLayout_2.setObjectName(u"gridLayout_2") self.gridLayout = QGridLayout() self.gridLayout.setObjectName(u"gridLayout") - self.labelowner = QLabel(self.centralwidget) - self.labelowner.setObjectName(u"labelowner") + self.labelgif = QLabel(self.centralwidget) + self.labelgif.setObjectName(u"labelgif") + self.labelgif.setMinimumSize(QSize(50, 50)) + self.labelgif.setMaximumSize(QSize(500, 600)) font = QFont() font.setPointSize(14) font.setBold(False) font.setItalic(False) font.setUnderline(False) + font.setWeight(50) font.setStrikeOut(False) font.setKerning(True) font.setStyleStrategy(QFont.PreferDefault) - self.labelowner.setFont(font) + self.labelgif.setFont(font) + self.labelgif.setFrameShape(QFrame.NoFrame) + self.labelgif.setAlignment(Qt.AlignCenter) + + self.gridLayout.addWidget(self.labelgif, 5, 1, 1, 1) + + self.labelowner = QLabel(self.centralwidget) + self.labelowner.setObjectName(u"labelowner") + font1 = QFont() + font1.setPointSize(12) + font1.setBold(False) + font1.setItalic(False) + font1.setUnderline(False) + font1.setWeight(50) + font1.setStrikeOut(False) + font1.setKerning(True) + font1.setStyleStrategy(QFont.PreferDefault) + self.labelowner.setFont(font1) self.labelowner.setAlignment(Qt.AlignCenter) - self.gridLayout.addWidget(self.labelowner, 4, 1, 1, 1) + self.gridLayout.addWidget(self.labelowner, 6, 1, 1, 1) self.labeldevelopers = QLabel(self.centralwidget) self.labeldevelopers.setObjectName(u"labeldevelopers") self.labeldevelopers.setFont(font) self.labeldevelopers.setAlignment(Qt.AlignCenter) - self.gridLayout.addWidget(self.labeldevelopers, 0, 1, 1, 1) + self.gridLayout.addWidget(self.labeldevelopers, 2, 1, 1, 1) + + self.versionLabel = QLabel(self.centralwidget) + self.versionLabel.setObjectName(u"versionLabel") + font2 = QFont() + font2.setPointSize(12) + self.versionLabel.setFont(font2) + self.versionLabel.setAlignment(Qt.AlignCenter) + + self.gridLayout.addWidget(self.versionLabel, 1, 1, 1, 1) self.labelbasegigamen = QLabel(self.centralwidget) self.labelbasegigamen.setObjectName(u"labelbasegigamen") self.labelbasegigamen.setFont(font) self.labelbasegigamen.setAlignment(Qt.AlignCenter) - self.gridLayout.addWidget(self.labelbasegigamen, 1, 1, 1, 1) + self.gridLayout.addWidget(self.labelbasegigamen, 3, 1, 1, 1) - self.labelgif = QLabel(self.centralwidget) - self.labelgif.setObjectName(u"labelgif") - self.labelgif.setMinimumSize(QSize(50, 50)) - self.labelgif.setMaximumSize(QSize(500, 600)) - self.labelgif.setFont(font) - self.labelgif.setFrameShape(QFrame.NoFrame) - self.labelgif.setAlignment(Qt.AlignCenter) + self.mainLabel = QLabel(self.centralwidget) + self.mainLabel.setObjectName(u"mainLabel") + font3 = QFont() + font3.setPointSize(20) + self.mainLabel.setFont(font3) + self.mainLabel.setAlignment(Qt.AlignCenter) - self.gridLayout.addWidget(self.labelgif, 2, 1, 1, 1) + self.gridLayout.addWidget(self.mainLabel, 0, 1, 1, 1) self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1) @@ -77,8 +105,10 @@ class Ui_AboutWindow(object): def retranslateUi(self, AboutWindow): AboutWindow.setWindowTitle(QCoreApplication.translate("AboutWindow", u"\u041e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0435", None)) + self.labelgif.setText("") self.labelowner.setText(QCoreApplication.translate("AboutWindow", u"\u0414\u043e\u043d\u0435\u0446\u043a\u0438\u0439 \u041d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0423\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442", None)) self.labeldevelopers.setText(QCoreApplication.translate("AboutWindow", u"\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438: \u0421\u043b\u0438\u043f\u0435\u043d\u043a\u043e \u041c., \u041b\u0430\u0437\u0443\u0440\u0435\u043d\u043a\u043e \u0415.", None)) + self.versionLabel.setText(QCoreApplication.translate("AboutWindow", u"\u0412\u0435\u0440\u0441\u0438\u044f:", None)) self.labelbasegigamen.setText(QCoreApplication.translate("AboutWindow", u"\u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442: \u0414\u043c\u0438\u0442\u0440\u044e\u043a \u0422. \u0413.", None)) - self.labelgif.setText("") + self.mainLabel.setText(QCoreApplication.translate("AboutWindow", u"Statapp", None)) # retranslateUi