2019-01-14 00:02:44 +00:00
// Copyright (c) 2014-2019, The Monero Project
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other
// materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors may be
// used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2019-04-11 01:17:29 +00:00
import QtQuick 2.9
2019-01-14 00:02:44 +00:00
import QtQuick . Dialogs 1.2
import QtQuick . Layouts 1.2
import QtQuick . Controls 2.0
import "../js/Wizard.js" as Wizard
import "../components" as MoneroComponents
Rectangle {
id: wizardModeSelection1
color: "transparent"
2019-07-24 03:07:54 +00:00
property alias pageHeight: pageRoot . height
2019-01-14 00:02:44 +00:00
property string viewName: "wizardModeSelection1"
2020-07-28 17:46:52 +00:00
property bool portable: persistentSettings . portable
2021-05-17 18:35:17 +00:00
property bool simpleModeAvailable: ! isTails && appWindow . persistentSettings . nettype == 0
2020-07-28 17:46:52 +00:00
function applyWalletMode ( mode , wizardState ) {
if ( ! persistentSettings . setPortable ( portable ) ) {
appWindow . showStatusMessage ( qsTr ( "Failed to configure portable mode" ) , 3 ) ;
return ;
}
2020-10-08 15:52:34 +00:00
logger . resetLogFilePath ( portable ) ;
2020-07-28 17:46:52 +00:00
appWindow . changeWalletMode ( mode ) ;
wizardController . wizardStackView . backTransition = false ;
wizardController . wizardState = wizardState ;
}
2019-01-14 00:02:44 +00:00
ColumnLayout {
2019-07-24 03:07:54 +00:00
id: pageRoot
2019-01-14 00:02:44 +00:00
Layout.alignment: Qt . AlignHCenter ;
width: parent . width - 100
Layout.fillWidth: true
anchors.horizontalCenter: parent . horizontalCenter ;
2019-04-25 19:09:23 +00:00
spacing: 10
2019-01-14 00:02:44 +00:00
ColumnLayout {
Layout.fillWidth: true
Layout.maximumWidth: wizardController . wizardSubViewWidth
Layout.topMargin: wizardController . wizardSubViewTopMargin
Layout.alignment: Qt . AlignHCenter
2019-04-25 19:09:23 +00:00
spacing: 0
2019-01-14 00:02:44 +00:00
WizardHeader {
2019-12-27 17:56:06 +00:00
title: qsTr ( "Mode selection" ) + translationManager . emptyString
2019-01-14 00:02:44 +00:00
subtitle: qsTr ( "Please select the statement that best matches you." ) + translationManager . emptyString
}
WizardMenuItem {
2021-05-17 18:35:17 +00:00
opacity: simpleModeAvailable ? 1.0 : 0.5
2019-04-25 19:09:23 +00:00
Layout.topMargin: 20
2019-01-14 00:02:44 +00:00
headerText: qsTr ( "Simple mode" ) + translationManager . emptyString
bodyText: {
2021-05-17 18:35:17 +00:00
if ( isTails ) {
return qsTr ( "Not available on Tails." ) + translationManager . emptyString ;
2019-01-14 00:02:44 +00:00
} else {
2021-05-17 18:35:17 +00:00
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 ;
}
2019-01-14 00:02:44 +00:00
}
}
2019-04-11 01:17:29 +00:00
imageIcon: "qrc:///images/remote-node.png"
2019-01-14 00:02:44 +00:00
onMenuClicked: {
2021-05-17 18:35:17 +00:00
if ( simpleModeAvailable ) {
2020-07-28 17:46:52 +00:00
applyWalletMode ( 0 , 'wizardModeRemoteNodeWarning' ) ;
2019-01-14 00:02:44 +00:00
}
}
}
Rectangle {
Layout.preferredHeight: 1
2019-04-25 19:09:23 +00:00
Layout.topMargin: 5
Layout.bottomMargin: 10
2019-01-14 00:02:44 +00:00
Layout.fillWidth: true
color: MoneroComponents . Style . dividerColor
opacity: MoneroComponents . Style . dividerOpacity
}
WizardMenuItem {
2021-05-17 18:35:17 +00:00
opacity: simpleModeAvailable ? 1.0 : 0.5
2019-01-14 00:02:44 +00:00
headerText: qsTr ( "Simple mode" ) + " (bootstrap)" + translationManager . emptyString
bodyText: {
2021-05-17 18:35:17 +00:00
if ( isTails ) {
return qsTr ( "Not available on Tails." ) + translationManager . emptyString ;
2019-01-14 00:02:44 +00:00
} else {
2021-05-17 18:35:17 +00:00
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 ;
}
2019-01-14 00:02:44 +00:00
}
}
2019-04-11 01:17:29 +00:00
imageIcon: "qrc:///images/local-node.png"
2019-01-14 00:02:44 +00:00
onMenuClicked: {
2021-05-17 18:35:17 +00:00
if ( simpleModeAvailable ) {
2021-04-05 23:56:19 +00:00
appWindow . persistentSettings . pruneBlockchain = true ;
2020-07-28 17:46:52 +00:00
applyWalletMode ( 1 , 'wizardModeBootstrap' ) ;
2019-01-14 00:02:44 +00:00
}
}
}
Rectangle {
Layout.preferredHeight: 1
2019-04-25 19:09:23 +00:00
Layout.topMargin: 5
Layout.bottomMargin: 10
2019-01-14 00:02:44 +00:00
Layout.fillWidth: true
color: MoneroComponents . Style . dividerColor
opacity: MoneroComponents . Style . dividerOpacity
}
WizardMenuItem {
headerText: qsTr ( "Advanced mode" ) + translationManager . emptyString
bodyText: qsTr ( "Includes extra features like mining and message verification. The blockchain is downloaded to your computer." ) + translationManager . emptyString
2019-04-11 01:17:29 +00:00
imageIcon: "qrc:///images/local-node-full.png"
2019-01-14 00:02:44 +00:00
onMenuClicked: {
2021-04-05 23:56:19 +00:00
appWindow . persistentSettings . pruneBlockchain = false ; // can be toggled on next page
2020-07-28 17:46:52 +00:00
applyWalletMode ( 2 , 'wizardHome' ) ;
2019-01-14 00:02:44 +00:00
}
}
2020-07-28 17:46:52 +00:00
WizardHeader {
Layout.topMargin: 20
title: qsTr ( "Optional features" ) + translationManager . emptyString
subtitle: qsTr ( "Select enhanced functionality you would like to enable." ) + translationManager . emptyString
}
WizardMenuItem {
Layout.topMargin: 20
headerText: qsTr ( "Portable mode" ) + translationManager . emptyString
bodyText: qsTr ( "Create portable wallets and use them on any PC. Enable if you installed Monero on a USB stick, an external drive, or any other portable storage medium." ) + translationManager . emptyString
checkbox: true
checked: wizardModeSelection1 . portable
onMenuClicked: wizardModeSelection1 . portable = ! wizardModeSelection1 . portable
}
2019-01-14 00:02:44 +00:00
WizardNav {
2019-04-25 19:09:23 +00:00
Layout.topMargin: 5
2019-11-27 18:13:32 +00:00
btnPrevText: qsTr ( "Back to menu" ) + translationManager . emptyString
2019-01-14 00:02:44 +00:00
btnNext.visible: false
progressSteps: 0
2019-12-20 05:29:10 +00:00
autoTransition: false
2019-01-14 00:02:44 +00:00
onPrevClicked: {
2020-07-28 17:46:52 +00:00
if ( wizardController . wizardStackView . backTransition ) {
applyWalletMode ( persistentSettings . walletMode , 'wizardHome' ) ;
} else {
wizardController . wizardStackView . backTransition = true ;
wizardController . wizardState = 'wizardLanguage' ;
}
2019-01-14 00:02:44 +00:00
}
}
}
}
Behavior on opacity {
NumberAnimation {
duration: 200 ;
easing.type: Easing . InCubic ;
}
}
}