Files
pay/guis/mobile/StartupScreen.qml
T

221 lines
6.9 KiB
QML
Raw Permalink Normal View History

2023-02-09 18:25:10 +01:00
/*
* This file is part of the Flowee project
2024-10-08 22:04:45 +02:00
* Copyright (C) 2023-2024 Tom Zander <tom@flowee.org>
2023-02-09 18:25:10 +01:00
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick
import QtQuick.Layouts
import "../Flowee" as Flowee
import Flowee.org.pay
2023-02-09 18:25:10 +01:00
Page {
id: root
headerText: qsTr("Welcome!")
headerButtonVisible: true
headerButtonText: qsTr("Continue")
onHeaderButtonClicked: {
if (!portfolio.current.isUserOwned) {
request.clear(); // to make the QR here the same as there
2023-02-09 18:25:10 +01:00
var mainView = thePile.get(0);
mainView.currentIndex = 2 // go to the receive-tab
}
thePile.pop();
}
Item { // data store for this page.
Connections {
// connect to wallet and when its no longe user owned, close this window.
target: portfolio.current
function onIsUserOwnedChanged() {
// transaction seen arriving, this startup screen has fulfilled its purpose.
thePile.pop();
}
}
PaymentRequest {
id: request
account: portfolio.current
}
2023-02-09 18:25:10 +01:00
}
onActiveFocusChanged: request.start();
2023-02-09 18:25:10 +01:00
Flickable {
anchors.fill: parent
contentWidth: parent.width
contentHeight: column.height + 20
2023-02-09 18:25:10 +01:00
clip: true
Column {
id: column
width: parent.width
spacing: 10
y: 10
2023-02-09 18:25:10 +01:00
Row {
spacing: 20
x: (column.width - width) / 2
2023-02-09 18:25:10 +01:00
Rectangle {
id: logo
width: 100
height: 100
radius: 50
color: mainWindow.floweeBlue
Item {
// clip the logo only, ignore the text part
width: 71
height: 71
clip: true
x: 18
y: 22
Image {
source: "qrc:/FloweePay-light.svg"
// ratio: 449 / 77
width: height / 77 * 449
height: 71
}
}
}
Image {
source: "qrc:/bch.svg"
y: 10
width: 87
height: 87
smooth: true
}
}
Flowee.Label {
2023-02-09 18:26:58 +01:00
text: qsTr("Moving the world towards a Bitcoin\u00a0Cash economy")
2023-02-09 18:25:10 +01:00
wrapMode: Text.WordWrap
font.italic: true
horizontalAlignment: Text.AlignHCenter
width: column.width * 0.8
x: column.width / 10
2023-02-09 18:25:10 +01:00
}
Item { width: 1; height: 20 } // spacer
Flowee.Label {
id: instructions
text: qsTr("Scan me to send funds to your HD wallet") + ":"
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
width: column.width * 0.8
x: column.width / 10
2023-02-09 18:25:10 +01:00
}
Flowee.QRWidget {
width: parent.width
qrText: request.qr
}
/*
Row {
spacing: 20
height: 20
anchors.horizontalCenter: parent.horizontalCenter
Rectangle {
// copy to clipboard icon
width: 25
height: 25
}
Rectangle {
// 'share' icon
width: 25
height: 25
}
} */
2023-02-09 18:25:10 +01:00
Item { width: 1; height: 5 } // spacer
2023-02-09 18:25:10 +01:00
Row {
spacing: 15
x: (column.width - width) / 2
2023-02-09 18:25:10 +01:00
Rectangle {
width: 50
height: 1
2023-02-21 16:40:46 +01:00
color: palette.button
2023-02-09 18:25:10 +01:00
anchors.verticalCenter: parent.verticalCenter
}
Flowee.Label {
text: qsTr("OR")
}
Rectangle {
width: 50
height: 1
2023-02-21 16:40:46 +01:00
color: palette.button
2023-02-09 18:25:10 +01:00
anchors.verticalCenter: parent.verticalCenter
}
}
Item { width: 1; height: 5 } // spacer
2023-02-09 18:25:10 +01:00
Rectangle {
radius: 20
height:buttonText.height + 20
width: buttonText.width + 40
color: "#178b3a"
anchors.horizontalCenter: parent.horizontalCenter
Flowee.Label {
id: buttonText
color: "white"
text: qsTr("Add a different wallet")
anchors.centerIn: parent
}
MouseArea {
anchors.fill: parent
onClicked: thePile.replace("./NewAccount.qml");
}
2023-02-09 18:25:10 +01:00
}
2024-10-08 22:04:45 +02:00
Rectangle {
radius: 20
height:button2Text.height + 20
width: button2Text.width + 40
color: "#178b3a"
anchors.horizontalCenter: parent.horizontalCenter
property QtObject infoObject: {
for (var mod of ModuleManager.registeredModules) {
if (mod.id === "sendSweepModule") {
for (var section of mod.sections) {
if (section.isActionTabItem)
return section;
2024-10-08 22:04:45 +02:00
}
break;
}
}
return null;
}
visible: infoObject !== null
Flowee.Label {
id: button2Text
color: "white"
text: qsTr("Claim a Cash Stamp")
anchors.centerIn: parent
}
MouseArea {
anchors.fill: parent
onClicked: thePile.replace(parent.infoObject.qml);
}
}
2023-02-09 18:25:10 +01:00
Item { width: 1; height: 40 } // spacer
}
}
}