InputDialog: pre-populate input text

This commit is contained in:
selsta
2019-12-09 00:44:39 +01:00
parent f03ea0461c
commit b940ad72be
5 changed files with 8 additions and 14 deletions

View File

@@ -53,12 +53,11 @@ Rectangle {
function renameSubaddressAccountLabel(_index){
inputDialog.labelText = qsTr("Set the label of the selected account:") + translationManager.emptyString;
inputDialog.inputText = appWindow.currentWallet.getSubaddressLabel(_index, 0);
inputDialog.onAcceptedCallback = function() {
appWindow.currentWallet.subaddressAccount.setLabel(_index, inputDialog.inputText)
}
inputDialog.onRejectedCallback = null;
inputDialog.open()
inputDialog.open(appWindow.currentWallet.getSubaddressLabel(_index, 0))
}
Clipboard { id: clipboard }
@@ -354,7 +353,6 @@ Rectangle {
text: qsTr("Create new account") + translationManager.emptyString;
onClicked: {
inputDialog.labelText = qsTr("Set the label of the new account:") + translationManager.emptyString
inputDialog.inputText = qsTr("(Untitled)") + translationManager.emptyString
inputDialog.onAcceptedCallback = function() {
appWindow.currentWallet.subaddressAccount.addRow(inputDialog.inputText)
appWindow.currentWallet.switchSubaddressAccount(appWindow.currentWallet.numSubaddressAccounts() - 1)