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:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
|
tags:
|
||||||
|
- linux
|
||||||
script:
|
script:
|
||||||
- echo "TODO build pamhyr"
|
- cd packages
|
||||||
|
- ./version.sh "$CI_COMMIT_BRANCH" "$CI_COMMIT_TAG" "$CI_COMMIT_SHORT_SHA"
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- VERSION
|
||||||
|
|
||||||
build-lang:
|
build-lang:
|
||||||
stage: build
|
stage: build
|
||||||
|
|
@ -45,6 +51,8 @@ linux-package:
|
||||||
needs:
|
needs:
|
||||||
- job: build-lang
|
- job: build-lang
|
||||||
artifacts: true
|
artifacts: true
|
||||||
|
- job: build
|
||||||
|
artifacts: true
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_TAG
|
- if: $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_TAG
|
||||||
artifacts:
|
artifacts:
|
||||||
|
|
@ -62,6 +70,8 @@ windows-package:
|
||||||
needs:
|
needs:
|
||||||
- job: build-lang
|
- job: build-lang
|
||||||
artifacts: true
|
artifacts: true
|
||||||
|
- job: build
|
||||||
|
artifacts: true
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_TAG
|
- if: $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_TAG
|
||||||
artifacts:
|
artifacts:
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ cp -r ../src/View/ui/*.ui dist/pamhyr/View/ui/
|
||||||
mkdir -p dist/pamhyr/lang
|
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/
|
||||||
|
|
||||||
echo " *** MAKE SRC PACKAGE"
|
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\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\
|
||||||
|
|
||||||
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 @@
|
||||||
|
../VERSION
|
||||||
|
|
@ -19,6 +19,7 @@ from PyQt5.QtWidgets import (
|
||||||
QRadioButton, QComboBox, QFileDialog,
|
QRadioButton, QComboBox, QFileDialog,
|
||||||
QMessageBox, QTableView, QAction,
|
QMessageBox, QTableView, QAction,
|
||||||
QDateTimeEdit, QWidget, QPlainTextEdit,
|
QDateTimeEdit, QWidget, QPlainTextEdit,
|
||||||
|
QLabel,
|
||||||
)
|
)
|
||||||
from PyQt5.QtCore import (
|
from PyQt5.QtCore import (
|
||||||
QTime, QDateTime,
|
QTime, QDateTime,
|
||||||
|
|
@ -130,6 +131,30 @@ class ASubWindowFeatures(object):
|
||||||
|
|
||||||
return qtype
|
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):
|
def set_line_edit_text(self, name:str, text:str):
|
||||||
"""Set text of line edit component
|
"""Set text of line edit component
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,28 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import os
|
||||||
|
import logging
|
||||||
|
|
||||||
from View.ASubWindow import ASubWindow
|
from View.ASubWindow import ASubWindow
|
||||||
|
|
||||||
|
logger = logging.getLogger()
|
||||||
|
|
||||||
class AboutWindow(ASubWindow):
|
class AboutWindow(ASubWindow):
|
||||||
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(
|
||||||
|
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>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>362</width>
|
<width>553</width>
|
||||||
<height>98</height>
|
<height>262</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
|
@ -15,44 +15,74 @@
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label_logo">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="pixmap">
|
<property name="pixmap">
|
||||||
<pixmap>ressources/logoCemagref.gif</pixmap>
|
<pixmap>ressources/Logo-INRAE.png</pixmap>
|
||||||
</property>
|
|
||||||
<property name="scaledContents">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<widget class="QLabel" name="label_title">
|
||||||
<item>
|
<property name="font">
|
||||||
<widget class="QLabel" name="label_2">
|
<font>
|
||||||
<property name="font">
|
<pointsize>16</pointsize>
|
||||||
<font>
|
<weight>75</weight>
|
||||||
<pointsize>16</pointsize>
|
<bold>true</bold>
|
||||||
<weight>75</weight>
|
</font>
|
||||||
<bold>true</bold>
|
</property>
|
||||||
</font>
|
<property name="text">
|
||||||
</property>
|
<string>About PAMHYR</string>
|
||||||
<property name="text">
|
</property>
|
||||||
<string>PamHyr</string>
|
</widget>
|
||||||
</property>
|
</item>
|
||||||
</widget>
|
<item>
|
||||||
</item>
|
<widget class="QLabel" name="label_copyright">
|
||||||
<item>
|
<property name="text">
|
||||||
<widget class="QLabel" name="label_3">
|
<string>© Pierre-Antoine ROUBY - INRAE -2023</string>
|
||||||
<property name="text">
|
</property>
|
||||||
<string>Version en developpement:</string>
|
</widget>
|
||||||
</property>
|
</item>
|
||||||
</widget>
|
<item>
|
||||||
</item>
|
<widget class="QLabel" name="label_version">
|
||||||
</layout>
|
<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>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 8.4 KiB |
Loading…
Reference in New Issue