diff --git a/statapp-onefile.spec b/statapp-onefile.spec index 5161602..0b7f9d2 100644 --- a/statapp-onefile.spec +++ b/statapp-onefile.spec @@ -12,7 +12,7 @@ if typing.TYPE_CHECKING: from PyInstaller.utils.hooks import copy_metadata -datas = [('statapp/images/sticker.gif', 'images')] +datas = [('statapp/ui/images/*', 'ui/images')] datas += copy_metadata('statapp') a = Analysis( @@ -55,4 +55,5 @@ exe = EXE( target_arch=None, codesign_identity=None, entitlements_file=None, + icon='statapp/ui/images/logo.ico', ) diff --git a/statapp.spec b/statapp.spec index e12d0eb..66443f1 100644 --- a/statapp.spec +++ b/statapp.spec @@ -12,7 +12,7 @@ if typing.TYPE_CHECKING: from PyInstaller.utils.hooks import copy_metadata -datas = [('statapp/images/sticker.gif', 'images')] +datas = [('statapp/ui/images/*', 'ui/images')] datas += copy_metadata('statapp') @@ -53,6 +53,7 @@ exe = EXE( target_arch=None, codesign_identity=None, entitlements_file=None, + icon='statapp/ui/images/logo.ico', ) coll = COLLECT( exe, diff --git a/statapp/about_window.py b/statapp/about_window.py index af51e9f..c4253c3 100644 --- a/statapp/about_window.py +++ b/statapp/about_window.py @@ -19,7 +19,7 @@ class AboutWindow(QMainWindow): self.ui = Ui_AboutWindow() self.ui.setupUi(self) - image_path = resource_path('images/sticker.gif') + image_path = resource_path('ui/images/sticker.gif') movie = QMovie(image_path) self.ui.labelgif.setMovie(movie) movie.start() diff --git a/statapp/main_window.py b/statapp/main_window.py index 064b0ab..c751541 100644 --- a/statapp/main_window.py +++ b/statapp/main_window.py @@ -1,5 +1,6 @@ import numpy as np -from PySide2.QtCore import Slot, QLocale +from PySide2.QtCore import Slot, QLocale, QSize +from PySide2.QtGui import QIcon from PySide2.QtWidgets import QMainWindow, QMessageBox, QApplication from statapp.generate_factor_window import GenerateFactorWindow, INDIRECT_LINK @@ -8,6 +9,7 @@ from statapp.generate_window import GenerateWindow from statapp.about_window import AboutWindow from statapp.models.fileslc_model import FileSLCModel from statapp.ui.ui_main_window import Ui_MainWindow +from statapp.utils import resource_path class MainWindow(QMainWindow): @@ -17,6 +19,10 @@ class MainWindow(QMainWindow): self.ui = Ui_MainWindow() self.ui.setupUi(self) + icon = QIcon() + icon.addFile(resource_path("ui/images/logo.ico"), QSize(), QIcon.Normal, QIcon.Off) + self.setWindowIcon(icon) + self.isDataChanged = False self.model = DataModel() self.fileModel = FileSLCModel() diff --git a/statapp/ui/images/logo.ico b/statapp/ui/images/logo.ico new file mode 100644 index 0000000..159bc55 Binary files /dev/null and b/statapp/ui/images/logo.ico differ diff --git a/statapp/images/sticker.gif b/statapp/ui/images/sticker.gif similarity index 100% rename from statapp/images/sticker.gif rename to statapp/ui/images/sticker.gif diff --git a/statapp/ui/main_window.ui b/statapp/ui/main_window.ui index 47cb54f..62e034e 100644 --- a/statapp/ui/main_window.ui +++ b/statapp/ui/main_window.ui @@ -112,6 +112,5 @@ - diff --git a/statapp/ui/ui_main_window.py b/statapp/ui/ui_main_window.py index 4b1d83b..b7b658d 100644 --- a/statapp/ui/ui_main_window.py +++ b/statapp/ui/ui_main_window.py @@ -12,7 +12,6 @@ from PySide2.QtCore import * from PySide2.QtGui import * from PySide2.QtWidgets import * - class Ui_MainWindow(object): def setupUi(self, MainWindow): if not MainWindow.objectName(): @@ -97,4 +96,3 @@ class Ui_MainWindow(object): self.modelmenu.setTitle(QCoreApplication.translate("MainWindow", u"\u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435", None)) self.helpmenu.setTitle(QCoreApplication.translate("MainWindow", u"\u0421\u043f\u0440\u0430\u0432\u043a\u0430", None)) # retranslateUi -