Commit 1348a767 authored by Dimitris Kardarakos's avatar Dimitris Kardarakos

Clear incidence page after editing

On week and day view, when the users finish editing an incidence, return
to the week/day view list
parent 5715e02f
Pipeline #20871 failed with stage
in 60 minutes and 1 second
......@@ -17,7 +17,7 @@ Kirigami.GlobalDrawer {
property var calendar
property bool wideScreen: false
title: _calindoriConfig.activeCalendar
title: _calindoriConfig && _calindoriConfig.activeCalendar
handleVisible: !root.wideScreen
modal: !root.wideScreen
......
......@@ -22,6 +22,20 @@ ListView {
signal addEvent
signal addTodo
/**
* @brief Remove the editor page from the stack. If an incidence page exists in the page stack, remove it as well
*
*/
function removeEditorPage(editor)
{
var incidencePageExists = pageStack.items[pageStack.depth-2] && pageStack.items[pageStack.depth - 2].hasOwnProperty("isIncidencePage");
pageStack.pop(eventEditor);
if(incidencePageExists)
{
pageStack.pop(incidencePage);
}
}
onNextDay: {
var next = selectedDate;
next.setDate(selectedDate.getDate() + 1)
......@@ -132,12 +146,10 @@ ListView {
id: eventEditor
EventEditor {
calendar: root.cal
onEditcompleted: {
pageStack.pop(eventEditor);
pageStack.flickBack ()
}
onEditcompleted: removeEditorPage(eventEditor)
}
}
......@@ -147,10 +159,7 @@ ListView {
TodoEditor {
calendar: root.cal
onEditcompleted: {
pageStack.pop(todoEditor);
pageStack.flickBack ()
}
onEditcompleted: removeEditorPage(todoEditor)
}
}
......
......@@ -78,7 +78,7 @@ Kirigami.Card {
Controls2.Label {
wrapMode: Text.WordWrap
text: dataModel && _repeatModel.repeatDescription(dataModel.repeatType, dataModel.repeatEvery, dataModel.repeatStopAfter)
text: dataModel && _repeatModel && _repeatModel.repeatDescription(dataModel.repeatType, dataModel.repeatEvery, dataModel.repeatStopAfter)
Layout.fillWidth: true
}
}
......
......@@ -12,6 +12,7 @@ Kirigami.Page {
property var incidence
property var calendar
property bool isIncidencePage: true
title: incidence && incidence.summary
......
......@@ -25,6 +25,20 @@ ListView {
signal addEvent
signal addTodo
/**
* @brief Remove the editor page from the stack. If an incidence page exists in the page stack, remove it as well
*
*/
function removeEditorPage(editor)
{
var incidencePageExists = pageStack.items[pageStack.depth-2] && pageStack.items[pageStack.depth - 2].hasOwnProperty("isIncidencePage");
pageStack.pop(eventEditor);
if(incidencePageExists)
{
pageStack.pop(incidencePage);
}
}
function moveDate(startDt, offset)
{
var movedDt = startDt;
......@@ -141,10 +155,7 @@ ListView {
EventEditor {
calendar: root.cal
onEditcompleted: {
pageStack.pop(eventEditor);
pageStack.flickBack ()
}
onEditcompleted: removeEditorPage(eventEditor)
}
}
......@@ -154,10 +165,7 @@ ListView {
TodoEditor {
calendar: root.cal
onEditcompleted: {
pageStack.pop(todoEditor);
pageStack.flickBack ()
}
onEditcompleted: removeEditorPage(todoEditor)
}
}
......
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