From 04c2d8437ed7df174fbcc250c076b566714292a4 Mon Sep 17 00:00:00 2001 From: selsta Date: Mon, 17 May 2021 20:35:17 +0200 Subject: [PATCH] WizardModeSelection: disable simple mode on Tails --- wizard/WizardModeSelection.qml | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/wizard/WizardModeSelection.qml b/wizard/WizardModeSelection.qml index 4d2fde53..5411735c 100644 --- a/wizard/WizardModeSelection.qml +++ b/wizard/WizardModeSelection.qml @@ -41,6 +41,7 @@ Rectangle { property alias pageHeight: pageRoot.height property string viewName: "wizardModeSelection1" property bool portable: persistentSettings.portable + property bool simpleModeAvailable: !isTails && appWindow.persistentSettings.nettype == 0 function applyWalletMode(mode, wizardState) { if (!persistentSettings.setPortable(portable)) { @@ -76,21 +77,25 @@ Rectangle { } WizardMenuItem { - opacity: appWindow.persistentSettings.nettype == 0 ? 1.0 : 0.5 + opacity: simpleModeAvailable ? 1.0 : 0.5 Layout.topMargin: 20 headerText: qsTr("Simple mode") + translationManager.emptyString bodyText: { - if(appWindow.persistentSettings.nettype == 0){ - return qsTr("Easy access to sending, receiving and basic functionality.") + translationManager.emptyString; + if (isTails) { + return qsTr("Not available on Tails.") + translationManager.emptyString; } else { - return "Available on mainnet."; + if (appWindow.persistentSettings.nettype == 0) { + return qsTr("Easy access to sending, receiving and basic functionality.") + translationManager.emptyString; + } else { + return qsTr("Available on mainnet.") + translationManager.emptyString; + } } } imageIcon: "qrc:///images/remote-node.png" onMenuClicked: { - if(appWindow.persistentSettings.nettype == 0){ + if (simpleModeAvailable) { applyWalletMode(0, 'wizardModeRemoteNodeWarning'); } } @@ -106,19 +111,23 @@ Rectangle { } WizardMenuItem { - opacity: appWindow.persistentSettings.nettype == 0 ? 1.0 : 0.5 + opacity: simpleModeAvailable ? 1.0 : 0.5 headerText: qsTr("Simple mode") + " (bootstrap)" + translationManager.emptyString bodyText: { - if(appWindow.persistentSettings.nettype == 0){ - return qsTr("Easy access to sending, receiving and basic functionality. The blockchain is downloaded to your computer.") + translationManager.emptyString; + if (isTails) { + return qsTr("Not available on Tails.") + translationManager.emptyString; } else { - return "Available on mainnet."; + if (appWindow.persistentSettings.nettype == 0) { + return qsTr("Easy access to sending, receiving and basic functionality. The blockchain is downloaded to your computer.") + translationManager.emptyString; + } else { + return qsTr("Available on mainnet.") + translationManager.emptyString; + } } } imageIcon: "qrc:///images/local-node.png" onMenuClicked: { - if(appWindow.persistentSettings.nettype == 0){ + if (simpleModeAvailable) { appWindow.persistentSettings.pruneBlockchain = true; applyWalletMode(1, 'wizardModeBootstrap'); }