Commit 73a2c580 authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Added Connections component to ensure start and end times are updated correctly in editor

parent 11b25fcc
Pipeline #92125 passed with stage
in 4 minutes and 20 seconds
......@@ -228,6 +228,20 @@ Kirigami.ScrollablePage {
checked: root.incidenceWrapper.allDay
onCheckedChanged: root.incidenceWrapper.allDay = checked
}
Connections {
target: root.incidenceWrapper
function onIncidenceStartChanged() {
incidenceStartDateCombo.dateTime = incidenceStart;
incidenceStartTimeCombo.dateTime = incidenceStart;
}
function onIncidenceEndChanged() {
incidenceEndDateCombo.dateTime = incidenceEnd;
incidenceEndTimeCombo.dateTime = incidenceEnd;
}
}
RowLayout {
id: incidenceStartLayout
......@@ -245,7 +259,7 @@ Kirigami.ScrollablePage {
if (!checked && incidenceForm.isTodo) {
oldDate = new Date(root.incidenceWrapper.incidenceStart)
root.incidenceWrapper.incidenceStart = new Date(undefined)
// } else if(incidenceForm.isTodo) {
} else if(incidenceForm.isTodo) {
root.incidenceWrapper.incidenceStart = oldDate
}
}
......@@ -260,7 +274,7 @@ Kirigami.ScrollablePage {
timePicker: incidenceStartTimeCombo.timePicker
timeZoneOffset: root.incidenceWrapper.timeZoneUTCOffsetMins
dateTime: root.incidenceWrapper.incidenceStart
onNewDateChosen: root.setNewStart(newDate), dateTimeChanged()
onNewDateChosen: root.setNewStart(newDate)
}
TimeCombo {
id: incidenceStartTimeCombo
......@@ -268,7 +282,7 @@ Kirigami.ScrollablePage {
Layout.fillWidth: true
timeZoneOffset: root.incidenceWrapper.timeZoneUTCOffsetMins
dateTime: root.incidenceWrapper.incidenceStart
onNewTimeChosen: root.setNewStart(newTime), dateTimeChanged()
onNewTimeChosen: root.setNewStart(newTime)
enabled: !allDayCheckBox.checked && (!incidenceForm.isTodo || incidenceStartCheckBox.checked)
visible: !allDayCheckBox.checked
}
......@@ -304,7 +318,7 @@ Kirigami.ScrollablePage {
timePicker: incidenceEndTimeCombo.timePicker
timeZoneOffset: root.incidenceWrapper.timeZoneUTCOffsetMins
dateTime: root.incidenceWrapper.incidenceEnd
onNewDateChosen: root.incidenceWrapper.incidenceEnd = newDate, dateTimeChanged()
onNewDateChosen: root.incidenceWrapper.incidenceEnd = newDate
enabled: !incidenceForm.isTodo || (incidenceForm.isTodo && incidenceEndCheckBox.checked)
}
TimeCombo {
......@@ -313,7 +327,7 @@ Kirigami.ScrollablePage {
Layout.fillWidth: true
timeZoneOffset: root.incidenceWrapper.timeZoneUTCOffsetMins
dateTime: root.incidenceWrapper.incidenceEnd
onNewTimeChosen: root.incidenceWrapper.incidenceEnd = newTime, dateTimeChanged()
onNewTimeChosen: root.incidenceWrapper.incidenceEnd = newTime
enabled: (!incidenceForm.isTodo && !allDayCheckBox.checked) || (incidenceForm.isTodo && incidenceEndCheckBox.checked)
visible: !allDayCheckBox.checked
}
......
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