aboutsummaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
authorj-berman <justinberman@protonmail.com>2023-11-16 16:38:52 -0800
committerj-berman <justinberman@protonmail.com>2025-08-03 10:26:11 -0700
commit5332495c2404ab4b102c98c22419e70143b1dc90 (patch)
tree71c5a543eed50a0c244594afe3fb9028b5650dd4 /pages
parent10a184db8b242d4cff97e0f5845342cfccfc2042 (diff)
downloadmonzero-gui-5332495c2404ab4b102c98c22419e70143b1dc90.tar.gz
monzero-gui-5332495c2404ab4b102c98c22419e70143b1dc90.tar.xz
monzero-gui-5332495c2404ab4b102c98c22419e70143b1dc90.zip
Implement background sync when locked
Diffstat (limited to 'pages')
-rw-r--r--pages/History.qml1
-rw-r--r--pages/settings/SettingsLayout.qml24
2 files changed, 25 insertions, 0 deletions
diff --git a/pages/History.qml b/pages/History.qml
index 651a6d02..d9132e3b 100644
--- a/pages/History.qml
+++ b/pages/History.qml
@@ -1542,6 +1542,7 @@ Rectangle {
function updateTransactionsFromModel() {
// This function copies the items of `appWindow.currentWallet.historyModel` to `root.txModelData`, as a list of javascript objects
if(currentWallet == null || typeof currentWallet.history === "undefined" ) return;
+ if(currentWallet.isBackgroundSyncing()) return;
var _model = root.model;
var total = 0
diff --git a/pages/settings/SettingsLayout.qml b/pages/settings/SettingsLayout.qml
index c2dfc7e6..e73355ae 100644
--- a/pages/settings/SettingsLayout.qml
+++ b/pages/settings/SettingsLayout.qml
@@ -31,6 +31,8 @@ import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0
import QtQuick.Dialogs 1.2
+import moneroComponents.Wallet 1.0
+
import "../../js/Utils.js" as Utils
import "../../js/Windows.js" as Windows
import "../../components" as MoneroComponents
@@ -156,6 +158,28 @@ Rectangle {
}
MoneroComponents.CheckBox {
+ id: backgroundSyncCheckbox
+ visible: !!currentWallet && !currentWallet.isHwBacked() && !appWindow.viewOnly
+ checked: appWindow.backgroundSyncType != Wallet.BackgroundSync_Off
+ text: qsTr("Sync in the background when locked") + translationManager.emptyString
+ toggleOnClick: false
+ onClicked: {
+ if (currentWallet && appWindow) {
+ appWindow.showProcessingSplash(qsTr("Updating settings..."))
+
+ // TODO: add support for custom background password option
+ var newBackgroundSyncType = Wallet.BackgroundSync_Off
+ if (currentWallet.getBackgroundSyncType() === Wallet.BackgroundSync_Off)
+ newBackgroundSyncType = Wallet.BackgroundSync_ReusePassword
+
+ // TODO: don't keep the wallet password in memory on the appWindow
+ // https://github.com/monero-project/monero-gui/issues/1537#issuecomment-410055329
+ currentWallet.setupBackgroundSync(newBackgroundSyncType, appWindow.walletPassword)
+ }
+ }
+ }
+
+ MoneroComponents.CheckBox {
checked: persistentSettings.askStopLocalNode
onClicked: persistentSettings.askStopLocalNode = !persistentSettings.askStopLocalNode
text: qsTr("Ask to stop local node during program exit") + translationManager.emptyString