mirror of https://gitlab.com/pamhyr/pamhyr2
NewStudy: Add additional infomation into creation/edit windows.
parent
e617738fcd
commit
9b9ef8ee4b
|
|
@ -3,10 +3,13 @@
|
||||||
from Model.Study import Study
|
from Model.Study import Study
|
||||||
from View.ASubWindow import ASubWindow
|
from View.ASubWindow import ASubWindow
|
||||||
|
|
||||||
|
from PyQt5.QtCore import QCoreApplication
|
||||||
|
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
QRadioButton, QLabel, QDateTimeEdit,
|
QRadioButton, QLabel, QDateTimeEdit,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
_translate = QCoreApplication.translate
|
||||||
|
|
||||||
class NewStudyWindow(ASubWindow):
|
class NewStudyWindow(ASubWindow):
|
||||||
def __init__(self, study=None, title="New Study", parent=None):
|
def __init__(self, study=None, title="New Study", parent=None):
|
||||||
|
|
@ -14,13 +17,20 @@ class NewStudyWindow(ASubWindow):
|
||||||
self.ui.setWindowTitle(title)
|
self.ui.setWindowTitle(title)
|
||||||
|
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
|
|
||||||
self.study = study
|
self.study = study
|
||||||
|
|
||||||
if not self.study is None:
|
if not self.study is None:
|
||||||
self.set_line_edit_text("lineEdit_name", self.study.name)
|
self.set_line_edit_text("lineEdit_name", self.study.name)
|
||||||
self.set_text_edit_text("textEdit_description", self.study.description)
|
self.set_text_edit_text("textEdit_description", self.study.description)
|
||||||
self.set_datetime_edit("dateTimeEdit_date", self.study.date)
|
self.set_datetime_edit("dateTimeEdit_date", self.study.date)
|
||||||
|
|
||||||
|
self.find(QLabel, "label_creation_date_data").setText(
|
||||||
|
self.study.creation_date.isoformat(sep=" ")
|
||||||
|
)
|
||||||
|
self.find(QLabel, "label_last_modification_data").setText(
|
||||||
|
self.study.last_save_date.isoformat(sep=" ")
|
||||||
|
)
|
||||||
|
|
||||||
if self.study.time_system == "date":
|
if self.study.time_system == "date":
|
||||||
self.set_radio_button("radioButton_date", True)
|
self.set_radio_button("radioButton_date", True)
|
||||||
self.find(QLabel, "label_date").setEnabled(True)
|
self.find(QLabel, "label_date").setEnabled(True)
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Dialog</string>
|
<string>Dialog</string>
|
||||||
</property>
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
|
<item row="0" column="0">
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
|
|
@ -104,7 +106,41 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0" colspan="3">
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_creation_date">
|
||||||
|
<property name="text">
|
||||||
|
<string>Creation date :</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLabel" name="label_creation_date_data">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_last_modification">
|
||||||
|
<property name="text">
|
||||||
|
<string>Last modification :</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLabel" name="label_last_modification_data">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue