forked from Public/monero-gui
remote node settings and use-while-local-is-syncing
This commit is contained in:
72
main.qml
72
main.qml
@@ -68,6 +68,10 @@ ApplicationWindow {
|
|||||||
property int blocksToSync: 1
|
property int blocksToSync: 1
|
||||||
property var isMobile: (appWindow.width > 700 && !isAndroid) ? false : true
|
property var isMobile: (appWindow.width > 700 && !isAndroid) ? false : true
|
||||||
property var cameraUi
|
property var cameraUi
|
||||||
|
property bool remoteNodeConnected: false
|
||||||
|
// Default daemon addresses
|
||||||
|
readonly property string localDaemonAddress : !persistentSettings.testnet ? "localhost:18081" : "localhost:28081"
|
||||||
|
property string currentDaemonAddress;
|
||||||
|
|
||||||
// true if wallet ever synchronized
|
// true if wallet ever synchronized
|
||||||
property bool walletInitialized : false
|
property bool walletInitialized : false
|
||||||
@@ -164,7 +168,6 @@ ApplicationWindow {
|
|||||||
|
|
||||||
function initialize() {
|
function initialize() {
|
||||||
console.log("initializing..")
|
console.log("initializing..")
|
||||||
walletInitialized = false;
|
|
||||||
|
|
||||||
// Use stored log level
|
// Use stored log level
|
||||||
if (persistentSettings.logLevel == 5)
|
if (persistentSettings.logLevel == 5)
|
||||||
@@ -186,7 +189,7 @@ ApplicationWindow {
|
|||||||
console.log("Daemon change - closing " + currentWallet)
|
console.log("Daemon change - closing " + currentWallet)
|
||||||
closeWallet();
|
closeWallet();
|
||||||
currentWallet = undefined
|
currentWallet = undefined
|
||||||
} else {
|
} else if (!walletInitialized) {
|
||||||
|
|
||||||
// set page to transfer if not changing daemon
|
// set page to transfer if not changing daemon
|
||||||
middlePanel.state = "Transfer";
|
middlePanel.state = "Transfer";
|
||||||
@@ -194,7 +197,11 @@ ApplicationWindow {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
walletManager.setDaemonAddress(persistentSettings.daemon_address)
|
|
||||||
|
// Local daemon settings
|
||||||
|
walletManager.setDaemonAddress(localDaemonAddress)
|
||||||
|
|
||||||
|
|
||||||
// wallet already opened with wizard, we just need to initialize it
|
// wallet already opened with wizard, we just need to initialize it
|
||||||
if (typeof wizard.m_wallet !== 'undefined') {
|
if (typeof wizard.m_wallet !== 'undefined') {
|
||||||
console.log("using wizard wallet")
|
console.log("using wizard wallet")
|
||||||
@@ -270,14 +277,20 @@ ApplicationWindow {
|
|||||||
middlePanel.sweepUnmixableClicked.connect(handleSweepUnmixable);
|
middlePanel.sweepUnmixableClicked.connect(handleSweepUnmixable);
|
||||||
middlePanel.checkPaymentClicked.connect(handleCheckPayment);
|
middlePanel.checkPaymentClicked.connect(handleCheckPayment);
|
||||||
|
|
||||||
console.log("initializing with daemon address: ", persistentSettings.daemon_address)
|
|
||||||
console.log("Recovering from seed: ", persistentSettings.is_recovering)
|
console.log("Recovering from seed: ", persistentSettings.is_recovering)
|
||||||
console.log("restore Height", persistentSettings.restore_height)
|
console.log("restore Height", persistentSettings.restore_height)
|
||||||
|
|
||||||
// Use saved daemon rpc login settings
|
// Use saved daemon rpc login settings
|
||||||
currentWallet.setDaemonLogin(persistentSettings.daemonUsername, persistentSettings.daemonPassword);
|
currentWallet.setDaemonLogin(persistentSettings.daemonUsername, persistentSettings.daemonPassword)
|
||||||
|
|
||||||
currentWallet.initAsync(persistentSettings.daemon_address, 0, persistentSettings.is_recovering, persistentSettings.restore_height);
|
if(persistentSettings.useRemoteNode)
|
||||||
|
currentDaemonAddress = persistentSettings.remoteNodeAddress
|
||||||
|
else
|
||||||
|
currentDaemonAddress = localDaemonAddress
|
||||||
|
|
||||||
|
console.log("initializing with daemon address: ", currentDaemonAddress)
|
||||||
|
currentWallet.initAsync(currentDaemonAddress, 0, persistentSettings.is_recovering, persistentSettings.restore_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
function walletPath() {
|
function walletPath() {
|
||||||
@@ -302,7 +315,7 @@ ApplicationWindow {
|
|||||||
middlePanel.transferView.updatePriorityDropdown();
|
middlePanel.transferView.updatePriorityDropdown();
|
||||||
|
|
||||||
// If wallet isnt connected and no daemon is running - Ask
|
// If wallet isnt connected and no daemon is running - Ask
|
||||||
if(isDaemonLocal() && !walletInitialized && status === Wallet.ConnectionStatus_Disconnected && !daemonManager.running(persistentSettings.testnet)){
|
if(!isMobile && isDaemonLocal() && !walletInitialized && status === Wallet.ConnectionStatus_Disconnected && !daemonManager.running(persistentSettings.testnet)){
|
||||||
daemonManagerDialog.open();
|
daemonManagerDialog.open();
|
||||||
}
|
}
|
||||||
// initialize transaction history once wallet is initialized first time;
|
// initialize transaction history once wallet is initialized first time;
|
||||||
@@ -358,10 +371,25 @@ ApplicationWindow {
|
|||||||
console.log("New block found - updating history")
|
console.log("New block found - updating history")
|
||||||
currentWallet.history.refresh()
|
currentWallet.history.refresh()
|
||||||
timeToUnlock = currentWallet.history.minutesToUnlock
|
timeToUnlock = currentWallet.history.minutesToUnlock
|
||||||
leftPanel.minutesToUnlockTxt = (timeToUnlock > 0)? (timeToUnlock == 20)? qsTr("Unlocked balance (waiting for block)").arg(timeToUnlock) : qsTr("Unlocked balance (~%1 min)").arg(timeToUnlock) : qsTr("Unlocked balance");
|
leftPanel.minutesToUnlockTxt = (timeToUnlock > 0)? (timeToUnlock == 20)? qsTr("Unlocked balance (waiting for block)") : qsTr("Unlocked balance (~%1 min)").arg(timeToUnlock) : qsTr("Unlocked balance");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function connectRemoteNode() {
|
||||||
|
console.log("connecting remote node");
|
||||||
|
persistentSettings.useRemoteNode = true;
|
||||||
|
currentWallet.initAsync(persistentSettings.remoteNodeAddress);
|
||||||
|
remoteNodeConnected = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function disconnectRemoteNode() {
|
||||||
|
console.log("disconnecting remote node");
|
||||||
|
persistentSettings.useRemoteNode = false;
|
||||||
|
currentDaemonAddress = localDaemonAddress
|
||||||
|
currentWallet.initAsync(currentDaemonAddress);
|
||||||
|
remoteNodeConnected = false;
|
||||||
|
}
|
||||||
|
|
||||||
function onWalletRefresh() {
|
function onWalletRefresh() {
|
||||||
console.log(">>> wallet refreshed")
|
console.log(">>> wallet refreshed")
|
||||||
|
|
||||||
@@ -383,6 +411,29 @@ ApplicationWindow {
|
|||||||
// Update transfer page status
|
// Update transfer page status
|
||||||
middlePanel.updateStatus();
|
middlePanel.updateStatus();
|
||||||
|
|
||||||
|
// Use remote node while local daemon is syncing
|
||||||
|
if (persistentSettings.useRemoteNode) {
|
||||||
|
var localNodeConnected = walletManager.connected;
|
||||||
|
var localNodeSynced = localNodeConnected && walletManager.localDaemonSynced()
|
||||||
|
if (!currentWallet.connected() || !localNodeSynced) {
|
||||||
|
console.log("Using remote node while local node is syncing")
|
||||||
|
// Connect to remote node if not already connected
|
||||||
|
if(!remoteNodeConnected) {
|
||||||
|
connectRemoteNode();
|
||||||
|
}
|
||||||
|
|
||||||
|
//update local daemon sync progress bar
|
||||||
|
if(localNodeConnected) {
|
||||||
|
leftPanel.progressBar.updateProgress(walletManager.blockchainHeight(),walletManager.blockchainTargetHeight(), 0, qsTr("Remaining blocks (local node):"));
|
||||||
|
leftPanel.progressBar.visible = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// local daemon is synced - use it!
|
||||||
|
} else if (localNodeSynced && remoteNodeConnected) {
|
||||||
|
disconnectRemoteNode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Refresh is succesfull if blockchain height > 1
|
// Refresh is succesfull if blockchain height > 1
|
||||||
if (currentWallet.blockChainHeight() > 1){
|
if (currentWallet.blockChainHeight() > 1){
|
||||||
|
|
||||||
@@ -706,7 +757,7 @@ ApplicationWindow {
|
|||||||
", txid: ", txid,
|
", txid: ", txid,
|
||||||
", txkey: ", txkey);
|
", txkey: ", txkey);
|
||||||
|
|
||||||
var result = walletManager.checkPayment(address, txid, txkey, persistentSettings.daemon_address);
|
var result = walletManager.checkPayment(address, txid, txkey, currentDaemonAddress);
|
||||||
var results = result.split("|");
|
var results = result.split("|");
|
||||||
if (results.length < 4) {
|
if (results.length < 4) {
|
||||||
informationPopup.title = qsTr("Error") + translationManager.emptyString;
|
informationPopup.title = qsTr("Error") + translationManager.emptyString;
|
||||||
@@ -892,6 +943,9 @@ ApplicationWindow {
|
|||||||
property string daemonPassword: ""
|
property string daemonPassword: ""
|
||||||
property bool transferShowAdvanced: false
|
property bool transferShowAdvanced: false
|
||||||
property string blockchainDataDir: ""
|
property string blockchainDataDir: ""
|
||||||
|
property bool startLocalNode: true
|
||||||
|
property bool useRemoteNode: false
|
||||||
|
property string remoteNodeAddress: ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// Information dialog
|
// Information dialog
|
||||||
|
|||||||
@@ -37,6 +37,15 @@ Rectangle {
|
|||||||
color: "#F0EEEE"
|
color: "#F0EEEE"
|
||||||
property var currentHashRate: 0
|
property var currentHashRate: 0
|
||||||
|
|
||||||
|
function isDaemonLocal() {
|
||||||
|
if (appWindow.currentDaemonAddress === "")
|
||||||
|
return false
|
||||||
|
var daemonHost = appWindow.currentDaemonAddress.split(":")[0]
|
||||||
|
if (daemonHost === "127.0.0.1" || daemonHost === "localhost")
|
||||||
|
return true
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
/* main layout */
|
/* main layout */
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: mainLayout
|
id: mainLayout
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ import "../components"
|
|||||||
import moneroComponents.Clipboard 1.0
|
import moneroComponents.Clipboard 1.0
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
property var daemonAddress
|
|
||||||
property bool viewOnly: false
|
property bool viewOnly: false
|
||||||
id: page
|
id: page
|
||||||
|
|
||||||
@@ -48,9 +47,6 @@ Rectangle {
|
|||||||
|
|
||||||
function initSettings() {
|
function initSettings() {
|
||||||
//runs on every page load
|
//runs on every page load
|
||||||
|
|
||||||
// Daemon settings
|
|
||||||
daemonAddress = persistentSettings.daemon_address.split(":");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
@@ -79,7 +75,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
columns: (isMobile)? 2 : 4
|
columns: (isMobile)? 1 : 4
|
||||||
StandardButton {
|
StandardButton {
|
||||||
id: closeWalletButton
|
id: closeWalletButton
|
||||||
text: qsTr("Close wallet") + translationManager.emptyString
|
text: qsTr("Close wallet") + translationManager.emptyString
|
||||||
@@ -145,6 +141,7 @@ Rectangle {
|
|||||||
*/
|
*/
|
||||||
StandardButton {
|
StandardButton {
|
||||||
id: rescanSpentButton
|
id: rescanSpentButton
|
||||||
|
enabled: !persistentSettings.useRemoteNode
|
||||||
text: qsTr("Rescan wallet balance") + translationManager.emptyString
|
text: qsTr("Rescan wallet balance") + translationManager.emptyString
|
||||||
shadowReleasedColor: "#FF4304"
|
shadowReleasedColor: "#FF4304"
|
||||||
shadowPressedColor: "#B32D00"
|
shadowPressedColor: "#B32D00"
|
||||||
@@ -169,16 +166,53 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
|
||||||
|
StandardButton {
|
||||||
|
id: remoteDisconnect
|
||||||
|
enabled: persistentSettings.useRemoteNode
|
||||||
|
Layout.fillWidth: false
|
||||||
|
text: qsTr("Local Node") + translationManager.emptyString
|
||||||
|
shadowReleasedColor: "#FF4304"
|
||||||
|
shadowPressedColor: "#B32D00"
|
||||||
|
releasedColor: "#FF6C3C"
|
||||||
|
pressedColor: "#FF4304"
|
||||||
|
onClicked: {
|
||||||
|
appWindow.disconnectRemoteNode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StandardButton {
|
||||||
|
id: remoteConnect
|
||||||
|
enabled: !persistentSettings.useRemoteNode
|
||||||
|
Layout.fillWidth: false
|
||||||
|
text: qsTr("Remote Node") + translationManager.emptyString
|
||||||
|
shadowReleasedColor: "#FF4304"
|
||||||
|
shadowPressedColor: "#B32D00"
|
||||||
|
releasedColor: "#FF6C3C"
|
||||||
|
pressedColor: "#FF4304"
|
||||||
|
onClicked: {
|
||||||
|
appWindow.connectRemoteNode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//! Manage daemon
|
//! Manage daemon
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
visible: !isMobile
|
||||||
|
Layout.topMargin: 20
|
||||||
Label {
|
Label {
|
||||||
id: manageDaemonLabel
|
id: manageDaemonLabel
|
||||||
Layout.fillWidth: true
|
|
||||||
color: "#4A4949"
|
color: "#4A4949"
|
||||||
text: qsTr("Manage daemon") + translationManager.emptyString
|
text: qsTr("Manage Daemon") + translationManager.emptyString
|
||||||
fontSize: 16
|
}
|
||||||
anchors.topMargin: 30
|
|
||||||
Layout.topMargin: 30
|
CheckBox {
|
||||||
|
id: daemonAdvanced
|
||||||
|
Layout.leftMargin: 15
|
||||||
|
text: qsTr("Show advanced") + translationManager.emptyString
|
||||||
|
checkedIcon: "../images/checkedVioletIcon.png"
|
||||||
|
uncheckedIcon: "../images/uncheckedIcon.png"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
@@ -188,27 +222,28 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
|
visible: !isMobile
|
||||||
id: daemonStatusRow
|
id: daemonStatusRow
|
||||||
columns: (isMobile) ? 2 : 4
|
columns: (isMobile) ? 2 : 4
|
||||||
StandardButton {
|
StandardButton {
|
||||||
visible: true
|
visible: !appWindow.daemonRunning
|
||||||
enabled: !appWindow.daemonRunning
|
|
||||||
id: startDaemonButton
|
id: startDaemonButton
|
||||||
text: qsTr("Start daemon") + translationManager.emptyString
|
text: qsTr("Start Local Node") + translationManager.emptyString
|
||||||
shadowReleasedColor: "#FF4304"
|
shadowReleasedColor: "#FF4304"
|
||||||
shadowPressedColor: "#B32D00"
|
shadowPressedColor: "#B32D00"
|
||||||
releasedColor: "#FF6C3C"
|
releasedColor: "#FF6C3C"
|
||||||
pressedColor: "#FF4304"
|
pressedColor: "#FF4304"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
// Set current daemon address to local
|
||||||
|
appWindow.currentDaemonAddress = appWindow.localDaemonAddress
|
||||||
appWindow.startDaemon(daemonFlags.text)
|
appWindow.startDaemon(daemonFlags.text)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StandardButton {
|
StandardButton {
|
||||||
visible: true
|
visible: appWindow.daemonRunning
|
||||||
enabled: appWindow.daemonRunning
|
|
||||||
id: stopDaemonButton
|
id: stopDaemonButton
|
||||||
text: qsTr("Stop daemon") + translationManager.emptyString
|
text: qsTr("Stop Local Node") + translationManager.emptyString
|
||||||
shadowReleasedColor: "#FF4304"
|
shadowReleasedColor: "#FF4304"
|
||||||
shadowPressedColor: "#B32D00"
|
shadowPressedColor: "#B32D00"
|
||||||
releasedColor: "#FF6C3C"
|
releasedColor: "#FF6C3C"
|
||||||
@@ -231,11 +266,11 @@ Rectangle {
|
|||||||
daemonConsolePopup.open();
|
daemonConsolePopup.open();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
ColumnLayout {
|
||||||
id: blockchainFolderRow
|
id: blockchainFolderRow
|
||||||
|
visible: !isMobile
|
||||||
Label {
|
Label {
|
||||||
id: blockchainFolderLabel
|
id: blockchainFolderLabel
|
||||||
color: "#4A4949"
|
color: "#4A4949"
|
||||||
@@ -262,13 +297,14 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
visible: daemonAdvanced.checked && !isMobile
|
||||||
id: daemonFlagsRow
|
id: daemonFlagsRow
|
||||||
Label {
|
Label {
|
||||||
id: daemonFlagsLabel
|
id: daemonFlagsLabel
|
||||||
color: "#4A4949"
|
color: "#4A4949"
|
||||||
text: qsTr("Daemon startup flags") + translationManager.emptyString
|
text: qsTr("Local daemon startup flags") + translationManager.emptyString
|
||||||
fontSize: 16
|
|
||||||
}
|
}
|
||||||
LineEdit {
|
LineEdit {
|
||||||
id: daemonFlags
|
id: daemonFlags
|
||||||
@@ -281,59 +317,21 @@ Rectangle {
|
|||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
spacing: 10
|
visible: daemonAdvanced.checked || isMobile
|
||||||
|
|
||||||
Label {
|
|
||||||
id: daemonAddrLabel
|
|
||||||
Layout.fillWidth: true
|
|
||||||
color: "#4A4949"
|
|
||||||
text: qsTr("Daemon address") + translationManager.emptyString
|
|
||||||
fontSize: 16
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
GridLayout {
|
|
||||||
id: daemonAddrRow
|
|
||||||
Layout.fillWidth: true
|
|
||||||
columnSpacing: 10
|
|
||||||
columns: (isMobile) ? 2 : 3
|
|
||||||
|
|
||||||
LineEdit {
|
|
||||||
id: daemonAddr
|
|
||||||
Layout.preferredWidth: 100
|
|
||||||
Layout.fillWidth: true
|
|
||||||
text: (daemonAddress !== undefined) ? daemonAddress[0] : ""
|
|
||||||
placeholderText: qsTr("Hostname / IP") + translationManager.emptyString
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
LineEdit {
|
|
||||||
id: daemonPort
|
|
||||||
Layout.preferredWidth: 100
|
|
||||||
Layout.fillWidth: true
|
|
||||||
text: (daemonAddress !== undefined) ? daemonAddress[1] : "18081"
|
|
||||||
placeholderText: qsTr("Port") + translationManager.emptyString
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
spacing: 10
|
|
||||||
Label {
|
Label {
|
||||||
id: daemonLoginLabel
|
id: daemonLoginLabel
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
color: "#4A4949"
|
color: "#4A4949"
|
||||||
text: qsTr("Login (optional)") + translationManager.emptyString
|
text: qsTr("Node login (optional)") + translationManager.emptyString
|
||||||
fontSize: 16
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
ColumnLayout {
|
||||||
|
visible: daemonAdvanced.checked || isMobile
|
||||||
LineEdit {
|
LineEdit {
|
||||||
id: daemonUsername
|
id: daemonUsername
|
||||||
Layout.preferredWidth: 100
|
Layout.preferredWidth: 100 * scaleRatio
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: persistentSettings.daemonUsername
|
text: persistentSettings.daemonUsername
|
||||||
placeholderText: qsTr("Username") + translationManager.emptyString
|
placeholderText: qsTr("Username") + translationManager.emptyString
|
||||||
@@ -342,50 +340,65 @@ Rectangle {
|
|||||||
|
|
||||||
LineEdit {
|
LineEdit {
|
||||||
id: daemonPassword
|
id: daemonPassword
|
||||||
Layout.preferredWidth: 100
|
Layout.preferredWidth: 100 * scaleRatio
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: persistentSettings.daemonPassword
|
text: persistentSettings.daemonPassword
|
||||||
placeholderText: qsTr("Password") + translationManager.emptyString
|
placeholderText: qsTr("Password") + translationManager.emptyString
|
||||||
echoMode: TextInput.Password
|
echoMode: TextInput.Password
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StandardButton {
|
RowLayout {
|
||||||
id: daemonAddrSave
|
visible: persistentSettings.useRemoteNode
|
||||||
Layout.fillWidth: false
|
ColumnLayout {
|
||||||
Layout.leftMargin: 30
|
Label {
|
||||||
text: qsTr("Connect") + translationManager.emptyString
|
color: "#4A4949"
|
||||||
shadowReleasedColor: "#FF4304"
|
text: qsTr("Remote node") + translationManager.emptyString
|
||||||
shadowPressedColor: "#B32D00"
|
}
|
||||||
releasedColor: "#FF6C3C"
|
RemoteNodeEdit {
|
||||||
pressedColor: "#FF4304"
|
id: remoteNodeEdit
|
||||||
onClicked: {
|
Layout.minimumWidth: 100 * scaleRatio
|
||||||
console.log("saving daemon adress settings")
|
daemonAddrText: persistentSettings.remoteNodeAddress.split(":")[0]
|
||||||
var newDaemon = daemonAddr.text.trim() + ":" + daemonPort.text.trim()
|
daemonPortText: (persistentSettings.remoteNodeAddress.split(":")[1] == "") ? "18081" : persistentSettings.remoteNodeAddress.split(":")[1]
|
||||||
if(persistentSettings.daemon_address != newDaemon) {
|
onEditingFinished: {
|
||||||
persistentSettings.daemon_address = newDaemon
|
persistentSettings.remoteNodeAddress = remoteNodeEdit.getAddress();
|
||||||
|
console.log("setting remote node to " + persistentSettings.remoteNodeAddress)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Update daemon login
|
StandardButton {
|
||||||
persistentSettings.daemonUsername = daemonUsername.text;
|
id: remoteNodeSave
|
||||||
persistentSettings.daemonPassword = daemonPassword.text;
|
text: qsTr("Connect") + translationManager.emptyString
|
||||||
currentWallet.setDaemonLogin(persistentSettings.daemonUsername, persistentSettings.daemonPassword);
|
shadowReleasedColor: "#FF4304"
|
||||||
|
shadowPressedColor: "#B32D00"
|
||||||
|
releasedColor: "#FF6C3C"
|
||||||
|
pressedColor: "#FF4304"
|
||||||
|
onClicked: {
|
||||||
|
// Update daemon login
|
||||||
|
persistentSettings.remoteNodeAddress = remoteNodeEdit.getAddress();
|
||||||
|
persistentSettings.daemonUsername = daemonUsername.text;
|
||||||
|
persistentSettings.daemonPassword = daemonPassword.text;
|
||||||
|
persistentSettings.useRemoteNode = true
|
||||||
|
|
||||||
//Reinit wallet
|
currentWallet.setDaemonLogin(persistentSettings.daemonUsername, persistentSettings.daemonPassword);
|
||||||
currentWallet.initAsync(newDaemon);
|
|
||||||
|
appWindow.connectRemoteNode()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
visible: !isMobile
|
||||||
Label {
|
Label {
|
||||||
color: "#4A4949"
|
color: "#4A4949"
|
||||||
text: qsTr("Layout settings") + translationManager.emptyString
|
text: qsTr("Layout settings") + translationManager.emptyString
|
||||||
fontSize: 16
|
anchors.topMargin: 30 * scaleRatio
|
||||||
anchors.topMargin: 30
|
Layout.topMargin: 30 * scaleRatio
|
||||||
Layout.topMargin: 30
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
visible: !isMobile
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
height: 1
|
height: 1
|
||||||
color: "#DEDEDE"
|
color: "#DEDEDE"
|
||||||
@@ -393,6 +406,7 @@ Rectangle {
|
|||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
CheckBox {
|
CheckBox {
|
||||||
|
visible: !isMobile
|
||||||
id: customDecorationsCheckBox
|
id: customDecorationsCheckBox
|
||||||
checked: persistentSettings.customDecorations
|
checked: persistentSettings.customDecorations
|
||||||
onClicked: appWindow.setCustomWindowDecorations(checked)
|
onClicked: appWindow.setCustomWindowDecorations(checked)
|
||||||
@@ -627,7 +641,7 @@ Rectangle {
|
|||||||
function onPageCompleted() {
|
function onPageCompleted() {
|
||||||
console.log("Settings page loaded");
|
console.log("Settings page loaded");
|
||||||
initSettings();
|
initSettings();
|
||||||
viewOnly = currentWallet.viewOnly;
|
|
||||||
|
|
||||||
if(typeof daemonManager != "undefined")
|
if(typeof daemonManager != "undefined")
|
||||||
appWindow.daemonRunning = daemonManager.running(persistentSettings.testnet)
|
appWindow.daemonRunning = daemonManager.running(persistentSettings.testnet)
|
||||||
|
|||||||
Reference in New Issue
Block a user