diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2019-12-19 19:18:03 -0500 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2019-12-19 19:18:03 -0500 |
| commit | 78f8cb259532de5626e90f1e1992bfe6ce0ef089 (patch) | |
| tree | 12a44678c5c80751fdc2e51cbab1fd232c5dd9a9 | |
| parent | 46227bdad08e191d54e49813ee2f4c0e3c226f95 (diff) | |
| parent | b940ad72befacbf330e25bafd0f8134973fb4742 (diff) | |
| download | monzero-gui-78f8cb259532de5626e90f1e1992bfe6ce0ef089.tar.gz monzero-gui-78f8cb259532de5626e90f1e1992bfe6ce0ef089.tar.xz monzero-gui-78f8cb259532de5626e90f1e1992bfe6ce0ef089.zip | |
Merge pull request #2576
b940ad7 InputDialog: pre-populate input text (selsta)
| -rw-r--r-- | components/InputDialog.qml | 4 | ||||
| -rw-r--r-- | pages/Account.qml | 4 | ||||
| -rw-r--r-- | pages/History.qml | 7 | ||||
| -rw-r--r-- | pages/Receive.qml | 4 | ||||
| -rw-r--r-- | pages/settings/SettingsInfo.qml | 3 |
5 files changed, 8 insertions, 14 deletions
diff --git a/components/InputDialog.qml b/components/InputDialog.qml index c5963f04..2a69e79f 100644 --- a/components/InputDialog.qml +++ b/components/InputDialog.qml @@ -45,14 +45,14 @@ Item { signal accepted() signal rejected() - function open() { + function open(prepopulate) { inactiveOverlay.visible = true leftPanel.enabled = false middlePanel.enabled = false titleBar.state = "essentials" root.visible = true; input.focus = true; - input.text = ""; + input.text = prepopulate ? prepopulate : ""; } function close() { diff --git a/pages/Account.qml b/pages/Account.qml index c34e6218..5491dc8b 100644 --- a/pages/Account.qml +++ b/pages/Account.qml @@ -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) diff --git a/pages/History.qml b/pages/History.qml index dbca79c3..0ec86c5f 100644 --- a/pages/History.qml +++ b/pages/History.qml @@ -477,7 +477,6 @@ Rectangle { return; inputDialog.labelText = qsTr("Jump to page (1-%1)").arg(pages) + translationManager.emptyString; - inputDialog.inputText = "1"; inputDialog.onAcceptedCallback = function() { var pageNumber = parseInt(inputDialog.inputText); if (!isNaN(pageNumber) && pageNumber >= 1 && pageNumber <= pages) { @@ -1195,7 +1194,7 @@ Rectangle { if(res[i].state === 'copyable' && res[i].parent.hasOwnProperty('text')) toClipboard(res[i].parent.text); if(res[i].state === 'copyable_address') root.toClipboard(address); if(res[i].state === 'copyable_txkey') root.getTxKey(hash, res[i]); - if(res[i].state === 'set_tx_note') root.editDescription(hash); + if(res[i].state === 'set_tx_note') root.editDescription(hash, tx_note); if(res[i].state === 'details') root.showTxDetails(hash, paymentId, destinations, subaddrAccount, subaddrIndex, dateTime, displayAmount, isout); if(res[i].state === 'proof') root.showTxProof(hash, paymentId, destinations, subaddrAccount, subaddrIndex); doCollapse = false; @@ -1533,7 +1532,7 @@ Rectangle { root.updateFilter(); } - function editDescription(_hash){ + function editDescription(_hash, _tx_note){ inputDialog.labelText = qsTr("Set description:") + translationManager.emptyString; inputDialog.onAcceptedCallback = function() { appWindow.currentWallet.setUserNote(_hash, inputDialog.inputText); @@ -1541,7 +1540,7 @@ Rectangle { root.update(); } inputDialog.onRejectedCallback = null; - inputDialog.open(); + inputDialog.open(_tx_note); } function paginationPrevClicked(){ diff --git a/pages/Receive.qml b/pages/Receive.qml index 1cbfff42..75ada7f0 100644 --- a/pages/Receive.qml +++ b/pages/Receive.qml @@ -53,12 +53,11 @@ Rectangle { function renameSubaddressLabel(_index){ inputDialog.labelText = qsTr("Set the label of the selected address:") + translationManager.emptyString; - inputDialog.inputText = appWindow.currentWallet.getSubaddressLabel(appWindow.currentWallet.currentSubaddressAccount, _index); inputDialog.onAcceptedCallback = function() { appWindow.currentWallet.subaddress.setLabel(appWindow.currentWallet.currentSubaddressAccount, _index, inputDialog.inputText); } inputDialog.onRejectedCallback = null; - inputDialog.open() + inputDialog.open(appWindow.currentWallet.getSubaddressLabel(appWindow.currentWallet.currentSubaddressAccount, _index)) } Clipboard { id: clipboard } @@ -254,7 +253,6 @@ Rectangle { text: qsTr("Create new address") + translationManager.emptyString; onClicked: { inputDialog.labelText = qsTr("Set the label of the new address:") + translationManager.emptyString - inputDialog.inputText = qsTr("(Untitled)") + translationManager.emptyString inputDialog.onAcceptedCallback = function() { appWindow.currentWallet.subaddress.addRow(appWindow.currentWallet.currentSubaddressAccount, inputDialog.inputText) current_subaddress_table_index = appWindow.currentWallet.numSubaddresses(appWindow.currentWallet.currentSubaddressAccount) - 1 diff --git a/pages/settings/SettingsInfo.qml b/pages/settings/SettingsInfo.qml index c7ca7dc0..5139ab73 100644 --- a/pages/settings/SettingsInfo.qml +++ b/pages/settings/SettingsInfo.qml @@ -178,7 +178,6 @@ Rectangle { text: (currentWallet ? currentWallet.walletCreationHeight : "") + style + qsTr(" <a href='#'> (Click to change)</a>") + translationManager.emptyString onLinkActivated: { inputDialog.labelText = qsTr("Set a new restore height.\nYou can enter a block height or a date (YYYY-MM-DD):") + translationManager.emptyString; - inputDialog.inputText = currentWallet ? currentWallet.walletCreationHeight : "0"; inputDialog.onAcceptedCallback = function() { var _restoreHeight; if (inputDialog.inputText) { @@ -224,7 +223,7 @@ Rectangle { appWindow.showStatusMessage(qsTr("Invalid restore height specified. Must be a number or a date formatted YYYY-MM-DD"),3); } inputDialog.onRejectedCallback = null; - inputDialog.open() + inputDialog.open(currentWallet ? currentWallet.walletCreationHeight : "0") } MouseArea { |
