fix: обновлено окно "О программе" (#21)

This commit is contained in:
Maxim Slipenko 2023-09-28 11:08:53 +03:00 committed by GitHub
parent c0fbc0fbd9
commit 37ea556ad2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 166 additions and 88 deletions

View File

@ -1,11 +1,14 @@
# -*- mode: python ; coding: utf-8 -*- # -*- mode: python ; coding: utf-8 -*-
from PyInstaller.utils.hooks import copy_metadata
datas = [('statapp/images/sticker.gif', 'images')]
datas += copy_metadata('statapp')
a = Analysis( a = Analysis(
['statapp/__main__.py'], ['statapp/__main__.py'],
pathex=[], pathex=[],
binaries=[], binaries=[],
datas=[], datas=datas,
hiddenimports=[], hiddenimports=[],
hookspath=[], hookspath=[],
hooksconfig={}, hooksconfig={},

View File

@ -1,11 +1,15 @@
# -*- mode: python ; coding: utf-8 -*- # -*- mode: python ; coding: utf-8 -*-
from PyInstaller.utils.hooks import copy_metadata
datas = [('statapp/images/sticker.gif', 'images')]
datas += copy_metadata('statapp')
a = Analysis( a = Analysis(
['statapp/__main__.py'], ['statapp/__main__.py'],
pathex=[], pathex=[],
binaries=[], binaries=[],
datas=[('statapp/images/sticker.gif', 'images')], datas=datas,
hiddenimports=[], hiddenimports=[],
hookspath=[], hookspath=[],
hooksconfig={}, hooksconfig={},
@ -25,7 +29,7 @@ exe = EXE(
bootloader_ignore_signals=False, bootloader_ignore_signals=False,
strip=False, strip=False,
upx=True, upx=True,
console=True, console=False,
disable_windowed_traceback=False, disable_windowed_traceback=False,
argv_emulation=False, argv_emulation=False,
target_arch=None, target_arch=None,

View File

@ -1,12 +1,18 @@
import sys
from PySide2.QtGui import QMovie from PySide2.QtGui import QMovie
from PySide2.QtWidgets import QMainWindow from PySide2.QtWidgets import QMainWindow
from statapp.ui.ui_about_window import Ui_AboutWindow from statapp.ui.ui_about_window import Ui_AboutWindow
from statapp.utils import resource_path 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): class AboutWindow(QMainWindow):
pixmap = None movie = None
def __init__(self): def __init__(self):
super().__init__() super().__init__()
@ -14,10 +20,11 @@ class AboutWindow(QMainWindow):
self.ui.setupUi(self) self.ui.setupUi(self)
image_path = resource_path('images/sticker.gif') image_path = resource_path('images/sticker.gif')
movie = QMovie(image_path) movie = QMovie(image_path)
self.ui.labelgif.setMovie(movie) self.ui.labelgif.setMovie(movie)
movie.start() movie.start()
self.movie = movie
self.pixmap = movie
self.setFixedSize(self.size()) self.setFixedSize(self.size())
version = importlib_metadata.version(__package__ or __name__)
self.ui.versionLabel.setText(f"Версия: {version}")

View File

@ -9,7 +9,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>476</width> <width>483</width>
<height>543</height> <height>543</height>
</rect> </rect>
</property> </property>
@ -23,70 +23,7 @@
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0"> <item row="0" column="0">
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="4" column="1"> <item row="5" column="1">
<widget class="QLabel" name="labelowner">
<property name="font">
<font>
<pointsize>14</pointsize>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
<stylestrategy>PreferDefault</stylestrategy>
<kerning>true</kerning>
</font>
</property>
<property name="text">
<string>Донецкий Национальный Технический Университет</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="labeldevelopers">
<property name="font">
<font>
<pointsize>14</pointsize>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
<stylestrategy>PreferDefault</stylestrategy>
<kerning>true</kerning>
</font>
</property>
<property name="text">
<string>Разработчики: Слипенко М., Лазуренко Е.</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="labelbasegigamen">
<property name="font">
<font>
<pointsize>14</pointsize>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
<stylestrategy>PreferDefault</stylestrategy>
<kerning>true</kerning>
</font>
</property>
<property name="text">
<string>Теоретический фундамент: Дмитрюк Т. Г.</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="labelgif"> <widget class="QLabel" name="labelgif">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
@ -103,6 +40,7 @@
<property name="font"> <property name="font">
<font> <font>
<pointsize>14</pointsize> <pointsize>14</pointsize>
<weight>50</weight>
<italic>false</italic> <italic>false</italic>
<bold>false</bold> <bold>false</bold>
<underline>false</underline> <underline>false</underline>
@ -122,6 +60,102 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="1">
<widget class="QLabel" name="labelowner">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
<stylestrategy>PreferDefault</stylestrategy>
<kerning>true</kerning>
</font>
</property>
<property name="text">
<string>Донецкий Национальный Технический Университет</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="labeldevelopers">
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
<stylestrategy>PreferDefault</stylestrategy>
<kerning>true</kerning>
</font>
</property>
<property name="text">
<string>Разработчики: Слипенко М., Лазуренко Е.</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="versionLabel">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Версия:</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="labelbasegigamen">
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
<stylestrategy>PreferDefault</stylestrategy>
<kerning>true</kerning>
</font>
</property>
<property name="text">
<string>Теоретический фундамент: Дмитрюк Т. Г.</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="mainLabel">
<property name="font">
<font>
<pointsize>20</pointsize>
</font>
</property>
<property name="text">
<string>Statapp</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>

View File

@ -18,7 +18,7 @@ class Ui_AboutWindow(object):
if not AboutWindow.objectName(): if not AboutWindow.objectName():
AboutWindow.setObjectName(u"AboutWindow") AboutWindow.setObjectName(u"AboutWindow")
AboutWindow.setEnabled(True) AboutWindow.setEnabled(True)
AboutWindow.resize(476, 543) AboutWindow.resize(483, 543)
AboutWindow.setAutoFillBackground(False) AboutWindow.setAutoFillBackground(False)
self.centralwidget = QWidget(AboutWindow) self.centralwidget = QWidget(AboutWindow)
self.centralwidget.setObjectName(u"centralwidget") self.centralwidget.setObjectName(u"centralwidget")
@ -26,44 +26,72 @@ class Ui_AboutWindow(object):
self.gridLayout_2.setObjectName(u"gridLayout_2") self.gridLayout_2.setObjectName(u"gridLayout_2")
self.gridLayout = QGridLayout() self.gridLayout = QGridLayout()
self.gridLayout.setObjectName(u"gridLayout") self.gridLayout.setObjectName(u"gridLayout")
self.labelowner = QLabel(self.centralwidget) self.labelgif = QLabel(self.centralwidget)
self.labelowner.setObjectName(u"labelowner") self.labelgif.setObjectName(u"labelgif")
self.labelgif.setMinimumSize(QSize(50, 50))
self.labelgif.setMaximumSize(QSize(500, 600))
font = QFont() font = QFont()
font.setPointSize(14) font.setPointSize(14)
font.setBold(False) font.setBold(False)
font.setItalic(False) font.setItalic(False)
font.setUnderline(False) font.setUnderline(False)
font.setWeight(50)
font.setStrikeOut(False) font.setStrikeOut(False)
font.setKerning(True) font.setKerning(True)
font.setStyleStrategy(QFont.PreferDefault) 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.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 = QLabel(self.centralwidget)
self.labeldevelopers.setObjectName(u"labeldevelopers") self.labeldevelopers.setObjectName(u"labeldevelopers")
self.labeldevelopers.setFont(font) self.labeldevelopers.setFont(font)
self.labeldevelopers.setAlignment(Qt.AlignCenter) 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 = QLabel(self.centralwidget)
self.labelbasegigamen.setObjectName(u"labelbasegigamen") self.labelbasegigamen.setObjectName(u"labelbasegigamen")
self.labelbasegigamen.setFont(font) self.labelbasegigamen.setFont(font)
self.labelbasegigamen.setAlignment(Qt.AlignCenter) 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.mainLabel = QLabel(self.centralwidget)
self.labelgif.setObjectName(u"labelgif") self.mainLabel.setObjectName(u"mainLabel")
self.labelgif.setMinimumSize(QSize(50, 50)) font3 = QFont()
self.labelgif.setMaximumSize(QSize(500, 600)) font3.setPointSize(20)
self.labelgif.setFont(font) self.mainLabel.setFont(font3)
self.labelgif.setFrameShape(QFrame.NoFrame) self.mainLabel.setAlignment(Qt.AlignCenter)
self.labelgif.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) self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
@ -77,8 +105,10 @@ class Ui_AboutWindow(object):
def retranslateUi(self, AboutWindow): def retranslateUi(self, AboutWindow):
AboutWindow.setWindowTitle(QCoreApplication.translate("AboutWindow", u"\u041e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0435", None)) 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.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.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.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 # retranslateUi