Skip to content
Snippets Groups Projects
Commit 74b2fa6b authored by inso's avatar inso
Browse files

Fix text in certification dialog

parent d12f55f4
No related branches found
No related tags found
No related merge requests found
...@@ -199,18 +199,19 @@ class CertificationDialog(QObject): ...@@ -199,18 +199,19 @@ class CertificationDialog(QObject):
stock=params['sigStock']) stock=params['sigStock'])
if remaining_time > 0: if remaining_time > 0:
cert_text += "\n" cert_text += "\n"
cert_text += self.tr("Remaining time before next available certification : {0}").format( remaining_localized = QDateTime.fromTime_t(remaining_time).toString("HH:ss.")\
QLocale.toString( .replace(":", self.tr(" hours and ")).replace(".", self.tr(" min"))
QLocale(), cert_text += self.tr("Remaining time before next certification validation : {0}".format(remaining_localized))
QDateTime.fromTime_t(remaining_time),
QLocale.timeFormat(QLocale(), QLocale.ShortFormat)
),
)
self.ui.label_cert_stock.setText(cert_text) self.ui.label_cert_stock.setText(cert_text)
if is_member or not block_0: if is_member or not block_0:
if remaining_time == 0 and (nb_certifications < params['sigStock'] or params['sigStock'] == 0): if nb_certifications < params['sigStock'] or params['sigStock'] == 0:
self.ui.button_box.button(QDialogButtonBox.Ok).setEnabled(True) self.ui.button_box.button(QDialogButtonBox.Ok).setEnabled(True)
if remaining_time > 0:
self.ui.button_box.button(QDialogButtonBox.Ok).setText(self.tr("&Ok") +
self.tr(" (Not validated before ")
+ remaining_localized + ")")
else:
self.ui.button_box.button(QDialogButtonBox.Ok).setText(self.tr("&Ok")) self.ui.button_box.button(QDialogButtonBox.Ok).setText(self.tr("&Ok"))
else: else:
self.ui.button_box.button(QDialogButtonBox.Ok).setEnabled(False) self.ui.button_box.button(QDialogButtonBox.Ok).setEnabled(False)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment