disable browser, wallet, node tabs by default; add warning checkbox to intro screen

This commit is contained in:
Iuri Matias 2020-06-26 10:08:08 -04:00
parent 3550e63a86
commit 6e9ce3b250
4 changed files with 48 additions and 9 deletions

View File

@ -1,4 +1,4 @@
import NimQml, eventemitter, chronicles
import NimQml, eventemitter, chronicles, os
import app/chat/core as chat
import app/wallet/core as wallet
@ -57,6 +57,10 @@ proc mainProc() =
engine.setRootContextProperty("loginModel", login.variant)
engine.setRootContextProperty("onboardingModel", onboarding.variant)
let isExperimental = if getEnv("EXPERIMENTAL") == "1": "1" else: "0" # value explicity passed to avoid trusting input
let experimentalFlag = newQVariant(isExperimental)
engine.setRootContextProperty("isExperimental", experimentalFlag)
defer:
error "TODO: if user is logged in, logout"
engine.delete()

View File

@ -23,11 +23,31 @@ Item {
}
RowLayout {
id: browserTabSettings
id: walletTabSettings
anchors.top: element7.bottom
anchors.topMargin: 20
anchors.left: parent.left
anchors.leftMargin: 24
StyledText {
text: qsTr("Wallet Tab")
}
Switch {
checked: walletBtn.enabled
onCheckedChanged: function(value) {
walletBtn.enabled = this.checked
}
}
StyledText {
text: qsTr("NOT RECOMMENDED - Use at your own risk")
}
}
RowLayout {
id: browserTabSettings
anchors.top: walletTabSettings.bottom
anchors.topMargin: 20
anchors.left: parent.left
anchors.leftMargin: 24
StyledText {
text: qsTr("Browser Tab")
}

View File

@ -59,10 +59,12 @@ RowLayout {
TabButton {
id: walletBtn
enabled: isExperimental === "1"
visible: this.enabled
width: 40
height: 40
height: this.enabled ? 40 : 0
text: ""
anchors.topMargin: 50
anchors.topMargin: this.enabled ? 50 : 0
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: chatBtn.top
background: Rectangle {
@ -84,6 +86,7 @@ RowLayout {
TabButton {
id: browserBtn
enabled: isExperimental === "1"
visible: this.enabled
width: 40
height: this.enabled ? 40 : 0
@ -135,6 +138,7 @@ RowLayout {
TabButton {
id: nodeBtn
enabled: isExperimental === "1"
visible: this.enabled
width: 40
height: this.enabled ? 40 : 0

View File

@ -2,6 +2,7 @@ import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import "../shared"
import "../imports"
RowLayout {
property alias btnGetStarted: btnGetStarted
@ -75,7 +76,7 @@ RowLayout {
text: qsTr("Thanks for trying Status Desktop! Please note that this is an alpha release and we advise you that using this app should be done for testing purposes only and you assume the full responsibility for all risks concerning your data and funds. Status makes no claims of security or integrity of funds in these builds.")
font.bold: true
anchors.top: rctPageIndicator.bottom
anchors.topMargin: 10
anchors.topMargin: 5
anchors.horizontalCenter: parent.horizontalCenter
font.pixelSize: 14
font.letterSpacing: 0.1
@ -84,11 +85,21 @@ RowLayout {
color: Theme.black
}
CheckBox {
id: warningCheckBox
anchors.top: warningMessage.bottom
anchors.topMargin: 0
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("I understand")
}
StyledButton {
id: btnGetStarted
label: "I understand"
anchors.top: warningMessage.bottom
anchors.topMargin: 17
enabled: warningCheckBox.checked
btnColor: this.enabled ? Theme.lightBlue : "lightgrey"
label: "Get Started"
anchors.top: warningCheckBox.bottom
anchors.topMargin: 5
anchors.horizontalCenter: parent.horizontalCenter
width: 146
height: 44
@ -99,7 +110,7 @@ RowLayout {
x: 772
text: qsTr("Status does not collect, share or sell any personal data. By continuing you agree with the privacy policy.")
anchors.top: btnGetStarted.bottom
anchors.topMargin: 17
anchors.topMargin: 8
anchors.horizontalCenter: parent.horizontalCenter
font.pixelSize: 12
font.letterSpacing: 0.1