mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-10 03:42:05 +02:00
Move function to show the seed page to Utils.js
This commit is contained in:
parent
b7dbb83294
commit
eb457019dd
27
js/Utils.js
27
js/Utils.js
@ -27,3 +27,30 @@ function formatDate( date, params ) {
|
|||||||
function isNumeric(n) {
|
function isNumeric(n) {
|
||||||
return !isNaN(parseFloat(n)) && isFinite(n);
|
return !isNaN(parseFloat(n)) && isFinite(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showSeedPage() {
|
||||||
|
// Shows `Settings->Seed & keys`. Prompts a password dialog.
|
||||||
|
passwordDialog.onAcceptedCallback = function() {
|
||||||
|
if(walletPassword === passwordDialog.password){
|
||||||
|
if(currentWallet.seedLanguage == "") {
|
||||||
|
console.log("No seed language set. Using English as default");
|
||||||
|
currentWallet.setSeedLanguage("English");
|
||||||
|
}
|
||||||
|
// Load keys page
|
||||||
|
middlePanel.state = "Keys"
|
||||||
|
} else {
|
||||||
|
informationPopup.title = qsTr("Error") + translationManager.emptyString;
|
||||||
|
informationPopup.text = qsTr("Wrong password");
|
||||||
|
informationPopup.open()
|
||||||
|
informationPopup.onCloseCallback = function() {
|
||||||
|
passwordDialog.open()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
passwordDialog.onRejectedCallback = function() {
|
||||||
|
appWindow.showPageRequest("Settings");
|
||||||
|
}
|
||||||
|
passwordDialog.open();
|
||||||
|
if(isMobile) hideMenu();
|
||||||
|
updateBalance();
|
||||||
|
}
|
27
main.qml
27
main.qml
@ -40,6 +40,7 @@ import moneroComponents.NetworkType 1.0
|
|||||||
|
|
||||||
import "components"
|
import "components"
|
||||||
import "wizard"
|
import "wizard"
|
||||||
|
import "../js/Utils.js" as Utils
|
||||||
import "js/Windows.js" as Windows
|
import "js/Windows.js" as Windows
|
||||||
|
|
||||||
ApplicationWindow {
|
ApplicationWindow {
|
||||||
@ -1415,31 +1416,7 @@ ApplicationWindow {
|
|||||||
updateBalance();
|
updateBalance();
|
||||||
}
|
}
|
||||||
|
|
||||||
onKeysClicked: {
|
onKeysClicked: Utils.showSeedPage();
|
||||||
passwordDialog.onAcceptedCallback = function() {
|
|
||||||
if(walletPassword === passwordDialog.password){
|
|
||||||
if(currentWallet.seedLanguage == "") {
|
|
||||||
console.log("No seed language set. Using English as default");
|
|
||||||
currentWallet.setSeedLanguage("English");
|
|
||||||
}
|
|
||||||
// Load keys page
|
|
||||||
middlePanel.state = "Keys"
|
|
||||||
} else {
|
|
||||||
informationPopup.title = qsTr("Error") + translationManager.emptyString;
|
|
||||||
informationPopup.text = qsTr("Wrong password");
|
|
||||||
informationPopup.open()
|
|
||||||
informationPopup.onCloseCallback = function() {
|
|
||||||
passwordDialog.open()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
passwordDialog.onRejectedCallback = function() {
|
|
||||||
appWindow.showPageRequest("Settings");
|
|
||||||
}
|
|
||||||
passwordDialog.open();
|
|
||||||
if(isMobile) hideMenu();
|
|
||||||
updateBalance();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RightPanel {
|
RightPanel {
|
||||||
|
@ -286,9 +286,7 @@ Rectangle {
|
|||||||
MouseArea {
|
MouseArea {
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: {
|
onClicked: Utils.showSeedPage();
|
||||||
Utils.showSeedPage();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user