diff --git a/qml/pages/CosttypeView.qml b/qml/pages/CosttypeView.qml index cd6ca0f..8047e1d 100644 --- a/qml/pages/CosttypeView.qml +++ b/qml/pages/CosttypeView.qml @@ -49,11 +49,13 @@ Page { menu: ContextMenu { MenuItem { + enabled: model.modelData.id > 0 ? true:false text: qsTr("Modify") onClicked: pageStack.push(Qt.resolvedUrl("CosttypeEntry.qml"), { costtype: model.modelData }) } MenuItem { + enabled: model.modelData.id > 0 ? true:false text: qsTr("Remove") onClicked: { remorseAction(qsTr("Deleting"), function() { diff --git a/qml/pages/FueltypeView.qml b/qml/pages/FueltypeView.qml index a13344b..2f76345 100644 --- a/qml/pages/FueltypeView.qml +++ b/qml/pages/FueltypeView.qml @@ -49,11 +49,13 @@ Page { menu: ContextMenu { MenuItem { + enabled: model.modelData.id > 0 ? true:false text: qsTr("Modify") onClicked: pageStack.push(Qt.resolvedUrl("FueltypeEntry.qml"), { fueltype: model.modelData }) } MenuItem { + enabled: model.modelData.id > 0 ? true:false text: qsTr("Remove") onClicked: { remorseAction(qsTr("Deleting"), function() { diff --git a/qml/pages/StationView.qml b/qml/pages/StationView.qml index a7fdc2b..9d1a621 100644 --- a/qml/pages/StationView.qml +++ b/qml/pages/StationView.qml @@ -48,12 +48,14 @@ Page { showMenuOnPressAndHold: true menu: ContextMenu { - MenuItem { - text: qsTr("Modify") - onClicked: pageStack.push(Qt.resolvedUrl("StationEntry.qml"), { station: model.modelData }) + MenuItem { + enabled: model.modelData.id > 0 ? true:false + text: qsTr("Modify") + onClicked: pageStack.push(Qt.resolvedUrl("StationEntry.qml"), { station: model.modelData }) } MenuItem { + enabled: model.modelData.id > 0 ? true:false text: qsTr("Remove") onClicked: { remorseAction(qsTr("Deleting"), function() {