From 50cb72656afbd1601a6fb794d8961c49d1dd2ac2 Mon Sep 17 00:00:00 2001
From: thotbot <thotbot@protonmail.com>
Date: Mon, 16 Dec 2019 22:48:35 +0000
Subject: [PATCH] do not ask to start daemon if in remote node mode

---
 main.qml           |  4 ++--
 pages/Mining.qml   | 10 +++++-----
 pages/Transfer.qml |  4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/main.qml b/main.qml
index 7e28a4c6..eb496da6 100644
--- a/main.qml
+++ b/main.qml
@@ -467,7 +467,7 @@ ApplicationWindow {
 
         // update local daemon status.
         const isDisconnected = status === Wallet.ConnectionStatus_Disconnected;
-        if (walletManager.isDaemonLocal(currentDaemonAddress)) {
+        if (!persistentSettings.useRemoteNode) {
             daemonRunning = !isDisconnected;
         } else {
             daemonRunning = false;
@@ -477,7 +477,7 @@ ApplicationWindow {
         middlePanel.transferView.updatePriorityDropdown();
 
         // If wallet isnt connected, advanced wallet mode and no daemon is running - Ask
-        if (appWindow.walletMode >= 2 && walletManager.isDaemonLocal(currentDaemonAddress) && !walletInitialized && isDisconnected) {
+        if (appWindow.walletMode >= 2 && !persistentSettings.useRemoteNode && !walletInitialized && isDisconnected) {
             daemonManager.runningAsync(persistentSettings.nettype, function(running) {
                 if (!running) {
                     daemonManagerDialog.open();
diff --git a/pages/Mining.qml b/pages/Mining.qml
index 46e18646..b1756e82 100644
--- a/pages/Mining.qml
+++ b/pages/Mining.qml
@@ -57,13 +57,13 @@ Rectangle {
         MoneroComponents.WarningBox {
             Layout.bottomMargin: 8
             text: qsTr("Mining is only available on local daemons.") + translationManager.emptyString
-            visible: !walletManager.isDaemonLocal(appWindow.currentDaemonAddress)
+            visible: persistentSettings.useRemoteNode
         }
 
         MoneroComponents.WarningBox {
             Layout.bottomMargin: 8
             text: qsTr("Your daemon must be synchronized before you can start mining") + translationManager.emptyString
-            visible: walletManager.isDaemonLocal(appWindow.currentDaemonAddress) && !appWindow.daemonSynced
+            visible: !persistentSettings.useRemoteNode && !appWindow.daemonSynced
         }
 
         MoneroComponents.TextPlain {
@@ -199,7 +199,7 @@ Rectangle {
                             } else {
                                 errorPopup.title  = qsTr("Error starting mining") + translationManager.emptyString;
                                 errorPopup.text = qsTr("Couldn't start mining.<br>") + translationManager.emptyString
-                                if (!walletManager.isDaemonLocal(appWindow.currentDaemonAddress))
+                                if (persistentSettings.useRemoteNode)
                                     errorPopup.text += qsTr("Mining is only available on local daemons. Run a local daemon to be able to mine.<br>") + translationManager.emptyString
                                 errorPopup.icon = StandardIcon.Critical
                                 errorPopup.open()
@@ -259,7 +259,7 @@ Rectangle {
     }
 
     function onMiningStatus(isMining) {
-        var daemonReady = walletManager.isDaemonLocal(appWindow.currentDaemonAddress) && appWindow.daemonSynced
+        var daemonReady = !persistentSettings.useRemoteNode && appWindow.daemonSynced
         appWindow.isMining = isMining;
         updateStatusText()
         startSoloMinerButton.enabled = !appWindow.isMining && daemonReady
@@ -284,7 +284,7 @@ Rectangle {
     function onPageCompleted() {
         console.log("Mining page loaded");
         update()
-        timer.running = walletManager.isDaemonLocal(appWindow.currentDaemonAddress)
+        timer.running = !persistentSettings.useRemoteNode
     }
 
     function onPageClosed() {
diff --git a/pages/Transfer.qml b/pages/Transfer.qml
index 9c298773..e9537897 100644
--- a/pages/Transfer.qml
+++ b/pages/Transfer.qml
@@ -558,7 +558,7 @@ Rectangle {
                 id: importKeyImagesButton
                 text: qsTr("Import key images") + translationManager.emptyString
                 small: true
-                visible: appWindow.viewOnly && walletManager.isDaemonLocal(appWindow.currentDaemonAddress)
+                visible: appWindow.viewOnly && !persistentSettings.useRemoteNode
                 enabled: pageRoot.enabled
                 onClicked: {
                     console.log("Transfer: import key images clicked")
@@ -710,7 +710,7 @@ Rectangle {
 
     function updateStatus() {
         var messageNotConnected = qsTr("Wallet is not connected to daemon.");
-        if(appWindow.walletMode >= 2) messageNotConnected += root.startLinkText;
+        if(appWindow.walletMode >= 2 && !persistentSettings.useRemoteNode) messageNotConnected += root.startLinkText;
         pageRoot.enabled = true;
         if(typeof currentWallet === "undefined") {
             root.warningContent = messageNotConnected;