From d7076626c23c4c36b7f11b070fb374f2a4c7ee2a Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Wed, 22 Feb 2017 16:07:39 +0100 Subject: [PATCH] TTL label is in red and warning when too low - TTL to chans shouldn't be too low so the UI gives a feedback - warning when sending wouldn either require a lot of refactoring or wouldn't have good usability --- src/bitmessageqt/__init__.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 18bd70ed..1580cd8b 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -834,11 +834,23 @@ class MyForm(settingsmixin.SMainWindow): def updateHumanFriendlyTTLDescription(self, TTL): numberOfHours = int(round(TTL / (60*60))) + font = QtGui.QFont() + stylesheet = "" + if numberOfHours < 48: - self.ui.labelHumanFriendlyTTLDescription.setText(_translate("MainWindow", "%n hour(s)", None, QtCore.QCoreApplication.CodecForTr, numberOfHours)) + self.ui.labelHumanFriendlyTTLDescription.setText( + _translate("MainWindow", "%n hour(s)", None, QtCore.QCoreApplication.CodecForTr, numberOfHours) + + ", " + + _translate("MainWindow", "not recommended for chans", None, QtCore.QCoreApplication.CodecForTr) + ) + stylesheet = "QLabel { color : red; }" + font.setBold(True) else: numberOfDays = int(round(TTL / (24*60*60))) self.ui.labelHumanFriendlyTTLDescription.setText(_translate("MainWindow", "%n day(s)", None, QtCore.QCoreApplication.CodecForTr, numberOfDays)) + font.setBold(False) + self.ui.labelHumanFriendlyTTLDescription.setStyleSheet(stylesheet) + self.ui.labelHumanFriendlyTTLDescription.setFont(font) # Show or hide the application window after clicking an item within the # tray icon or, on Windows, the try icon itself.