|
|
@ -13,7 +13,7 @@ Dialog { |
|
|
|
id: modalStateDialog |
|
|
|
modality: Qt.ApplicationModal |
|
|
|
|
|
|
|
width: 590 |
|
|
|
width: 630 |
|
|
|
height: 480 |
|
|
|
title: qsTr("Edit State") |
|
|
|
visible: false |
|
|
@ -79,7 +79,10 @@ Dialog { |
|
|
|
} |
|
|
|
contentItem: Rectangle { |
|
|
|
color: stateDialogStyle.generic.backgroundColor |
|
|
|
ColumnLayout { |
|
|
|
Rectangle { |
|
|
|
color: stateDialogStyle.generic.backgroundColor |
|
|
|
anchors.top: parent.top |
|
|
|
anchors.margins: 10 |
|
|
|
anchors.fill: parent |
|
|
|
ColumnLayout { |
|
|
|
anchors.fill: parent |
|
|
@ -91,7 +94,7 @@ Dialog { |
|
|
|
{ |
|
|
|
Layout.fillWidth: true |
|
|
|
DefaultLabel { |
|
|
|
Layout.preferredWidth: 75 |
|
|
|
Layout.preferredWidth: 85 |
|
|
|
text: qsTr("Title") |
|
|
|
} |
|
|
|
DefaultTextField |
|
|
@ -112,10 +115,10 @@ Dialog { |
|
|
|
|
|
|
|
Rectangle |
|
|
|
{ |
|
|
|
Layout.preferredWidth: 75 |
|
|
|
Layout.preferredWidth: 85 |
|
|
|
DefaultLabel { |
|
|
|
id: accountsLabel |
|
|
|
Layout.preferredWidth: 75 |
|
|
|
Layout.preferredWidth: 85 |
|
|
|
text: qsTr("Accounts") |
|
|
|
} |
|
|
|
|
|
|
@ -227,7 +230,7 @@ Dialog { |
|
|
|
{ |
|
|
|
Layout.fillWidth: true |
|
|
|
DefaultLabel { |
|
|
|
Layout.preferredWidth: 75 |
|
|
|
Layout.preferredWidth: 85 |
|
|
|
text: qsTr("Default") |
|
|
|
} |
|
|
|
CheckBox { |
|
|
@ -240,26 +243,26 @@ Dialog { |
|
|
|
{ |
|
|
|
Layout.fillWidth: true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
ColumnLayout { |
|
|
|
anchors.top: dialogContent.bottom |
|
|
|
anchors.topMargin: 5 |
|
|
|
spacing: 0 |
|
|
|
RowLayout |
|
|
|
{ |
|
|
|
Layout.preferredWidth: 150 |
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
|
|
Rectangle |
|
|
|
{ |
|
|
|
Layout.preferredWidth: 85 |
|
|
|
DefaultLabel { |
|
|
|
text: qsTr("Transactions: ") |
|
|
|
id: transactionsLabel |
|
|
|
Layout.preferredWidth: 85 |
|
|
|
text: qsTr("Transactions") |
|
|
|
} |
|
|
|
|
|
|
|
Button |
|
|
|
{ |
|
|
|
anchors.top: transactionsLabel.bottom |
|
|
|
anchors.topMargin: 10 |
|
|
|
iconSource: "qrc:/qml/img/plus.png" |
|
|
|
action: newTrAction |
|
|
|
width: 10 |
|
|
|
height: 10 |
|
|
|
anchors.right: parent.right |
|
|
|
} |
|
|
|
|
|
|
|
Action { |
|
|
@ -269,23 +272,62 @@ Dialog { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
ScrollView |
|
|
|
TableView |
|
|
|
{ |
|
|
|
id: transactionsView |
|
|
|
Layout.fillWidth: true |
|
|
|
model: transactionsModel |
|
|
|
headerVisible: false |
|
|
|
TableViewColumn { |
|
|
|
role: "name" |
|
|
|
title: qsTr("Name") |
|
|
|
width: 150 |
|
|
|
delegate: Item { |
|
|
|
RowLayout |
|
|
|
{ |
|
|
|
Layout.fillHeight: true |
|
|
|
Layout.preferredWidth: 300 |
|
|
|
Column |
|
|
|
height: 30 |
|
|
|
width: parent.width |
|
|
|
Button |
|
|
|
{ |
|
|
|
Layout.fillHeight: true |
|
|
|
Repeater |
|
|
|
iconSource: "qrc:/qml/img/delete_sign.png" |
|
|
|
action: deleteTransactionAction |
|
|
|
} |
|
|
|
|
|
|
|
Action { |
|
|
|
id: deleteTransactionAction |
|
|
|
tooltip: qsTr("Delete") |
|
|
|
onTriggered: transactionsModel.deleteTransaction(styleData.row) |
|
|
|
} |
|
|
|
|
|
|
|
Button |
|
|
|
{ |
|
|
|
id: trRepeater |
|
|
|
model: transactionsModel |
|
|
|
delegate: transactionRenderDelegate |
|
|
|
visible: transactionsModel.count > 0 |
|
|
|
height: 20 * transactionsModel.count |
|
|
|
iconSource: "qrc:/qml/img/edit.png" |
|
|
|
action: editAction |
|
|
|
visible: styleData.row >= 0 ? !transactionsModel.get(styleData.row).stdContract : false |
|
|
|
width: 10 |
|
|
|
height: 10 |
|
|
|
Action { |
|
|
|
id: editAction |
|
|
|
tooltip: qsTr("Edit") |
|
|
|
onTriggered: transactionsModel.editTransaction(styleData.row) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
DefaultLabel { |
|
|
|
Layout.preferredWidth: 150 |
|
|
|
text: styleData.row >= 0 ? transactionsModel.get(styleData.row).functionId : "" |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
rowDelegate: |
|
|
|
Rectangle { |
|
|
|
color: styleData.alternate ? "transparent" : "#f0f0f0" |
|
|
|
height: 30; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
RowLayout |
|
|
@ -304,6 +346,13 @@ Dialog { |
|
|
|
text: qsTr("Cancel"); |
|
|
|
onClicked: close(); |
|
|
|
} |
|
|
|
Button { |
|
|
|
text: qsTr("Delete"); |
|
|
|
onClicked: { |
|
|
|
projectModel.stateListModel.deleteState(stateIndex); |
|
|
|
close(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
ListModel { |
|
|
@ -325,7 +374,6 @@ Dialog { |
|
|
|
} |
|
|
|
|
|
|
|
function addTransaction() { |
|
|
|
|
|
|
|
// Set next id here to work around Qt bug |
|
|
|
// https://bugreports.qt-project.org/browse/QTBUG-41327 |
|
|
|
// Second call to signal handler would just edit the item that was just created, no harm done |
|
|
@ -350,44 +398,6 @@ Dialog { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Component { |
|
|
|
id: transactionRenderDelegate |
|
|
|
RowLayout { |
|
|
|
DefaultLabel { |
|
|
|
Layout.preferredWidth: 150 |
|
|
|
text: functionId |
|
|
|
} |
|
|
|
|
|
|
|
Button |
|
|
|
{ |
|
|
|
id: deleteBtn |
|
|
|
iconSource: "qrc:/qml/img/delete_sign.png" |
|
|
|
action: deleteAction |
|
|
|
width: 10 |
|
|
|
height: 10 |
|
|
|
Action { |
|
|
|
id: deleteAction |
|
|
|
tooltip: qsTr("Delete") |
|
|
|
onTriggered: transactionsModel.deleteTransaction(index) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Button |
|
|
|
{ |
|
|
|
iconSource: "qrc:/qml/img/edit.png" |
|
|
|
action: editAction |
|
|
|
visible: stdContract === false |
|
|
|
width: 10 |
|
|
|
height: 10 |
|
|
|
Action { |
|
|
|
id: editAction |
|
|
|
tooltip: qsTr("Edit") |
|
|
|
onTriggered: transactionsModel.editTransaction(index) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
TransactionDialog |
|
|
|
{ |
|
|
|
id: transactionDialog |
|
|
|