mirror of https://gitlab.com/pamhyr/pamhyr2
About: Add AUTHORS files and authors list into about window.
parent
02394cc226
commit
a5a712d6ad
|
|
@ -0,0 +1,3 @@
|
|||
Sylvain COULIBALY, INRAE, 2020 - 2022
|
||||
Théophile TERRAZ, INRAE, 2022 - 2023
|
||||
Pierre-Antoine ROUBY, INRAE, 2023
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
../AUTHORS
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue