mirror of https://gitlab.com/pamhyr/pamhyr2
About: Update about window and add VERSION file.
parent
21209fdb79
commit
a22a760610
|
|
@ -10,8 +10,14 @@ stages:
|
|||
|
||||
build:
|
||||
stage: build
|
||||
tags:
|
||||
- linux
|
||||
script:
|
||||
- echo "TODO build pamhyr"
|
||||
- cd packages
|
||||
- ./version.sh "$CI_COMMIT_BRANCH" "$CI_COMMIT_TAG" "$CI_COMMIT_SHORT_SHA"
|
||||
artifacts:
|
||||
paths:
|
||||
- VERSION
|
||||
|
||||
build-lang:
|
||||
stage: build
|
||||
|
|
@ -45,6 +51,8 @@ linux-package:
|
|||
needs:
|
||||
- job: build-lang
|
||||
artifacts: true
|
||||
- job: build
|
||||
artifacts: true
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_TAG
|
||||
artifacts:
|
||||
|
|
@ -62,6 +70,8 @@ windows-package:
|
|||
needs:
|
||||
- job: build-lang
|
||||
artifacts: true
|
||||
- job: build
|
||||
artifacts: true
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_TAG
|
||||
artifacts:
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ cp -r ../src/View/ui/*.ui dist/pamhyr/View/ui/
|
|||
mkdir -p dist/pamhyr/lang
|
||||
cp -r ../src/lang/*.qm dist/pamhyr/lang/
|
||||
|
||||
cp ../VERSION dist/pamhyr/
|
||||
|
||||
echo " *** MAKE SRC PACKAGE"
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
#! /bin/sh
|
||||
|
||||
# ./version BRANCH TAG COMMIT
|
||||
|
||||
if [ -z $2 ];
|
||||
then
|
||||
echo "$1-$3" > ../VERSION
|
||||
else
|
||||
echo "$2" > ../VERSION
|
||||
fi
|
||||
|
|
@ -15,6 +15,7 @@ copy /y ..\src\View\ui\ressources\ dist\pamhyr\View\ui\ressources
|
|||
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\
|
||||
|
||||
rem Make installer
|
||||
"C:\Program Files (x86)\NSIS\makensis.exe" pamhyr.nsi
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
../VERSION
|
||||
|
|
@ -19,6 +19,7 @@ from PyQt5.QtWidgets import (
|
|||
QRadioButton, QComboBox, QFileDialog,
|
||||
QMessageBox, QTableView, QAction,
|
||||
QDateTimeEdit, QWidget, QPlainTextEdit,
|
||||
QLabel,
|
||||
)
|
||||
from PyQt5.QtCore import (
|
||||
QTime, QDateTime,
|
||||
|
|
@ -130,6 +131,30 @@ class ASubWindowFeatures(object):
|
|||
|
||||
return qtype
|
||||
|
||||
def get_label_text(self, name:str):
|
||||
"""Get text of label component
|
||||
|
||||
Args:
|
||||
label: The label component name
|
||||
|
||||
Returns:
|
||||
Text
|
||||
"""
|
||||
return self.find(QLabel, name).text()
|
||||
|
||||
def set_label_text(self, name:str, text:str):
|
||||
"""Set text of label component
|
||||
|
||||
Args:
|
||||
text_edit: The label component name
|
||||
text: The text
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
"""
|
||||
self.find(QLabel, name).setText(text)
|
||||
|
||||
|
||||
def set_line_edit_text(self, name:str, text:str):
|
||||
"""Set text of line edit component
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,28 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
import logging
|
||||
|
||||
from View.ASubWindow import ASubWindow
|
||||
|
||||
logger = logging.getLogger()
|
||||
|
||||
class AboutWindow(ASubWindow):
|
||||
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 = f.readline()
|
||||
logger.info(version)
|
||||
|
||||
label = self.get_label_text("label_version")
|
||||
label = label.replace("@version", version.strip())
|
||||
self.set_label_text("label_version", label)
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>362</width>
|
||||
<height>98</height>
|
||||
<width>553</width>
|
||||
<height>262</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
|
@ -15,44 +15,74 @@
|
|||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<widget class="QLabel" name="label_logo">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap>ressources/logoCemagref.gif</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
<pixmap>ressources/Logo-INRAE.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>PamHyr</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Version en developpement:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="QLabel" name="label_title">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>About PAMHYR</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_copyright">
|
||||
<property name="text">
|
||||
<string>© Pierre-Antoine ROUBY - INRAE -2023</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_version">
|
||||
<property name="text">
|
||||
<string>Version: @version</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_license">
|
||||
<property name="text">
|
||||
<string>License: GPLv3+</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string><a href="https://gitlab.irstea.fr/theophile.terraz/pamhyr">Source code</a></string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::RichText</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 8.4 KiB |
Loading…
Reference in New Issue