diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000000000000000000000000000000000000..0ce9cdac7226e76c18076df0cbba8c49420dbec3 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,3 @@ +Sylvain COULIBALY, INRAE, 2020 - 2022 +Théophile TERRAZ, INRAE, 2022 - 2023 +Pierre-Antoine ROUBY, INRAE, 2023 \ No newline at end of file diff --git a/packages/linux.sh b/packages/linux.sh index 9924eb0bb575f07523a269742f5d7f3929e82f41..938e4ff985fe5325573bf1d952c2b742b388917d 100755 --- a/packages/linux.sh +++ b/packages/linux.sh @@ -36,6 +36,7 @@ mkdir -p dist/pamhyr/lang cp -r ../src/lang/*.qm dist/pamhyr/lang/ cp ../VERSION dist/pamhyr/ +cp ../AUTHORS dist/pamhyr/ echo " *** MAKE SRC PACKAGE" diff --git a/packages/windows.bat b/packages/windows.bat index c5d150dffd9a9c3616cde26d9df6800eefe3275f..84d5561350ca2d4f84e2d439b959d945f82c1c90 100644 --- a/packages/windows.bat +++ b/packages/windows.bat @@ -16,6 +16,7 @@ copy /y ..\src\View\ui\Widgets\*.ui dist\pamhyr\View\ui\Widgets copy /y ..\src\View\ui\*.ui dist\pamhyr\View\ui\ copy /y ..\src\lang\*.qm dist\pamhyr\lang\ copy /y ..\VERSION dist\pamhyr\ +copy /y ..\AUTHORS dist\pamhyr\ rem Make installer "C:\Program Files (x86)\NSIS\makensis.exe" pamhyr.nsi diff --git a/src/AUTHORS b/src/AUTHORS new file mode 120000 index 0000000000000000000000000000000000000000..9eadf7123842d406c7106d95bc0822b664562408 --- /dev/null +++ b/src/AUTHORS @@ -0,0 +1 @@ +../AUTHORS \ No newline at end of file diff --git a/src/View/About/Window.py b/src/View/About/Window.py index 2ff5f3ce758a8e4b0f8244966fef8a1f41c3dc51..a1784509011264bb26b8a2ab2bed8ad4a80e36eb 100644 --- a/src/View/About/Window.py +++ b/src/View/About/Window.py @@ -5,24 +5,42 @@ import logging from View.ASubWindow import ASubWindow +from PyQt5.QtCore import QCoreApplication + +_translate = QCoreApplication.translate logger = logging.getLogger() class AboutWindow(ASubWindow): + def _path_file(self, filename): + return os.path.abspath( + os.path.join( + os.path.dirname(__file__), + "..", "..", filename + ) + ) + + def __init__(self, title="About", parent=None): super(AboutWindow, self).__init__(name=title, ui="about", parent=parent) self.ui.setWindowTitle(title) - with open( - os.path.abspath( - os.path.join( - os.path.dirname(__file__), - "..", "..", "VERSION" - ) - ), "r" - ) as f: + # Version + with open(self._path_file("VERSION"), "r") as f: version = f.readline() - logger.info(version) + logger.info(f"version: {version}") label = self.get_label_text("label_version") label = label.replace("@version", version.strip()) self.set_label_text("label_version", label) + + # Authors + with open(self._path_file("AUTHORS"), "r") as f: + label = "" + try: + while True: + author = next(f).strip() + logger.info(f"author: {author}") + label = f"\n © {author}" + label + except StopIteration: + label = _translate("About", "Contributors: ") + label + self.set_label_text("label_copyright", label) diff --git a/src/View/ui/about.ui b/src/View/ui/about.ui index 7d9ab7b66bc05a4f5c5e551f7a6c0617ca454d7c..579e0095f9e36116e06a7cd98bedaf6817318c86 100644 --- a/src/View/ui/about.ui +++ b/src/View/ui/about.ui @@ -46,7 +46,7 @@ <item> <widget class="QLabel" name="label_copyright"> <property name="text"> - <string>© Pierre-Antoine ROUBY - INRAE -2023</string> + <string>...</string> </property> </widget> </item>