Commit fcdd4227 authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Stop overusing signals everywhere

This should help clean up our code by removing signals that are unnecessary
parent e35c232f
Pipeline #183767 passed with stage
in 3 minutes and 8 seconds
......@@ -7,6 +7,7 @@ import QtQuick.Controls 2.15 as QQC2
import org.kde.kirigami 2.14 as Kirigami
import org.kde.kalendar 1.0 as Kalendar
import org.kde.kalendar.utils 1.0
import "dateutils.js" as DateUtils
import "labelutils.js" as LabelUtils
......@@ -176,10 +177,10 @@ Item {
drag.target: !Kirigami.Settings.isMobile && !modelData.isReadOnly && incidenceDelegate.dragDropEnabled ? parent : undefined
onReleased: parent.Drag.drop()
onViewClicked: viewIncidence(modelData)
onEditClicked: editIncidence(incidencePtr)
onDeleteClicked: deleteIncidence(incidencePtr, deleteDate)
onTodoCompletedClicked: completeTodo(incidencePtr)
onAddSubTodoClicked: root.addSubTodo(parentWrapper)
onViewClicked: KalendarUiUtils.setUpView(modelData)
onEditClicked: KalendarUiUtils.setUpEdit(modelData.incidencePtr)
onDeleteClicked: KalendarUiUtils.setUpDelete(modelData.incidencePtr, deleteDate)
onTodoCompletedClicked: KalendarUiUtils.completeTodo(incidencePtr)
onAddSubTodoClicked: KalendarUiUtils.setUpAddSubTodo(parentWrapper)
}
}
......@@ -9,22 +9,13 @@ import QtQuick.Controls 2.15 as QQC2
import org.kde.kirigami 2.14 as Kirigami
import org.kde.kalendar 1.0 as Kalendar
import org.kde.kalendar.utils 1.0
import "dateutils.js" as DateUtils
import "labelutils.js" as LabelUtils
Item {
id: root
signal addIncidence(int type, date addDate)
signal viewIncidence(var modelData)
signal editIncidence(var incidencePtr)
signal deleteIncidence(var incidencePtr, date deleteDate)
signal completeTodo(var incidencePtr)
signal addSubTodo(var parentWrapper)
signal deselect()
signal moveIncidence(int startOffset, date occurrenceDate, var incidenceWrapper, Item caughtDelegate)
signal openDayView(date selectedDate)
property var openOccurrence
property var model
......@@ -154,8 +145,8 @@ Item {
id: backgroundDayMouseArea
anchors.fill: parent
addDate: gridItem.date
onAddNewIncidence: addIncidence(type, addDate)
onDeselect: root.deselect()
onAddNewIncidence: KalendarUiUtils.setUpAdd(type, addDate)
onDeselect: KalendarUiUtils.appMain.incidenceInfoDrawer.close()
DropArea {
id: incidenceDropArea
......@@ -175,7 +166,7 @@ Item {
let sameTimeOnDate = new Date(backgroundDayMouseArea.addDate);
sameTimeOnDate = new Date(sameTimeOnDate.setHours(drop.source.occurrenceDate.getHours(), drop.source.occurrenceDate.getMinutes()));
const offset = sameTimeOnDate.getTime() - drop.source.occurrenceDate.getTime();
root.moveIncidence(offset, drop.source.occurrenceDate, incidenceWrapper, drop.source);
KalendarUiUtils.setUpIncidenceDateChange(incidenceWrapper, offset, offset, drop.source.occurrenceDate, drop.source)
}
}
}
......@@ -191,7 +182,7 @@ Item {
flat: true
visible: root.showDayIndicator
enabled: root.daysToShow > 1
onClicked: root.openDayView(gridItem.date)
onClicked: KalendarUiUtils.openDayLayer(gridItem.date)
contentItem: RowLayout {
id: dayNumberLayout
......@@ -290,7 +281,7 @@ Item {
var localpos = child.mapFromGlobal(globalPos.x, globalPos.y);
if(child.contains(localpos) && child.gridSquareDate) {
addIncidence(type, child.gridSquareDate);
KalendarUiUtils.setUpAdd(type, child.gridSquareDate);
} else {
useGridSquareDate(type, child, globalPos);
}
......@@ -298,7 +289,7 @@ Item {
}
onAddNewIncidence: useGridSquareDate(type, applicationWindow().contentItem, this.mapToGlobal(clickX, clickY))
onDeselect: root.deselect()
onDeselect: KalendarUiUtils.appMain.incidenceInfoDrawer.close()
}
model: incidences
......
......@@ -8,24 +8,13 @@ import org.kde.kirigami 2.14 as Kirigami
import QtGraphicalEffects 1.12
import org.kde.kalendar 1.0 as Kalendar
import org.kde.kalendar.utils 1.0
import "dateutils.js" as DateUtils
import "labelutils.js" as LabelUtils
Kirigami.Page {
id: root
signal addIncidence(int type, date addDate, bool includeTime)
signal viewIncidence(var modelData)
signal editIncidence(var incidencePtr)
signal deleteIncidence(var incidencePtr, date deleteDate)
signal completeTodo(var incidencePtr)
signal addSubTodo(var parentWrapper)
signal deselect()
signal moveIncidence(int startOffset, date occurrenceDate, var incidenceWrapper, Item caughtDelegate)
signal convertIncidence(bool allDay, int startOffset, int endOffset, date occurrenceDate, var incidenceWrapper, Item caughtDelegate)
signal resizeIncidence(int endOffset, date occurrenceDate, var incidenceWrapper, Item caughtDelegate)
signal openDayView(date selectedDate)
property var openOccurrence: ({})
property var model
......@@ -285,7 +274,7 @@ Kirigami.Page {
flat: true
enabled: root.daysToShow > 1
onClicked: root.openDayView(dayHeading.headingDate)
onClicked: KalendarUiUtils.openDayLayer(dayHeading.headingDate)
}
}
}
......@@ -496,7 +485,7 @@ Kirigami.Page {
addDate: parent.date
onAddNewIncidence: root.addIncidence(type, addDate, false)
onDeselect: root.deselect()
onDeselect: KalendarUiUtils.appMain.incidenceInfoDrawer.close()
DropArea {
id: multiDayViewIncidenceDropArea
......@@ -519,9 +508,9 @@ Kirigami.Page {
*/
if (drop.source.objectName === 'hourlyIncidenceDelegateBackgroundBackground') {
// This is conversion from non-multiday to multiday
root.convertIncidence(true, offset, offset, drop.source.occurrenceDate, incidenceWrapper, drop.source);
KalendarUiUtils.setUpIncidenceDateChange(incidenceWrapper, offset, offset, drop.source.occurrenceDate, drop.source, true)
} else {
root.moveIncidence(offset, drop.source.occurrenceDate, incidenceWrapper, drop.source);
KalendarUiUtils.setUpIncidenceDateChange(incidenceWrapper, offset, offset, drop.source.occurrenceDate, drop.source)
}
}
}
......@@ -843,7 +832,8 @@ Kirigami.Page {
const posDate = new Date(backgroundDayMouseArea.addDate.getFullYear(), backgroundDayMouseArea.addDate.getMonth(), backgroundDayMouseArea.addDate.getDate(), backgroundRectangle.index, dropAreaRepeater.minutes * index);
const startOffset = posDate.getTime() - drop.source.occurrenceDate.getTime();
root.moveIncidence(startOffset, drop.source.occurrenceDate, incidenceWrapper, drop.source);
KalendarUiUtils.setUpIncidenceDateChange(incidenceWrapper, startOffset, startOffset, drop.source.occurrenceDate, drop.source);
} else if(drop.source.objectName === "multiDayIncidenceDelegateBackgroundBackground") {
incidenceWrapper.incidenceItem = Kalendar.CalendarManager.incidenceItem(drop.source.incidencePtr);
......@@ -861,7 +851,7 @@ Kirigami.Page {
const startOffset = startPosDate.getTime() - drop.source.occurrenceDate.getTime();
const endOffset = endPosDate.getTime() - drop.source.occurrenceEndDate.getTime();
root.convertIncidence(false, startOffset, endOffset, drop.source.occurrenceDate, incidenceWrapper, drop.source);
KalendarUiUtils.setUpIncidenceDateChange(incidenceWrapper, startOffset, endOffset, drop.source.occurrenceDate, drop.source);
} else { // The resize affects the end time
incidenceWrapper.incidenceItem = Kalendar.CalendarManager.incidenceItem(drop.source.resizerSeparator.parent.incidencePtr);
......@@ -878,7 +868,8 @@ Kirigami.Page {
const posDate = new Date(backgroundDayMouseArea.addDate.getFullYear(), backgroundDayMouseArea.addDate.getMonth(), backgroundDayMouseArea.addDate.getDate(), hour, minute);
const endOffset = posDate.getTime() - drop.source.resizerSeparator.parent.occurrenceEndDate.getTime();
root.resizeIncidence(endOffset, drop.source.resizerSeparator.parent.occurrenceDate, incidenceWrapper, drop.source.resizerSeparator.parent);
KalendarUiUtils.setUpIncidenceDateChange(incidenceWrapper, 0, endOffset, drop.source.resizerSeparator.parent.occurrenceDate, drop.source.resizerSeparator.parent);
}
}
......@@ -896,8 +887,8 @@ Kirigami.Page {
id: backgroundDayMouseArea
anchors.fill: parent
addDate: new Date(DateUtils.addDaysToDate(viewLoader.startDate, dayColumn.index).setHours(index))
onAddNewIncidence: addIncidence(type, addDate, true)
onDeselect: root.deselect()
onAddNewIncidence: KalendarUiUtils.setUpAdd(type, addDate, null, true)
onDeselect: KalendarUiUtils.appMain.incidenceInfoDrawer.close()
}
}
}
......@@ -1068,11 +1059,11 @@ Kirigami.Page {
drag.target: !Kirigami.Settings.isMobile && !modelData.isReadOnly && root.dragDropEnabled ? parent : undefined
onReleased: parent.Drag.drop()
onViewClicked: viewIncidence(modelData)
onEditClicked: editIncidence(incidencePtr)
onDeleteClicked: deleteIncidence(incidencePtr, deleteDate)
onTodoCompletedClicked: completeTodo(incidencePtr)
onAddSubTodoClicked: root.addSubTodo(parentWrapper)
onViewClicked: KalendarUiUtils.setUpView(modelData)
onEditClicked: KalendarUiUtils.setUpEdit(incidencePtr)
onDeleteClicked: KalendarUiUtils.setUpDelete(incidencePtr, deleteDate)
onTodoCompletedClicked: KalendarUiUtils.completeTodo(incidencePtr)
onAddSubTodoClicked: KalendarUiUtils.setUpAddSubTodo(parentWrapper)
}
ResizerSeparator {
......
......@@ -14,16 +14,6 @@ import "dateutils.js" as DateUtils
Kirigami.Page {
id: monthPage
signal addIncidence(int type, date addDate)
signal viewIncidence(var modelData)
signal editIncidence(var incidencePtr)
signal deleteIncidence(var incidencePtr, date deleteDate)
signal completeTodo(var incidencePtr)
signal addSubTodo(var parentWrapper)
signal deselect()
signal moveIncidence(int startOffset, date occurrenceDate, var incidenceWrapper, Item caughtDelegate)
signal openDayView(date selectedDate)
property var openOccurrence
property var model
property date startDate
......@@ -212,16 +202,6 @@ Kirigami.Page {
}
openOccurrence: monthPage.openOccurrence
onAddIncidence: monthPage.addIncidence(type, addDate)
onViewIncidence: monthPage.viewIncidence(modelData)
onEditIncidence: monthPage.editIncidence(incidencePtr)
onDeleteIncidence: monthPage.deleteIncidence(incidencePtr, deleteDate)
onCompleteTodo: monthPage.completeTodo(incidencePtr)
onAddSubTodo: monthPage.addSubTodo(parentWrapper)
onDeselect: monthPage.deselect()
onMoveIncidence: monthPage.moveIncidence(startOffset, occurrenceDate, incidenceWrapper, caughtDelegate)
onOpenDayView: monthPage.openDayView(selectedDate)
}
}
}
......
......@@ -8,29 +8,47 @@ import QtQuick.Controls 2.15 as QQC2
import org.kde.kirigami 2.14 as Kirigami
import org.kde.kalendar 1.0 as Kalendar
import org.kde.kalendar.utils 1.0
import "dateutils.js" as DateUtils
import "labelutils.js" as LabelUtils
Kirigami.Page {
id: root
signal addIncidence(int type, date addDate)
signal viewIncidence(var modelData)
signal editIncidence(var incidencePtr)
signal deleteIncidence(var incidencePtr, date deleteDate)
signal completeTodo(var incidencePtr)
signal addSubTodo(var parentWrapper)
signal deselect()
signal moveIncidence(int startOffset, date occurrenceDate, var incidenceWrapper, Item caughtDelegate)
signal openDayView(date selectedDate)
onAddIncidence: pathView.currentItem.item.savedYScrollPos = pathView.currentItem.item.QQC2.ScrollBar.vertical.visualPosition
onViewIncidence: pathView.currentItem.item.savedYScrollPos = pathView.currentItem.item.QQC2.ScrollBar.vertical.visualPosition
onEditIncidence: pathView.currentItem.item.savedYScrollPos = pathView.currentItem.item.QQC2.ScrollBar.vertical.visualPosition
onDeleteIncidence: pathView.currentItem.item.savedYScrollPos = pathView.currentItem.item.QQC2.ScrollBar.vertical.visualPosition
onCompleteTodo: pathView.currentItem.item.savedYScrollPos = pathView.currentItem.item.QQC2.ScrollBar.vertical.visualPosition
onAddSubTodo: pathView.currentItem.item.savedYScrollPos = pathView.currentItem.item.QQC2.ScrollBar.vertical.visualPosition
onMoveIncidence: pathView.currentItem.item.savedYScrollPos = pathView.currentItem.item.QQC2.ScrollBar.vertical.visualPosition
function addIncidence(type, addDate) {
pathView.currentItem.item.savedYScrollPos = pathView.currentItem.item.QQC2.ScrollBar.vertical.visualPosition;
KalendarUiUtils.setUpAdd(type, addDate);
}
function viewIncidence(modelData) {
pathView.currentItem.item.savedYScrollPos = pathView.currentItem.item.QQC2.ScrollBar.vertical.visualPosition;
KalendarUiUtils.setUpView(modelData);
}
function editIncidence(incidencePtr) {
pathView.currentItem.item.savedYScrollPos = pathView.currentItem.item.QQC2.ScrollBar.vertical.visualPosition;
KalendarUiUtils.setUpEdit(incidencePtr);
}
function deleteIncidence(incidencePtr, deleteDate) {
pathView.currentItem.item.savedYScrollPos = pathView.currentItem.item.QQC2.ScrollBar.vertical.visualPosition;
KalendarUiUtils.setUpDelete(incidencePtr, deleteDate);
}
function completeTodo(incidencePtr) {
pathView.currentItem.item.savedYScrollPos = pathView.currentItem.item.QQC2.ScrollBar.vertical.visualPosition;
KalendarUiUtils.completeTodo(incidencePtr);
}
function addSubTodo(parentWrapper) {
pathView.currentItem.item.savedYScrollPos = pathView.currentItem.item.QQC2.ScrollBar.vertical.visualPosition;
KalendarUiUtils.setUpAddSubTodo(parentWrapper);
}
function moveIncidence(startOffset, occurrenceDate, incidenceWrapper, caughtDelegate) {
pathView.currentItem.item.savedYScrollPos = pathView.currentItem.item.QQC2.ScrollBar.vertical.visualPosition;
KalendarUiUtils.setUpIncidenceDateChange(incidenceWrapper, startOffset, startOffset, occurrenceDate, caughtDelegate);
}
property var openOccurrence
property var model
......@@ -223,7 +241,7 @@ Kirigami.Page {
addDate: periodStartDate
onAddNewIncidence: addIncidence(type, addDate)
onDeselect: root.deselect()
onDeselect: KalendarUiUtils.appMain.incidenceInfoDrawer.close()
Rectangle {
id: backgroundRectangle
......@@ -315,7 +333,7 @@ Kirigami.Page {
rightPadding: Kirigami.Units.largeSpacing
flat: true
onClicked: root.openDayView(periodStartDate)
onClicked: KalendarUiUtils.openDayLayer(periodStartDate)
property Item smallDayLabel: QQC2.Label {
id: smallDayLabel
......
......@@ -9,20 +9,13 @@ import org.kde.kirigami 2.14 as Kirigami
//import org.kde.kirigamiaddons.treeview 1.0 as KirigamiAddonsTreeView
import org.kde.kalendar 1.0 as Kalendar
import org.kde.kalendar.utils 1.0
import "dateutils.js" as DateUtils
import "labelutils.js" as LabelUtils
TreeListView {
id: root
signal addTodo(int collectionId)
signal viewTodo(var todoData)
signal editTodo(var todoPtr)
signal deleteTodo(var todoPtr, date deleteDate)
signal completeTodo(var todoPtr)
signal addSubTodo(var parentWrapper)
signal deselect()
property date currentDate: new Date()
property var filter
property var filterCollectionDetails
......@@ -84,7 +77,7 @@ TreeListView {
anchors.fill: parent
enabled: !Kirigami.Settings.isMobile
parent: background
onClicked: deselect()
onClicked: KalendarUiUtils.appMain.incidenceInfoDrawer.close()
propagateComposedEvents: true
}
......@@ -116,7 +109,7 @@ TreeListView {
helpfulAction: Kirigami.Action {
text: i18n("Create")
icon.name: "list-add"
onTriggered: root.addTodo(filter.collectionId);
onTriggered: KalendarUiUtils.setUpAdd(IncidenceWrapper.TypeTodo, new Date(), filter.collectionId);
}
}
......@@ -190,27 +183,33 @@ TreeListView {
}
]
onClicked: KalendarUiUtils.setUpView(model)
contentItem: IncidenceMouseArea {
id: mouseArea
anchors.fill: undefined
implicitWidth: todoItemContents.implicitWidth
implicitHeight: todoItemContents.implicitHeight + (Kirigami.Settings.isMobile ? Kirigami.Units.largeSpacing : Kirigami.Units.smallSpacing)
incidenceData: model
collectionId: model.collectionId
acceptedButtons: Qt.RightButton
propagateComposedEvents: true
preventStealing: !Kirigami.Settings.tabletMode && !Kirigami.Settings.isMobile
drag.target: !Kirigami.Settings.isMobile && !model.isReadOnly && root.dragDropEnabled ? listItem : undefined
onReleased: listItem.Drag.drop()
onViewClicked: root.viewTodo(model), listItem.clicked()
onEditClicked: root.editTodo(model.incidencePtr)
onDeleteClicked: root.deleteTodo(model.incidencePtr, model.endTime ? model.endTime : model.startTime ? model.startTime : null)
onViewClicked: listItem.clicked()
onEditClicked: KalendarUiUtils.setUpEdit(model.incidencePtr)
onDeleteClicked: KalendarUiUtils.setUpDelete(model.incidencePtr,
model.endTime ? model.endTime :
model.startTime ? model.startTime :
null)
onTodoCompletedClicked: model.checked = model.checked === 0 ? 2 : 0
onAddSubTodoClicked: root.addSubTodo(parentWrapper)
onClicked: root.viewTodo(model)
onAddSubTodoClicked: KalendarUiUtils.setUpAddSubTodo(parentWrapper)
GridLayout {
id: todoItemContents
......@@ -281,7 +280,7 @@ TreeListView {
color: model.color
radius: 100
checked: model.todoCompleted
onClicked: completeTodo(model.incidencePtr)
onClicked: KalendarUiUtils.completeTodo(model.incidencePtr)
}
QQC2.Label {
......
......@@ -11,20 +11,13 @@ import Qt.labs.qmlmodels 1.0
import org.kde.kitemmodels 1.0
import org.kde.kalendar 1.0 as Kalendar
import org.kde.kalendar.utils 1.0
import "dateutils.js" as DateUtils
import "labelutils.js" as LabelUtils
Kirigami.ScrollablePage {
id: root
signal addTodo(int collectionId)
signal viewTodo(var todoData)
signal editTodo(var todoPtr)
signal deleteTodo(var todoPtr, date deleteDate)
signal completeTodo(var todoPtr)
signal addSubTodo(var parentWrapper)
signal deselect
// We need to store a copy of opened incidence data or we will lose it as we scroll the listviews.
function retainTodoData(todoData) {
retainedTodoData = {
......@@ -36,11 +29,11 @@ Kirigami.ScrollablePage {
endTime: todoData.endTime,
durationString: todoData.durationString
};
viewTodo(retainedTodoData);
KalendarUiUtils.setUpView(retainedTodoData);
}
property var retainedTodoData: {}
property var retainedCollectionData: {}
property var retainedTodoData: ({})
property var retainedCollectionData: ({})
property var mode: Kalendar.KalendarApplication.Todo
property var filter: {
......@@ -80,7 +73,7 @@ Kirigami.ScrollablePage {
main: Kirigami.Action {
text: i18n("Create")
icon.name: "list-add"
onTriggered: root.addTodo(root.filter.collectionId);
onTriggered: KalendarUiUtils.setUpAdd(IncidenceWrapper.TypeTodo, new Date(), root.filter.collectionId);
}
left: Kirigami.Action {
text: i18n("Sort")
......@@ -138,25 +131,6 @@ Kirigami.ScrollablePage {
showCompleted: Kalendar.TodoSortFilterProxyModel.ShowCompleteOnly
sortBy: root.sortBy
ascendingOrder: root.ascendingOrder
onAddTodo: {
root.addTodo(collectionId)
completedSheet.closeDialog();
}
onViewTodo: {
root.retainTodoData(todoData);
completedSheet.closeDialog();
}
onEditTodo: {
root.editTodo(todoPtr);
completedSheet.closeDialog();
}
onDeleteTodo: {
root.deleteTodo(todoPtr, deleteDate);
completedSheet.closeDialog();
}
onDeselect: root.deselect()
onCompleteTodo: root.completeTodo(todoPtr);
onAddSubTodo: root.addSubTodo(parentWrapper)
}
}
......@@ -189,13 +163,6 @@ Kirigami.ScrollablePage {
showCompleted: Kalendar.TodoSortFilterProxyModel.ShowIncompleteOnly
sortBy: root.sortBy
ascendingOrder: root.ascendingOrder
onAddTodo: root.addTodo(collectionId)
onViewTodo: root.retainTodoData(todoData)
onEditTodo: root.editTodo(todoPtr)
onDeleteTodo: root.deleteTodo(todoPtr, deleteDate)
onCompleteTodo: root.completeTodo(todoPtr);
onAddSubTodo: root.addSubTodo(parentWrapper)
onDeselect: root.deselect()
}
......
......@@ -127,11 +127,10 @@ QQC2.ItemDelegate {
if (ListView.view && typeof index !== "undefined") {
ListView.view.currentIndex = index;
}
if (!action) {
return;
if (action) {
action.trigger();
}
action.trigger();
checked = Qt.binding(function() { return action.checked });
}
......
......@@ -528,6 +528,7 @@ Kirigami.ApplicationWindow {
}
}
property alias incidenceInfoDrawer: incidenceInfoDrawer
contextDrawer: IncidenceInfoDrawer {
id: incidenceInfoDrawer
......@@ -1020,16 +1021,6 @@ Kirigami.ApplicationWindow {
openOccurrence: root.openOccurrence
model: monthScaleModelLoader.item
onAddIncidence: KalendarUiUtils.setUpAdd(type, addDate)
onViewIncidence: KalendarUiUtils.setUpView(modelData)
onEditIncidence: KalendarUiUtils.setUpEdit(incidencePtr)
onDeleteIncidence: KalendarUiUtils.setUpDelete(incidencePtr, deleteDate)
onCompleteTodo: KalendarUiUtils.completeTodo(incidencePtr)
onAddSubTodo: KalendarUiUtils.setUpAddSubTodo(parentWrapper)
onDeselect: incidenceInfoDrawer.close()
onMoveIncidence: KalendarUiUtils.setUpIncidenceDateChange(incidenceWrapper, startOffset, startOffset, occurrenceDate, caughtDelegate)
onOpenDayView: KalendarUiUtils.openDayLayer(selectedDate)
onMonthChanged: if(month !== root.selectedDate.getMonth() && !initialMonth) root.selectedDate = new Date (year, month, 1)
onYearChanged: if(year !== root.selectedDate.getFullYear() && !initialMonth) root.selectedDate = new Date (year, month, 1)
......@@ -1056,16 +1047,6 @@ Kirigami.ApplicationWindow {
onMonthChanged: if(month !== root.selectedDate.getMonth() && !initialMonth) root.selectedDate = new Date (year, month, day)
onYearChanged: if(year !== root.selectedDate.getFullYear() && !initialMonth) root.selectedDate = new Date (year, month, day)
onAddIncidence: KalendarUiUtils.setUpAdd(type, addDate)
onViewIncidence: KalendarUiUtils.setUpView(modelData)
onEditIncidence: KalendarUiUtils.setUpEdit(incidencePtr)
onDeleteIncidence: KalendarUiUtils.setUpDelete(incidencePtr, deleteDate)
onCompleteTodo: KalendarUiUtils.completeTodo(incidencePtr)
onAddSubTodo: KalendarUiUtils.setUpAddSubTodo(parentWrapper)
onDeselect: incidenceInfoDrawer.close()
onMoveIncidence: KalendarUiUtils.setUpIncidenceDateChange(incidenceWrapper, startOffset, startOffset, occurrenceDate, caughtDelegate)
onOpenDayView: KalendarUiUtils.openDayLayer(selectedDate)
actions.contextualActions: createAction
}
}
......@@ -1137,18 +1118,6 @@ Kirigami.ApplicationWindow {
onMonthChanged: if(month !== root.selectedDate.getMonth() && !initialWeek) root.selectedDate = new Date (year, month, day)
onYearChanged: if(year !== root.selectedDate.getFullYear() && !initialWeek) root.selectedDate = new Date (year, month, day)
onAddIncidence: KalendarUiUtils.setUpAdd(type, addDate, null, includeTime)
onViewIncidence: KalendarUiUtils.setUpView(modelData)
onEditIncidence: KalendarUiUtils.setUpEdit(incidencePtr)
onDeleteIncidence: KalendarUiUtils.setUpDelete(incidencePtr, deleteDate)
onCompleteTodo: KalendarUiUtils.completeTodo(incidencePtr)
onAddSubTodo: KalendarUiUtils.setUpAddSubTodo(parentWrapper)
onDeselect: incidenceInfoDrawer.close()
onMoveIncidence: KalendarUiUtils.setUpIncidenceDateChange(incidenceWrapper, startOffset, startOffset, occurrenceDate, caughtDelegate) // We move the entire incidence
onConvertIncidence: KalendarUiUtils.setUpIncidenceDateChange(incidenceWrapper, startOffset, endOffset, occurrenceDate, caughtDelegate, allDay) // We convert incidence from/to allDay
onResizeIncidence: KalendarUiUtils.setUpIncidenceDateChange(incidenceWrapper, 0, endOffset, occurrenceDate, caughtDelegate)
onOpenDayView: KalendarUiUtils.openDayLayer(selectedDate)
actions.contextualActions: createAction
}
}
......@@ -1185,14 +1154,6 @@ Kirigami.ApplicationWindow {
}
filter: root.filter
onAddTodo: KalendarUiUtils.setUpAdd(IncidenceWrapper.TypeTodo, new Date(), collectionId)
onViewTodo: KalendarUiUtils.setUpView(todoData)
onEditTodo: KalendarUiUtils.setUpEdit(todoPtr)
onDeleteTodo: KalendarUiUtils.setUpDelete(todoPtr, deleteDate)
onCompleteTodo: KalendarUiUtils.completeTodo(todoPtr)
onAddSubTodo: KalendarUiUtils.setUpAddSubTodo(parentWrapper)
onDeselect: incidenceInfoDrawer.close()
}
}