changed max custom timeout input to 99

simplicity
This commit is contained in:
TranRed 2019-07-18 23:34:40 +02:00
parent 24faaf8734
commit 7a3673e9f6

View file

@ -87,12 +87,16 @@ AdvancedPage::AdvancedPage()
auto maxLabel = timeoutLayout.emplace<QLabel>();
maxLabel->setText("Maximum timeout duration is 2 weeks = 14 days = 336 "
"hours = 20,160 minutes = 1,209,600 seconds.");
auto allowedLabel = timeoutLayout.emplace<QLabel>();
allowedLabel->setText("For simplicity only values from 1 to 99 are allowed here."
"Using the units accordingly is highly recommended."
"For abitrary timeout durations use the /timeout command.");
auto timeout1 = timeoutLayout.emplace<QHBoxLayout>().withoutMargin();
{
QLineEdit *lineEditDurationInput1 = new QLineEdit;
lineEditDurationInput1->setValidator(
new QIntValidator(1, 1209600, this));
new QIntValidator(1, 99, this));
lineEditDurationInput1->setText(
getSettings()->timeoutDurationPerUnit1);
lineEditDurationInput1->setAlignment(Qt::AlignRight);
@ -105,7 +109,7 @@ AdvancedPage::AdvancedPage()
timeout1.append(timeoutDurationUnit1);
QSpinBox *spinBoxDurationCalculated1 = new QSpinBox;
spinBoxDurationCalculated1->setRange(1, 1209600);
spinBoxDurationCalculated1->setRange(1, 99);
spinBoxDurationCalculated1->setValue(
getSettings()->timeoutDurationInSec1);
spinBoxDurationCalculated1->setReadOnly(true);
@ -149,7 +153,7 @@ AdvancedPage::AdvancedPage()
{
QLineEdit *lineEditDurationInput2 = new QLineEdit;
lineEditDurationInput2->setValidator(
new QIntValidator(1, 1209600, this));
new QIntValidator(1, 99, this));
lineEditDurationInput2->setText(
getSettings()->timeoutDurationPerUnit2);
lineEditDurationInput2->setAlignment(Qt::AlignRight);
@ -162,7 +166,7 @@ AdvancedPage::AdvancedPage()
timeout2.append(timeoutDurationUnit2);
QSpinBox *spinBoxDurationCalculated2 = new QSpinBox;
spinBoxDurationCalculated2->setRange(1, 1209600);
spinBoxDurationCalculated2->setRange(1, 99);
spinBoxDurationCalculated2->setValue(
getSettings()->timeoutDurationInSec2);
spinBoxDurationCalculated2->setReadOnly(true);
@ -206,7 +210,7 @@ AdvancedPage::AdvancedPage()
{
QLineEdit *lineEditDurationInput3 = new QLineEdit;
lineEditDurationInput3->setValidator(
new QIntValidator(1, 1209600, this));
new QIntValidator(1, 99, this));
lineEditDurationInput3->setText(
getSettings()->timeoutDurationPerUnit3);
lineEditDurationInput3->setAlignment(Qt::AlignRight);
@ -219,7 +223,7 @@ AdvancedPage::AdvancedPage()
timeout3.append(timeoutDurationUnit3);
QSpinBox *spinBoxDurationCalculated3 = new QSpinBox;
spinBoxDurationCalculated3->setRange(1, 1209600);
spinBoxDurationCalculated3->setRange(1, 99);
spinBoxDurationCalculated3->setValue(
getSettings()->timeoutDurationInSec3);
spinBoxDurationCalculated3->setReadOnly(true);
@ -262,7 +266,7 @@ AdvancedPage::AdvancedPage()
{
QLineEdit *lineEditDurationInput4 = new QLineEdit;
lineEditDurationInput4->setValidator(
new QIntValidator(1, 1209600, this));
new QIntValidator(1, 99, this));
lineEditDurationInput4->setText(
getSettings()->timeoutDurationPerUnit4);
lineEditDurationInput4->setAlignment(Qt::AlignRight);
@ -275,7 +279,7 @@ AdvancedPage::AdvancedPage()
timeout4.append(timeoutDurationUnit4);
QSpinBox *spinBoxDurationCalculated4 = new QSpinBox;
spinBoxDurationCalculated4->setRange(1, 1209600);
spinBoxDurationCalculated4->setRange(1, 99);
spinBoxDurationCalculated4->setValue(
getSettings()->timeoutDurationInSec4);
spinBoxDurationCalculated4->setReadOnly(true);
@ -318,7 +322,7 @@ AdvancedPage::AdvancedPage()
{
QLineEdit *lineEditDurationInput5 = new QLineEdit;
lineEditDurationInput5->setValidator(
new QIntValidator(1, 1209600, this));
new QIntValidator(1, 99, this));
lineEditDurationInput5->setText(
getSettings()->timeoutDurationPerUnit5);
lineEditDurationInput5->setAlignment(Qt::AlignRight);
@ -331,7 +335,7 @@ AdvancedPage::AdvancedPage()
timeout5.append(timeoutDurationUnit5);
QSpinBox *spinBoxDurationCalculated5 = new QSpinBox;
spinBoxDurationCalculated5->setRange(1, 1209600);
spinBoxDurationCalculated5->setRange(1, 99);
spinBoxDurationCalculated5->setValue(
getSettings()->timeoutDurationInSec5);
spinBoxDurationCalculated5->setReadOnly(true);
@ -374,7 +378,7 @@ AdvancedPage::AdvancedPage()
{
QLineEdit *lineEditDurationInput6 = new QLineEdit;
lineEditDurationInput6->setValidator(
new QIntValidator(1, 1209600, this));
new QIntValidator(1, 99, this));
lineEditDurationInput6->setText(
getSettings()->timeoutDurationPerUnit6);
lineEditDurationInput6->setAlignment(Qt::AlignRight);
@ -387,7 +391,7 @@ AdvancedPage::AdvancedPage()
timeout6.append(timeoutDurationUnit6);
QSpinBox *spinBoxDurationCalculated6 = new QSpinBox;
spinBoxDurationCalculated6->setRange(1, 1209600);
spinBoxDurationCalculated6->setRange(1, 99);
spinBoxDurationCalculated6->setValue(
getSettings()->timeoutDurationInSec6);
spinBoxDurationCalculated6->setReadOnly(true);
@ -431,7 +435,7 @@ AdvancedPage::AdvancedPage()
{
QLineEdit *lineEditDurationInput7 = new QLineEdit;
lineEditDurationInput7->setValidator(
new QIntValidator(1, 1209600, this));
new QIntValidator(1, 99, this));
lineEditDurationInput7->setText(
getSettings()->timeoutDurationPerUnit7);
lineEditDurationInput7->setAlignment(Qt::AlignRight);
@ -444,7 +448,7 @@ AdvancedPage::AdvancedPage()
timeout7.append(timeoutDurationUnit7);
QSpinBox *spinBoxDurationCalculated7 = new QSpinBox;
spinBoxDurationCalculated7->setRange(1, 1209600);
spinBoxDurationCalculated7->setRange(1, 99);
spinBoxDurationCalculated7->setValue(
getSettings()->timeoutDurationInSec7);
spinBoxDurationCalculated7->setReadOnly(true);
@ -487,7 +491,7 @@ AdvancedPage::AdvancedPage()
{
QLineEdit *lineEditDurationInput8 = new QLineEdit;
lineEditDurationInput8->setValidator(
new QIntValidator(1, 1209600, this));
new QIntValidator(1, 99, this));
lineEditDurationInput8->setText(
getSettings()->timeoutDurationPerUnit8);
lineEditDurationInput8->setAlignment(Qt::AlignRight);
@ -500,7 +504,7 @@ AdvancedPage::AdvancedPage()
timeout8.append(timeoutDurationUnit8);
QSpinBox *spinBoxDurationCalculated8 = new QSpinBox;
spinBoxDurationCalculated8->setRange(1, 1209600);
spinBoxDurationCalculated8->setRange(1, 99);
spinBoxDurationCalculated8->setValue(
getSettings()->timeoutDurationInSec8);
spinBoxDurationCalculated8->setReadOnly(true);