diff --git a/src/View/Results/Window.py b/src/View/Results/Window.py index 75e95f2181feef09739553d0f8db434c98dcc2e9..25f4a45b545766381bb51bfb903510dc3976bb0f 100644 --- a/src/View/Results/Window.py +++ b/src/View/Results/Window.py @@ -16,9 +16,10 @@ # -*- coding: utf-8 -*- +import os import logging -from datetime import datetime +from datetime import datetime from tools import trace, timer from View.Tools.PamhyrWindow import PamhyrWindow @@ -69,6 +70,14 @@ class ResultsWindow(PamhyrWindow): _pamhyr_ui = "Results" _pamhyr_name = "Results" + def _path_file(self, filename): + return os.path.abspath( + os.path.join( + os.path.dirname(__file__), + "..", "..", filename + ) + ) + def __init__(self, study=None, config=None, solver=None, results=None, parent=None): @@ -124,13 +133,15 @@ class ResultsWindow(PamhyrWindow): self._slider_time.setMaximum(len(self._timestamps) - 1) self._slider_time.setValue(len(self._timestamps) - 1) + file_path = os.path.abspath(os.path.dirname(__file__)) + self._icon_start = QIcon() self._icon_start.addPixmap( - QPixmap('./src/View/ui/ressources/media-playback-start.png') + QPixmap(f'{file_path}/../ui/ressources/media-playback-start.png') ) self._icon_pause = QIcon() self._icon_pause.addPixmap( - QPixmap('./src/View/ui/ressources/media-playback-pause.png') + QPixmap(f'{file_path}/../ui/ressources/media-playback-pause.png') ) self._button_play = self.find(QPushButton, f"playButton") self._button_play.setIcon(self._icon_start) diff --git a/src/View/Tools/Plot/PamhyrToolbar.py b/src/View/Tools/Plot/PamhyrToolbar.py index 977087d053f68342bc686e9ef592e06648d20bb2..489d47b108a9e7378305c71b13bf543a60878b90 100644 --- a/src/View/Tools/Plot/PamhyrToolbar.py +++ b/src/View/Tools/Plot/PamhyrToolbar.py @@ -98,7 +98,7 @@ class PamhyrPlotToolbar(NavigationToolbar2QT): icon_zoom = QtGui.QIcon() icon_zoom.addPixmap(QtGui.QPixmap( - os.path.abspath(f"{file_path}/../ui/ressources/zoom.png") + os.path.abspath(f"{file_path}/../../ui/ressources/zoom.png") )) icons.append(("zoom", icon_zoom)) @@ -122,7 +122,7 @@ class PamhyrPlotToolbar(NavigationToolbar2QT): icon_btn_isometric_view.addPixmap( QtGui.QPixmap( os.path.abspath( - f"{file_path}/../ui/ressources/zoom_fit_11.png" + f"{file_path}/../../ui/ressources/zoom_fit_11.png" ) ) ) @@ -131,7 +131,7 @@ class PamhyrPlotToolbar(NavigationToolbar2QT): icon_btn_global_view.addPixmap( QtGui.QPixmap( os.path.abspath( - f"{file_path}/../ui/ressources/zoom_fit.png" + f"{file_path}/../../ui/ressources/zoom_fit.png" ) ) )