Commit 63016b4e authored by Laurent Montel's avatar Laurent Montel 😁

Allow to specify range

parent 48bb4fc6
......@@ -168,13 +168,6 @@ QString SelectDateWidget::dateValue(SelectDateWidget::DateType type) const
case Day:
str = QStringLiteral("%1").arg(mDateValue->value(), 2, 10, QLatin1Char('0'));
break;
case Date:
str = QLocale::c().toString(mDateEdit->date());
break;
case Julian:
//TODO
str = QLocale::c().toString(mDateEdit->date());
break;
case Hour:
str = QStringLiteral("%1").arg(mDateValue->value(), 2, 10, QLatin1Char('0'));
break;
......@@ -184,6 +177,16 @@ QString SelectDateWidget::dateValue(SelectDateWidget::DateType type) const
case Second:
str = QStringLiteral("%1").arg(mDateValue->value(), 2, 10, QLatin1Char('0'));
break;
case Weekday:
str = QStringLiteral("%1").arg(mDateValue->value());
break;
case Date:
str = QLocale::c().toString(mDateEdit->date());
break;
case Julian:
//TODO
str = QLocale::c().toString(mDateEdit->date());
break;
case Time:
str = QLocale::c().toString(mTimeEdit->time());
break;
......@@ -196,9 +199,6 @@ QString SelectDateWidget::dateValue(SelectDateWidget::DateType type) const
case Zone:
str = QLocale::c().toString(mDateEdit->date());
break;
case Weekday:
str = QStringLiteral("%1").arg(mDateValue->value());
break;
}
return str;
}
......@@ -308,7 +308,6 @@ void SelectDateWidget::setCode(const QString &type, const QString &value)
case Weekday:
case Year:
mStackWidget->setCurrentWidget(mDateValue);
qDebug() << "value "<<value;
mDateValue->setValue(value.toInt());
break;
case Date:
......
......@@ -33,6 +33,13 @@ SieveDateSpinBox::~SieveDateSpinBox()
}
void SieveDateSpinBox::setRange(int minValue, int maxValue)
{
//We need to define specialValueText => we set minimum to minimum - 1
setMaximum(maxValue);
setMinimum(minValue - 1);
}
void SieveDateSpinBox::setType(KSieveUi::SelectDateWidget::DateType type)
{
mType = type;
......
......@@ -33,6 +33,8 @@ public:
~SieveDateSpinBox();
void setType(KSieveUi::SelectDateWidget::DateType type);
void setRange(int minValue, int maxValue);
void setCode(const QString &value);
QString code() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment