Call to save updater, confirm final input of a day

This commit is contained in:
Alexis Delhaie
2020-09-24 10:53:33 +02:00
parent 257bc67f61
commit 4308d9e93a
15 changed files with 404 additions and 48 deletions

View File

@@ -28,6 +28,10 @@ void Day::set_time_break(double value)
time_break = value;
}
void Day::set_validate(bool value) {
validate = value;
}
QTime Day::get_start()
{
return start;
@@ -48,7 +52,8 @@ QJsonObject Day::to_json()
QJsonObject obj{
{KEY_START, start.toString(Qt::DateFormat::ISODate)},
{KEY_END, end.toString(Qt::DateFormat::ISODate)},
{KEY_BREAK, time_break}
{KEY_BREAK, time_break},
{KEY_VALIDATE, validate}
};
return obj;
@@ -61,6 +66,11 @@ Day Day::from_json(QJsonObject obj)
result.start = QTime::fromString(obj[KEY_START].toString(), Qt::DateFormat::ISODate);
result.end = QTime::fromString(obj[KEY_END].toString(), Qt::DateFormat::ISODate);
result.time_break = obj[KEY_BREAK].toDouble();
result.validate = obj[KEY_VALIDATE].toBool();
return result;
}
bool Day::get_validate() {
return validate;
}