Windows: Change release icons and logos path to '_internal/'.

dev
Pierre-Antoine 2025-05-05 16:44:37 +02:00
parent fea4957f61
commit 1e8925fbb3
7 changed files with 47 additions and 33 deletions

View File

@ -27,20 +27,24 @@ import os
class Logos(): class Logos():
def __init__(self): def __init__(self):
self.logo_AcouSed = os.path.join('logos', "AcouSed.png") def path_logo(icon):
return os.path.join(
os.path.dirname(__file__), "..", "logos", icon
)
self.logo_INRAE = os.path.join('logos', "BlocMarque-INRAE-Inter.jpg") self.logo_AcouSed = path_logo("AcouSed.png")
self.logo_OSR = os.path.join('logos', "OSR.png") self.logo_INRAE = path_logo("BlocMarque-INRAE-Inter.jpg")
self.logo_europe = os.path.join('logos', "Europe.png")
self.logo_saone_rhone = os.path.join('logos', "plan_Rhone_Saone.png")
self.logo_carnot = os.path.join('logos', "Carnot_EE.png")
self.logo_CNR = os.path.join('logos', "CNR.png") self.logo_OSR = path_logo("OSR.png")
self.logo_EDF = os.path.join('logos', "EDF.png") self.logo_europe = path_logo("Europe.png")
self.logo_Ubertone = os.path.join('logos', "Ubertone.jpg") self.logo_saone_rhone = path_logo("plan_Rhone_Saone.png")
self.logo_carnot = path_logo("Carnot_EE.png")
self.logo_CNR = path_logo("CNR.png")
self.logo_EDF = path_logo("EDF.png")
self.logo_Ubertone = path_logo("Ubertone.jpg")
logos_inst = Logos() logos_inst = Logos()
@ -291,7 +295,7 @@ class Authors(QDialog):
self.gridLayout.addWidget(self.label_brahim, 4, 0, 1, 1) self.gridLayout.addWidget(self.label_brahim, 4, 0, 1, 1)
self.label_PA = QLabel() self.label_PA = QLabel()
self.label_PA.setText("TECC company (< a href = https://parouby.fr/ > https://parouby.fr/ </a>) was involved in 2025 to improve program architecture.") self.label_PA.setText("TECC company (< a href = https://parouby.fr/ > https://parouby.fr/ </a>) was involved in 2025 to debugging the program.")
self.gridLayout.addWidget(self.label_PA, 5, 0, 1, 1) self.gridLayout.addWidget(self.label_PA, 5, 0, 1, 1)

View File

@ -718,7 +718,7 @@ class AcousticDataTab(QWidget):
def _setup_icons(self): def _setup_icons(self):
def path_icon(icon): def path_icon(icon):
return os.path.join( return os.path.join(
"icons", icon os.path.dirname(__file__), "..", "icons", icon
) )
self.icon_folder = QIcon(path_icon("folder.png")) self.icon_folder = QIcon(path_icon("folder.png"))

View File

@ -69,7 +69,9 @@ class AcousticInversionTab(QWidget):
self._setup_connections() self._setup_connections()
def _path_icon(self, icon): def _path_icon(self, icon):
return os.path.join("icons", icon) return os.path.join(
os.path.dirname(__file__), "..", "icons", icon
)
def _setup_icons(self): def _setup_icons(self):
self.icon_folder = QIcon(self._path_icon("folder.png")) self.icon_folder = QIcon(self._path_icon("folder.png"))

View File

@ -132,28 +132,33 @@ class Ui_MainWindow(object):
self.toolBar.setObjectName("toolBar") self.toolBar.setObjectName("toolBar")
self.mainwindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar) self.mainwindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar)
def path_icon(icon):
return os.path.join(
os.path.dirname(__file__), "..", "icons", icon
)
self.actionOpen = QtWidgets.QAction(self.mainwindow) self.actionOpen = QtWidgets.QAction(self.mainwindow)
icon1 = QtGui.QIcon() icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap("icons/icon_folder.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon1.addPixmap(QtGui.QPixmap(path_icon("icon_folder.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionOpen.setIcon(icon1) self.actionOpen.setIcon(icon1)
self.actionOpen.setObjectName("actionOpen") self.actionOpen.setObjectName("actionOpen")
self.actionSave = QtWidgets.QAction(self.mainwindow) self.actionSave = QtWidgets.QAction(self.mainwindow)
icon2 = QtGui.QIcon() icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap("icons/save.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon2.addPixmap(QtGui.QPixmap(path_icon("save.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionSave.setIcon(icon2) self.actionSave.setIcon(icon2)
self.actionSave.setObjectName("actionSave") self.actionSave.setObjectName("actionSave")
self.actionEnglish = QtWidgets.QAction(self.mainwindow) self.actionEnglish = QtWidgets.QAction(self.mainwindow)
icon6 = QtGui.QIcon() icon6 = QtGui.QIcon()
icon6.addPixmap(QtGui.QPixmap("icons/en.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon6.addPixmap(QtGui.QPixmap(path_icon("en.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionEnglish.setIcon(icon6) self.actionEnglish.setIcon(icon6)
self.actionEnglish.setObjectName("actionEnglish") self.actionEnglish.setObjectName("actionEnglish")
self.actionEnglish.setEnabled(False) self.actionEnglish.setEnabled(False)
self.actionFrench = QtWidgets.QAction(self.mainwindow) self.actionFrench = QtWidgets.QAction(self.mainwindow)
icon7 = QtGui.QIcon() icon7 = QtGui.QIcon()
icon7.addPixmap(QtGui.QPixmap("icons/fr.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon7.addPixmap(QtGui.QPixmap(path_icon("fr.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionFrench.setIcon(icon7) self.actionFrench.setIcon(icon7)
self.actionFrench.setObjectName("actionFrench") self.actionFrench.setObjectName("actionFrench")
self.actionFrench.setEnabled(False) self.actionFrench.setEnabled(False)

View File

@ -63,7 +63,9 @@ class SampleDataTab(QWidget):
def __init__(self, widget_tab): def __init__(self, widget_tab):
super().__init__() super().__init__()
icon_folder = QIcon(os.path.join("icons", "folder.png")) icon_folder = QIcon(os.path.join(
os.path.dirname(__file__), "..", "icons", "folder.png"
))
self._setup_attrs() self._setup_attrs()
### --- General layout of widgets --- ### --- General layout of widgets ---

View File

@ -498,7 +498,7 @@ class SignalProcessingTab(QWidget):
def _setup_icons(self): def _setup_icons(self):
def path_icon(icon): def path_icon(icon):
return os.path.join( return os.path.join(
"icons", icon os.path.dirname(__file__), "..", "icons", icon
) )
self.icon_folder = QIcon(path_icon("folder.png")) self.icon_folder = QIcon(path_icon("folder.png"))

View File

@ -8,20 +8,6 @@ rem Build windows version
mkdir acoused_packaging mkdir acoused_packaging
pyinstaller --name "acoused" ..\main.py -y pyinstaller --name "acoused" ..\main.py -y
rem Icons
mkdir acoused_packaging\icons
copy /y ..\icons\*.png acoused_packaging\icons
rem Logos
mkdir acoused_packaging\logos
copy /y ..\logos\* acoused_packaging\logos
rem Doc
copy /y ..\ABS_calibration_constant_kt.xlsx acoused_packaging
copy /y ..\AcouSed_UserManual.pdf acoused_packaging
copy /y ..\Acoustic_Inversion_theory.pdf acoused_packaging
copy /y ..\Tutorial_AQUAscat_software.pdf acoused_packaging
rem move exe rem move exe
move /y dist\AcouSed\acoused.exe acoused_packaging move /y dist\AcouSed\acoused.exe acoused_packaging
move /y dist\acoused\_internal acoused_packaging move /y dist\acoused\_internal acoused_packaging
@ -30,6 +16,21 @@ rmdir /s /q build
rmdir /s /q dist rmdir /s /q dist
del /q AcouSed.spec del /q AcouSed.spec
rem Icons
mkdir acoused_packaging\_internal\icons
copy /y ..\icons\*.png acoused_packaging\_internal\icons
rem Logos
mkdir acoused_packaging\_internal\logos
copy /y ..\logos\* acoused_packaging\_internal\logos
rem Doc
copy /y ..\ABS_calibration_constant_kt.xlsx acoused_packaging
copy /y ..\AcouSed_UserManual.pdf acoused_packaging
copy /y ..\Acoustic_Inversion_theory.pdf acoused_packaging
copy /y ..\Tutorial_AQUAscat_software.pdf acoused_packaging
set PATH=%PATH%;C:\Program Files (x86)/7-Zip set PATH=%PATH%;C:\Program Files (x86)/7-Zip
7z a -tzip acoused_packaging.zip acoused_packaging 7z a -tzip acoused_packaging.zip acoused_packaging
pause