diff --git a/assets/icon.png b/assets/icon.png new file mode 100644 index 0000000..47f6876 Binary files /dev/null and b/assets/icon.png differ diff --git a/source/survey/WebMission.py b/source/survey/WebMission.py index 84695ba..2238c95 100644 --- a/source/survey/WebMission.py +++ b/source/survey/WebMission.py @@ -10,7 +10,6 @@ from source import assets_path from source.survey.base import BaseSurvey from source.widget import Browser - page_success_path: Path = assets_path / "web/success.html" @@ -170,20 +169,22 @@ class WebMission(BaseSurvey): self.timer_check.stop() def _success(self): - if not self._finished: - # mark the success in the events - self._save_event(type="check") - - # emit on the success signal - if "success" in self.signals: - self.signals["success"].emit() # NOQA: emit exist - - # change the content of the page to the success message - self.browser.web.load(QUrl.fromLocalFile(str(page_success_path.absolute()))) + if self._finished: + return # mark the mission as finished self._finished = True + # mark the success in the events + self._save_event(type="check") + + # emit on the success signal + if "success" in self.signals: + self.signals["success"].emit() # NOQA: emit exist + + # change the content of the page to the success message + self.browser.web.load(QUrl.fromLocalFile(str(page_success_path.absolute()))) + # condition def check(self) -> None: diff --git a/source/widget/MyMainWindow.py b/source/widget/MyMainWindow.py index 738a5ad..c123363 100644 --- a/source/widget/MyMainWindow.py +++ b/source/widget/MyMainWindow.py @@ -1,10 +1,15 @@ +from PyQt6.QtGui import QIcon from PyQt6.QtWidgets import QMainWindow -from source import widget +from source import widget, assets_path + + +icon_path = assets_path / "icon.png" class MyMainWindow(QMainWindow): def __init__(self): super().__init__() + self.setWindowIcon(QIcon(str(icon_path.resolve()))) self.setCentralWidget(widget.FrameSurvey("./surveys.json"))