Fixed spinbox ranges

This commit is contained in:
TranRed 2019-07-19 13:15:50 +02:00
parent 7a3673e9f6
commit c45bb144e9

View file

@ -88,8 +88,11 @@ AdvancedPage::AdvancedPage()
maxLabel->setText("Maximum timeout duration is 2 weeks = 14 days = 336 " maxLabel->setText("Maximum timeout duration is 2 weeks = 14 days = 336 "
"hours = 20,160 minutes = 1,209,600 seconds."); "hours = 20,160 minutes = 1,209,600 seconds.");
auto allowedLabel = timeoutLayout.emplace<QLabel>(); auto allowedLabel = timeoutLayout.emplace<QLabel>();
allowedLabel->setText("For simplicity only values from 1 to 99 are allowed here." allowedLabel->setText(
"Using the units accordingly is highly recommended." "For simplicity only values from 1 to 99 are allowed here. Using "
"the units accordingly is highly recommended.");
auto commandLabel = timeoutLayout.emplace<QLabel>();
commandLabel->setText(
"For abitrary timeout durations use the /timeout command."); "For abitrary timeout durations use the /timeout command.");
auto timeout1 = timeoutLayout.emplace<QHBoxLayout>().withoutMargin(); auto timeout1 = timeoutLayout.emplace<QHBoxLayout>().withoutMargin();
@ -109,7 +112,7 @@ AdvancedPage::AdvancedPage()
timeout1.append(timeoutDurationUnit1); timeout1.append(timeoutDurationUnit1);
QSpinBox *spinBoxDurationCalculated1 = new QSpinBox; QSpinBox *spinBoxDurationCalculated1 = new QSpinBox;
spinBoxDurationCalculated1->setRange(1, 99); spinBoxDurationCalculated1->setRange(1, 1209600);
spinBoxDurationCalculated1->setValue( spinBoxDurationCalculated1->setValue(
getSettings()->timeoutDurationInSec1); getSettings()->timeoutDurationInSec1);
spinBoxDurationCalculated1->setReadOnly(true); spinBoxDurationCalculated1->setReadOnly(true);
@ -166,7 +169,7 @@ AdvancedPage::AdvancedPage()
timeout2.append(timeoutDurationUnit2); timeout2.append(timeoutDurationUnit2);
QSpinBox *spinBoxDurationCalculated2 = new QSpinBox; QSpinBox *spinBoxDurationCalculated2 = new QSpinBox;
spinBoxDurationCalculated2->setRange(1, 99); spinBoxDurationCalculated2->setRange(1, 1209600);
spinBoxDurationCalculated2->setValue( spinBoxDurationCalculated2->setValue(
getSettings()->timeoutDurationInSec2); getSettings()->timeoutDurationInSec2);
spinBoxDurationCalculated2->setReadOnly(true); spinBoxDurationCalculated2->setReadOnly(true);
@ -223,7 +226,7 @@ AdvancedPage::AdvancedPage()
timeout3.append(timeoutDurationUnit3); timeout3.append(timeoutDurationUnit3);
QSpinBox *spinBoxDurationCalculated3 = new QSpinBox; QSpinBox *spinBoxDurationCalculated3 = new QSpinBox;
spinBoxDurationCalculated3->setRange(1, 99); spinBoxDurationCalculated3->setRange(1, 1209600);
spinBoxDurationCalculated3->setValue( spinBoxDurationCalculated3->setValue(
getSettings()->timeoutDurationInSec3); getSettings()->timeoutDurationInSec3);
spinBoxDurationCalculated3->setReadOnly(true); spinBoxDurationCalculated3->setReadOnly(true);
@ -279,7 +282,7 @@ AdvancedPage::AdvancedPage()
timeout4.append(timeoutDurationUnit4); timeout4.append(timeoutDurationUnit4);
QSpinBox *spinBoxDurationCalculated4 = new QSpinBox; QSpinBox *spinBoxDurationCalculated4 = new QSpinBox;
spinBoxDurationCalculated4->setRange(1, 99); spinBoxDurationCalculated4->setRange(1, 1209600);
spinBoxDurationCalculated4->setValue( spinBoxDurationCalculated4->setValue(
getSettings()->timeoutDurationInSec4); getSettings()->timeoutDurationInSec4);
spinBoxDurationCalculated4->setReadOnly(true); spinBoxDurationCalculated4->setReadOnly(true);
@ -335,7 +338,7 @@ AdvancedPage::AdvancedPage()
timeout5.append(timeoutDurationUnit5); timeout5.append(timeoutDurationUnit5);
QSpinBox *spinBoxDurationCalculated5 = new QSpinBox; QSpinBox *spinBoxDurationCalculated5 = new QSpinBox;
spinBoxDurationCalculated5->setRange(1, 99); spinBoxDurationCalculated5->setRange(1, 1209600);
spinBoxDurationCalculated5->setValue( spinBoxDurationCalculated5->setValue(
getSettings()->timeoutDurationInSec5); getSettings()->timeoutDurationInSec5);
spinBoxDurationCalculated5->setReadOnly(true); spinBoxDurationCalculated5->setReadOnly(true);
@ -391,7 +394,7 @@ AdvancedPage::AdvancedPage()
timeout6.append(timeoutDurationUnit6); timeout6.append(timeoutDurationUnit6);
QSpinBox *spinBoxDurationCalculated6 = new QSpinBox; QSpinBox *spinBoxDurationCalculated6 = new QSpinBox;
spinBoxDurationCalculated6->setRange(1, 99); spinBoxDurationCalculated6->setRange(1, 1209600);
spinBoxDurationCalculated6->setValue( spinBoxDurationCalculated6->setValue(
getSettings()->timeoutDurationInSec6); getSettings()->timeoutDurationInSec6);
spinBoxDurationCalculated6->setReadOnly(true); spinBoxDurationCalculated6->setReadOnly(true);
@ -448,7 +451,7 @@ AdvancedPage::AdvancedPage()
timeout7.append(timeoutDurationUnit7); timeout7.append(timeoutDurationUnit7);
QSpinBox *spinBoxDurationCalculated7 = new QSpinBox; QSpinBox *spinBoxDurationCalculated7 = new QSpinBox;
spinBoxDurationCalculated7->setRange(1, 99); spinBoxDurationCalculated7->setRange(1, 1209600);
spinBoxDurationCalculated7->setValue( spinBoxDurationCalculated7->setValue(
getSettings()->timeoutDurationInSec7); getSettings()->timeoutDurationInSec7);
spinBoxDurationCalculated7->setReadOnly(true); spinBoxDurationCalculated7->setReadOnly(true);
@ -504,7 +507,7 @@ AdvancedPage::AdvancedPage()
timeout8.append(timeoutDurationUnit8); timeout8.append(timeoutDurationUnit8);
QSpinBox *spinBoxDurationCalculated8 = new QSpinBox; QSpinBox *spinBoxDurationCalculated8 = new QSpinBox;
spinBoxDurationCalculated8->setRange(1, 99); spinBoxDurationCalculated8->setRange(1, 1209600);
spinBoxDurationCalculated8->setValue( spinBoxDurationCalculated8->setValue(
getSettings()->timeoutDurationInSec8); getSettings()->timeoutDurationInSec8);
spinBoxDurationCalculated8->setReadOnly(true); spinBoxDurationCalculated8->setReadOnly(true);