Skip to content

Commit

Permalink
Disabled Modification of "Not Set" Items
Browse files Browse the repository at this point in the history
  • Loading branch information
thmichel committed Jul 27, 2015
1 parent 6e5478d commit e4e1102
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions qml/pages/CosttypeView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 2 additions & 0 deletions qml/pages/FueltypeView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
8 changes: 5 additions & 3 deletions qml/pages/StationView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit e4e1102

Please sign in to comment.