Merge pull request #3483

04c2d84 WizardModeSelection: disable simple mode on Tails (selsta)
This commit is contained in:
luigi1111 2022-06-09 13:51:20 -05:00
commit 59f189d264
No known key found for this signature in database
GPG key ID: F4ACA0183641E010

View file

@ -41,6 +41,7 @@ Rectangle {
property alias pageHeight: pageRoot.height property alias pageHeight: pageRoot.height
property string viewName: "wizardModeSelection1" property string viewName: "wizardModeSelection1"
property bool portable: persistentSettings.portable property bool portable: persistentSettings.portable
property bool simpleModeAvailable: !isTails && appWindow.persistentSettings.nettype == 0
function applyWalletMode(mode, wizardState) { function applyWalletMode(mode, wizardState) {
if (!persistentSettings.setPortable(portable)) { if (!persistentSettings.setPortable(portable)) {
@ -76,21 +77,25 @@ Rectangle {
} }
WizardMenuItem { WizardMenuItem {
opacity: appWindow.persistentSettings.nettype == 0 ? 1.0 : 0.5 opacity: simpleModeAvailable ? 1.0 : 0.5
Layout.topMargin: 20 Layout.topMargin: 20
headerText: qsTr("Simple mode") + translationManager.emptyString headerText: qsTr("Simple mode") + translationManager.emptyString
bodyText: { bodyText: {
if(appWindow.persistentSettings.nettype == 0){ if (isTails) {
return qsTr("Easy access to sending, receiving and basic functionality.") + translationManager.emptyString; return qsTr("Not available on Tails.") + translationManager.emptyString;
} else { } 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" imageIcon: "qrc:///images/remote-node.png"
onMenuClicked: { onMenuClicked: {
if(appWindow.persistentSettings.nettype == 0){ if (simpleModeAvailable) {
applyWalletMode(0, 'wizardModeRemoteNodeWarning'); applyWalletMode(0, 'wizardModeRemoteNodeWarning');
} }
} }
@ -106,19 +111,23 @@ Rectangle {
} }
WizardMenuItem { WizardMenuItem {
opacity: appWindow.persistentSettings.nettype == 0 ? 1.0 : 0.5 opacity: simpleModeAvailable ? 1.0 : 0.5
headerText: qsTr("Simple mode") + " (bootstrap)" + translationManager.emptyString headerText: qsTr("Simple mode") + " (bootstrap)" + translationManager.emptyString
bodyText: { bodyText: {
if(appWindow.persistentSettings.nettype == 0){ if (isTails) {
return qsTr("Easy access to sending, receiving and basic functionality. The blockchain is downloaded to your computer.") + translationManager.emptyString; return qsTr("Not available on Tails.") + translationManager.emptyString;
} else { } 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" imageIcon: "qrc:///images/local-node.png"
onMenuClicked: { onMenuClicked: {
if(appWindow.persistentSettings.nettype == 0){ if (simpleModeAvailable) {
appWindow.persistentSettings.pruneBlockchain = true; appWindow.persistentSettings.pruneBlockchain = true;
applyWalletMode(1, 'wizardModeBootstrap'); applyWalletMode(1, 'wizardModeBootstrap');
} }