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 -r ../src/lang/*.qm dist/pamhyr/lang/
|
||||||
|
|
||||||
cp ../VERSION dist/pamhyr/
|
cp ../VERSION dist/pamhyr/
|
||||||
|
cp ../AUTHORS dist/pamhyr/
|
||||||
|
|
||||||
echo " *** MAKE SRC PACKAGE"
|
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\View\ui\*.ui dist\pamhyr\View\ui\
|
||||||
copy /y ..\src\lang\*.qm dist\pamhyr\lang\
|
copy /y ..\src\lang\*.qm dist\pamhyr\lang\
|
||||||
copy /y ..\VERSION dist\pamhyr\
|
copy /y ..\VERSION dist\pamhyr\
|
||||||
|
copy /y ..\AUTHORS dist\pamhyr\
|
||||||
|
|
||||||
rem Make installer
|
rem Make installer
|
||||||
"C:\Program Files (x86)\NSIS\makensis.exe" pamhyr.nsi
|
"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 View.ASubWindow import ASubWindow
|
||||||
|
|
||||||
|
from PyQt5.QtCore import QCoreApplication
|
||||||
|
|
||||||
|
_translate = QCoreApplication.translate
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
|
|
||||||
class AboutWindow(ASubWindow):
|
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):
|
def __init__(self, title="About", parent=None):
|
||||||
super(AboutWindow, self).__init__(name=title, ui="about", parent=parent)
|
super(AboutWindow, self).__init__(name=title, ui="about", parent=parent)
|
||||||
self.ui.setWindowTitle(title)
|
self.ui.setWindowTitle(title)
|
||||||
|
|
||||||
with open(
|
# Version
|
||||||
os.path.abspath(
|
with open(self._path_file("VERSION"), "r") as f:
|
||||||
os.path.join(
|
|
||||||
os.path.dirname(__file__),
|
|
||||||
"..", "..", "VERSION"
|
|
||||||
)
|
|
||||||
), "r"
|
|
||||||
) as f:
|
|
||||||
version = f.readline()
|
version = f.readline()
|
||||||
logger.info(version)
|
logger.info(f"version: {version}")
|
||||||
|
|
||||||
label = self.get_label_text("label_version")
|
label = self.get_label_text("label_version")
|
||||||
label = label.replace("@version", version.strip())
|
label = label.replace("@version", version.strip())
|
||||||
self.set_label_text("label_version", label)
|
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>
|
<item>
|
||||||
<widget class="QLabel" name="label_copyright">
|
<widget class="QLabel" name="label_copyright">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>© Pierre-Antoine ROUBY - INRAE -2023</string>
|
<string>...</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue