mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-29 19:10:42 +01:00
Time/date format: warning message for users when they change format to another start date
This commit is contained in:
1 parent
9879094661
commit
d15fa684b7
1 file changed
+23
-2
@@ -19,7 +19,7 @@
|
||||
import logging
|
||||
|
||||
from datetime import datetime
|
||||
from tools import get_user_name
|
||||
from tools import get_user_name, parse_datetime, format_datetime
|
||||
|
||||
from Modules import Modules
|
||||
from Model.Study import Study
|
||||
@@ -34,7 +34,7 @@ from PyQt5.QtGui import (
|
||||
from PyQt5.QtWidgets import (
|
||||
QRadioButton, QLabel, QDateTimeEdit,
|
||||
QTextEdit, QPlainTextEdit, QTextBrowser,
|
||||
QPushButton,
|
||||
QPushButton, QMessageBox,
|
||||
)
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
@@ -156,6 +156,27 @@ All right reserved.
|
||||
self.find(QDateTimeEdit, "dateTimeEdit_date").setEnabled(True)
|
||||
|
||||
def accept(self):
|
||||
# if (self._study is not None
|
||||
# and self._study.time_system == "date"
|
||||
# and self.get_radio_button("radioButton_date")):
|
||||
# old_date = parse_datetime(self._study.date)
|
||||
# new_date = parse_datetime(self.get_datetime_edit("dateTimeEdit_date"))
|
||||
# if new_date != old_date:
|
||||
# answer = QMessageBox.question(
|
||||
# self,
|
||||
# _translate("Study", "Change simulation start date?"),
|
||||
# _translate(
|
||||
# "Study",
|
||||
# "All displayed data dates will shift with the simulation start."
|
||||
# "\nTheir elapsed simulation times will remain unchanged."
|
||||
# "\n\nPrevious start: {old}\nNew start: {new}"
|
||||
# ).format(old=format_datetime(old_date), new=format_datetime(new_date)),
|
||||
# QMessageBox.Ok | QMessageBox.Cancel,
|
||||
# QMessageBox.Cancel
|
||||
# )
|
||||
# if answer != QMessageBox.Ok:
|
||||
# return
|
||||
|
||||
name = self.get_line_edit_text("lineEdit_name")
|
||||
description = self.get_plaintext_edit_text("plainTextEdit_description")
|
||||
|
||||
|
||||
Reference in new issue
Block a user