From f016406c8c239c4495043318de20a24283593371 Mon Sep 17 00:00:00 2001 From: D33r-Gee Date: Wed, 18 Sep 2024 14:21:15 -0700 Subject: [PATCH] qml: Update and Add UI Snapshot settings --- src/qml/pages/settings/SettingsConnection.qml | 33 ++++++++++++++++ .../pages/settings/SettingsLoadedSnapshot.qml | 38 +++++++++++++++++++ .../pages/settings/SettingsProgressBar.qml | 35 +++++++++++++++++ src/qml/pages/settings/SettingsSnapshot.qml | 33 ++++++++++++++++ 4 files changed, 139 insertions(+) create mode 100644 src/qml/pages/settings/SettingsLoadedSnapshot.qml create mode 100644 src/qml/pages/settings/SettingsProgressBar.qml create mode 100644 src/qml/pages/settings/SettingsSnapshot.qml diff --git a/src/qml/pages/settings/SettingsConnection.qml b/src/qml/pages/settings/SettingsConnection.qml index 9ff9094f11..5e3dd961d2 100644 --- a/src/qml/pages/settings/SettingsConnection.qml +++ b/src/qml/pages/settings/SettingsConnection.qml @@ -13,6 +13,11 @@ Item { property alias navMiddleDetail: connectionSwipe.navMiddleDetail property alias navLeftDetail: connectionSwipe.navLeftDetail property alias showHeader: connectionSwipe.showHeader + + function setSnapshotImported(imported) { + connection_settings.loadedDetailItem.setSnapshotImported(imported) + } + SwipeView { id: connectionSwipe property alias navRightDetail: connection_settings.navRightDetail @@ -21,6 +26,10 @@ Item { property alias showHeader: connection_settings.showHeader anchors.fill: parent interactive: false + property double snapshotVerificationProgress: 0.0 + property int snapshotVerificationCycles: 0 + property bool snapshotVerified: false + property real progress: 0 orientation: Qt.Horizontal InformationPage { id: connection_settings @@ -38,5 +47,29 @@ Item { connectionSwipe.decrementCurrentIndex() } } + SettingsSnapshot { + onBackClicked: { + connectionSwipe.decrementCurrentIndex() + connectionSwipe.decrementCurrentIndex() + } + } + SettingsProgressBar { + onBackClicked: { + connectionSwipe.decrementCurrentIndex() + connectionSwipe.decrementCurrentIndex() + connectionSwipe.decrementCurrentIndex() + } + } + SettingsLoadedSnapshot { + onSnapshotImportCompleted: { + setSnapshotImported(true) + } + onBackClicked: { + connectionSwipe.decrementCurrentIndex() + connectionSwipe.decrementCurrentIndex() + connectionSwipe.decrementCurrentIndex() + connectionSwipe.decrementCurrentIndex() + } + } } } diff --git a/src/qml/pages/settings/SettingsLoadedSnapshot.qml b/src/qml/pages/settings/SettingsLoadedSnapshot.qml new file mode 100644 index 0000000000..c16325dc2b --- /dev/null +++ b/src/qml/pages/settings/SettingsLoadedSnapshot.qml @@ -0,0 +1,38 @@ +// Copyright (c) 2024-present The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 1.15 +import "../../controls" +import "../../components" + +Page { + signal backClicked + signal continueClicked + signal snapshotImportCompleted + + id: root + + background: null + implicitWidth: 450 + leftPadding: 20 + rightPadding: 20 + topPadding: 30 + + header: NavigationBar2 { + leftItem: NavButton { + iconSource: "image://images/caret-left" + text: qsTr("Back") + onClicked: root.backClicked() + } + } + LoadedSnapshotSettings { + width: Math.min(parent.width, 450) + anchors.horizontalCenter: parent.horizontalCenter + onSnapshotImportCompleted: { + root.snapshotImportCompleted() + } + } +} diff --git a/src/qml/pages/settings/SettingsProgressBar.qml b/src/qml/pages/settings/SettingsProgressBar.qml new file mode 100644 index 0000000000..b2cb578fb2 --- /dev/null +++ b/src/qml/pages/settings/SettingsProgressBar.qml @@ -0,0 +1,35 @@ +// Copyright (c) 2024-present resent The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 1.15 + +import "../../controls" +import "../../components" + +Page { + signal backClicked + signal continueClicked + + id: root + + background: null + implicitWidth: 450 + leftPadding: 20 + rightPadding: 20 + topPadding: 30 + + header: NavigationBar2 { + leftItem: NavButton { + iconSource: "image://images/caret-left" + text: qsTr("Back") + onClicked: root.backClicked() + } + } + ProgressBarSettings { + width: Math.min(parent.width, 450) + anchors.horizontalCenter: parent.horizontalCenter + } +} diff --git a/src/qml/pages/settings/SettingsSnapshot.qml b/src/qml/pages/settings/SettingsSnapshot.qml new file mode 100644 index 0000000000..b8404d5c7b --- /dev/null +++ b/src/qml/pages/settings/SettingsSnapshot.qml @@ -0,0 +1,33 @@ +// Copyright (c) 2024-present The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 1.15 +import "../../controls" +import "../../components" + +Page { + signal backClicked + + id: root + + background: null + implicitWidth: 450 + leftPadding: 20 + rightPadding: 20 + topPadding: 30 + + header: NavigationBar2 { + leftItem: NavButton { + iconSource: "image://images/caret-left" + text: qsTr("Back") + onClicked: root.backClicked() + } + } + SnapshotSettings { + width: Math.min(parent.width, 450) + anchors.horizontalCenter: parent.horizontalCenter + } +}