aboutsummaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2019-12-03 22:32:58 -0600
committerluigi1111 <luigi1111w@gmail.com>2019-12-03 22:32:58 -0600
commit63d4ba6df8950caa12b3714672d723a6ed03e2dd (patch)
treeef74caa0b64c3addb665ee83be7a8bf0b8c48421 /pages
parentc2dbda63c629a3be10c482b21566515ddaef83ed (diff)
parent646d3394d39bdd7c3ff5a5abddb54367a1980b6c (diff)
downloadmonzero-gui-63d4ba6df8950caa12b3714672d723a6ed03e2dd.tar.gz
monzero-gui-63d4ba6df8950caa12b3714672d723a6ed03e2dd.tar.xz
monzero-gui-63d4ba6df8950caa12b3714672d723a6ed03e2dd.zip
Merge pull request #2551
646d339 Wallet: persistent subaddress account selection (xiphon)
Diffstat (limited to 'pages')
-rw-r--r--pages/Account.qml20
1 files changed, 6 insertions, 14 deletions
diff --git a/pages/Account.qml b/pages/Account.qml
index 13c2b1cf..c34e6218 100644
--- a/pages/Account.qml
+++ b/pages/Account.qml
@@ -49,6 +49,7 @@ Rectangle {
property var model
property alias accountHeight: mainLayout.height
property bool selectAndSend: false
+ property int currentAccountIndex
function renameSubaddressAccountLabel(_index){
inputDialog.labelText = qsTr("Set the label of the selected account:") + translationManager.emptyString;
@@ -180,6 +181,7 @@ Rectangle {
clip: true
boundsBehavior: ListView.StopAtBounds
interactive: false
+ currentIndex: currentAccountIndex
delegate: Rectangle {
id: tableItem2
@@ -211,7 +213,7 @@ Rectangle {
MoneroComponents.Label {
id: idLabel
- color: index === appWindow.current_subaddress_account_table_index ? MoneroComponents.Style.defaultFontColor : "#757575"
+ color: index === currentAccountIndex ? MoneroComponents.Style.defaultFontColor : "#757575"
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 6
@@ -278,9 +280,9 @@ Rectangle {
onEntered: tableItem2.color = MoneroComponents.Style.titleBarButtonHoverColor
onExited: tableItem2.color = "transparent"
onClicked: {
- if (index == subaddressAccountListView.currentIndex && selectAndSend)
+ appWindow.currentWallet.switchSubaddressAccount(index);
+ if (selectAndSend)
appWindow.showPageRequest("Transfer");
- subaddressAccountListView.currentIndex = index;
}
}
}
@@ -319,17 +321,9 @@ Rectangle {
}
}
}
- onCurrentItemChanged: {
- // reset global vars
- appWindow.current_subaddress_account_table_index = subaddressAccountListView.currentIndex;
- appWindow.currentWallet.switchSubaddressAccount(appWindow.current_subaddress_account_table_index);
- appWindow.onWalletUpdate();
- }
onCurrentIndexChanged: {
- if (selectAndSend) {
- appWindow.showPageRequest("Transfer");
- }
+ appWindow.onWalletUpdate();
}
}
}
@@ -364,8 +358,6 @@ Rectangle {
inputDialog.onAcceptedCallback = function() {
appWindow.currentWallet.subaddressAccount.addRow(inputDialog.inputText)
appWindow.currentWallet.switchSubaddressAccount(appWindow.currentWallet.numSubaddressAccounts() - 1)
- current_subaddress_account_table_index = appWindow.currentWallet.numSubaddressAccounts() - 1
- subaddressAccountListView.currentIndex = current_subaddress_account_table_index
appWindow.onWalletUpdate();
}
inputDialog.onRejectedCallback = null;