Commit 8574ca12 authored by Volker Krause's avatar Volker Krause

Implement element deletion

parent e4b0e482
......@@ -89,6 +89,7 @@ App.TimelineDelegate {
Component {
id: detailsComponent
App.BusPage {
resId: root.resId
reservation: root.reservation
passId: root.passId
}
......
......@@ -25,11 +25,20 @@ import "." as App
Kirigami.ScrollablePage {
id: root
property string resId
property variant reservation
property string passId
actions {
contextualActions: [
Kirigami.Action {
iconName: "edit-delete"
text: qsTr("Delete")
onTriggered: {
_reservationManager.removeReservation(root.resId)
applicationWindow().pageStack.pop()
}
},
Kirigami.Action {
iconSource: root.passId !== "" ? "image://org.kde.pkpass/" + passId + "/icon" : ""
text: qsTr("Boarding Pass")
......
......@@ -114,6 +114,7 @@ App.TimelineDelegate {
Component {
id: detailsComponent
App.FlightPage {
resId: root.resId
reservation: root.reservation
passId: root.passId
}
......
......@@ -76,6 +76,7 @@ App.TimelineDelegate {
Component {
id: detailsComponent
App.HotelPage {
resId: root.resId
reservation: root.reservation
}
}
......
......@@ -66,6 +66,7 @@ App.TimelineDelegate {
Component {
id: detailsComponent
App.RestaurantPage {
resId: root.resId
reservation: root.reservation
}
}
......
......@@ -24,6 +24,7 @@ import "." as App
Kirigami.AbstractCard {
id: root
property string resId
property var reservation
property string passId
property var rangeType
......
......@@ -41,6 +41,7 @@ Kirigami.ScrollablePage {
Component {
id: flightDelegate
App.FlightDelegate {
resId: modelData.reservationId
reservation: modelData.reservation
passId: modelData.passId
rangeType: modelData.rangeType
......@@ -49,6 +50,7 @@ Kirigami.ScrollablePage {
Component {
id: hotelDelegate
App.HotelDelegate {
resId: modelData.reservationId
reservation: modelData.reservation
passId: modelData.passId
rangeType: modelData.rangeType
......@@ -57,6 +59,7 @@ Kirigami.ScrollablePage {
Component {
id: trainDelegate
App.TrainDelegate {
resId: modelData.reservationId
reservation: modelData.reservation
passId: modelData.passId
rangeType: modelData.rangeType
......@@ -65,6 +68,7 @@ Kirigami.ScrollablePage {
Component {
id: busDelegate
App.BusDelegate {
resId: modelData.reservationId
reservation: modelData.reservation
passId: modelData.passId
rangeType: modelData.rangeType
......@@ -73,6 +77,7 @@ Kirigami.ScrollablePage {
Component {
id: restaurantDelegate
App.RestaurantDelegate {
resId: modelData.reservationId
reservation: modelData.reservation
passId: modelData.passId
rangeType: modelData.rangeType
......@@ -81,6 +86,7 @@ Kirigami.ScrollablePage {
Component {
id: touristAttractionDelegate
App.TouristAttractionDelegate {
resId: modelData.reservationId
reservation: modelData.reservation
passId: modelData.passId
rangeType: modelData.rangeType
......
......@@ -94,6 +94,7 @@ App.TimelineDelegate {
Component {
id: detailsComponent
App.TrainPage {
resId: root.resId
reservation: root.reservation
passId: root.passId
}
......
......@@ -43,7 +43,7 @@ public:
Q_INVOKABLE void importReservation(const QUrl &filename);
Q_INVOKABLE void addReservation(const QVariant &res);
void removeReservation(const QString &id);
Q_INVOKABLE void removeReservation(const QString &id);
signals:
void reservationAdded(const QString &id);
......
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