Commit a5a712d6 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

About: Add AUTHORS files and authors list into about window.

Showing with 34 additions and 10 deletions
+34 -10
AUTHORS 0 → 100644
Sylvain COULIBALY, INRAE, 2020 - 2022
Théophile TERRAZ, INRAE, 2022 - 2023
Pierre-Antoine ROUBY, INRAE, 2023
\ No newline at end of file
......@@ -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"
......
......@@ -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
src/AUTHORS 0 → 120000
../AUTHORS
\ No newline at end of file
......@@ -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)
......@@ -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>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment