mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-16 16:47:24 +00:00
chore(storybook): unbreak (Device)SyncingViewPage
and make it configurable a bit
This commit is contained in:
parent
a587e504ef
commit
f2f954c24b
@ -1,72 +0,0 @@
|
|||||||
import QtQuick 2.15
|
|
||||||
import QtQuick.Controls 2.15
|
|
||||||
import QtQuick.Layouts 1.15
|
|
||||||
import StatusQ.Core 0.1
|
|
||||||
|
|
||||||
import Storybook 1.0
|
|
||||||
import Models 1.0
|
|
||||||
import utils 1.0
|
|
||||||
|
|
||||||
import shared.views 1.0
|
|
||||||
|
|
||||||
SplitView {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
Logs { id: logs }
|
|
||||||
|
|
||||||
SplitView {
|
|
||||||
orientation: Qt.Vertical
|
|
||||||
SplitView.fillWidth: true
|
|
||||||
|
|
||||||
DeviceSyncingView {
|
|
||||||
devicesModel: ListModel {
|
|
||||||
ListElement {
|
|
||||||
name: "Device 1"
|
|
||||||
deviceType: "osx"
|
|
||||||
timestamp: 0
|
|
||||||
isCurrentDevice: false
|
|
||||||
}
|
|
||||||
ListElement {
|
|
||||||
name: "Device 2"
|
|
||||||
deviceType: "windows"
|
|
||||||
timestamp: 0
|
|
||||||
isCurrentDevice: false
|
|
||||||
}
|
|
||||||
ListElement {
|
|
||||||
name: "Device 3"
|
|
||||||
deviceType: "android"
|
|
||||||
timestamp: 0
|
|
||||||
isCurrentDevice: false
|
|
||||||
}
|
|
||||||
ListElement {
|
|
||||||
name: "Device 4"
|
|
||||||
deviceType: "ios"
|
|
||||||
timestamp: 0
|
|
||||||
isCurrentDevice: false
|
|
||||||
}
|
|
||||||
ListElement {
|
|
||||||
name: "Device 5"
|
|
||||||
deviceType: "desktop"
|
|
||||||
timestamp: 0
|
|
||||||
isCurrentDevice: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LogsAndControlsPanel {
|
|
||||||
id: logsAndControlsPanel
|
|
||||||
|
|
||||||
SplitView.minimumHeight: 100
|
|
||||||
SplitView.preferredHeight: 200
|
|
||||||
|
|
||||||
logsView.logText: logs.logText
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Pane {
|
|
||||||
SplitView.minimumWidth: 300
|
|
||||||
SplitView.preferredWidth: 300
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// category: Views
|
|
131
storybook/pages/SyncingViewPage.qml
Normal file
131
storybook/pages/SyncingViewPage.qml
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
import QtQuick 2.15
|
||||||
|
import QtQuick.Controls 2.15
|
||||||
|
import QtQuick.Layouts 1.15
|
||||||
|
|
||||||
|
import Storybook 1.0
|
||||||
|
|
||||||
|
import mainui 1.0
|
||||||
|
import utils 1.0
|
||||||
|
import AppLayouts.Profile.views 1.0
|
||||||
|
|
||||||
|
SplitView {
|
||||||
|
id: root
|
||||||
|
orientation: Qt.Vertical
|
||||||
|
|
||||||
|
Logs { id: logs }
|
||||||
|
|
||||||
|
Popups {
|
||||||
|
popupParent: root
|
||||||
|
rootStore: QtObject {}
|
||||||
|
}
|
||||||
|
|
||||||
|
SyncingView {
|
||||||
|
id: syncView
|
||||||
|
SplitView.fillWidth: true
|
||||||
|
SplitView.fillHeight: true
|
||||||
|
|
||||||
|
contentWidth: 664
|
||||||
|
|
||||||
|
isProduction: ctrlIsProduction.checked
|
||||||
|
|
||||||
|
advancedStore: QtObject {
|
||||||
|
readonly property bool isDebugEnabled: ctrlDebugEnabled.checked
|
||||||
|
}
|
||||||
|
|
||||||
|
devicesStore: QtObject {
|
||||||
|
function generateConnectionStringAndRunSetupSyncingPopup() {
|
||||||
|
logs.logEvent("devicesStore::generateConnectionStringAndRunSetupSyncingPopup()")
|
||||||
|
}
|
||||||
|
|
||||||
|
function setInstallationName(installationId, name) {
|
||||||
|
logs.logEvent("devicesStore::setInstallationName", ["installationId", "name"], arguments)
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly property bool isDeviceSetup: ctrlDevicesLoaded.checked
|
||||||
|
readonly property var devicesModule: QtObject {
|
||||||
|
readonly property bool devicesLoading: ctrlDevicesLoading.checked
|
||||||
|
readonly property bool devicesLoadingError: ctrlDevicesLoadingError.checked
|
||||||
|
}
|
||||||
|
readonly property var devicesModel: ListModel {
|
||||||
|
ListElement {
|
||||||
|
name: "Device 1"
|
||||||
|
deviceType: "osx"
|
||||||
|
timestamp: 123456789123
|
||||||
|
isCurrentDevice: true
|
||||||
|
enabled: true
|
||||||
|
installationId: "a"
|
||||||
|
}
|
||||||
|
ListElement {
|
||||||
|
name: "Device 2"
|
||||||
|
deviceType: "windows"
|
||||||
|
timestamp: 123456789123
|
||||||
|
isCurrentDevice: false
|
||||||
|
enabled: false
|
||||||
|
installationId: "b"
|
||||||
|
}
|
||||||
|
ListElement {
|
||||||
|
name: "Device 3"
|
||||||
|
deviceType: "android"
|
||||||
|
timestamp: 3456541235346346322
|
||||||
|
isCurrentDevice: false
|
||||||
|
enabled: true
|
||||||
|
installationId: "c"
|
||||||
|
}
|
||||||
|
ListElement {
|
||||||
|
name: "Device 4"
|
||||||
|
deviceType: "ios"
|
||||||
|
timestamp: 385657923539634639
|
||||||
|
isCurrentDevice: false
|
||||||
|
enabled: true
|
||||||
|
installationId: "d"
|
||||||
|
}
|
||||||
|
ListElement {
|
||||||
|
name: "Device 5"
|
||||||
|
deviceType: "desktop"
|
||||||
|
timestamp: 0
|
||||||
|
isCurrentDevice: false
|
||||||
|
enabled: true
|
||||||
|
installationId: "e"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LogsAndControlsPanel {
|
||||||
|
id: logsAndControlsPanel
|
||||||
|
|
||||||
|
SplitView.minimumHeight: 100
|
||||||
|
SplitView.preferredHeight: 270
|
||||||
|
|
||||||
|
logsView.logText: logs.logText
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
RadioButton {
|
||||||
|
id: ctrlDevicesLoaded
|
||||||
|
text: "Devices loaded"
|
||||||
|
checked: true
|
||||||
|
}
|
||||||
|
RadioButton {
|
||||||
|
id: ctrlDevicesLoading
|
||||||
|
text: "Devices loading"
|
||||||
|
}
|
||||||
|
RadioButton {
|
||||||
|
id: ctrlDevicesLoadingError
|
||||||
|
text: "Devices loading error"
|
||||||
|
}
|
||||||
|
|
||||||
|
Switch {
|
||||||
|
id: ctrlDebugEnabled
|
||||||
|
text: "Debug enabled"
|
||||||
|
}
|
||||||
|
|
||||||
|
Switch {
|
||||||
|
id: ctrlIsProduction
|
||||||
|
text: "Is production"
|
||||||
|
checked: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// category: Views
|
@ -236,6 +236,7 @@ StatusSectionLayout {
|
|||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
|
|
||||||
|
isProduction: production
|
||||||
profileStore: root.store.profileStore
|
profileStore: root.store.profileStore
|
||||||
devicesStore: root.store.devicesStore
|
devicesStore: root.store.devicesStore
|
||||||
privacyStore: root.store.privacyStore
|
privacyStore: root.store.privacyStore
|
||||||
|
@ -19,8 +19,8 @@ import "../stores"
|
|||||||
StatusDialog {
|
StatusDialog {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property DevicesStore devicesStore
|
property var devicesStore
|
||||||
property AdvancedStore advancedStore
|
property var advancedStore
|
||||||
property var deviceModel
|
property var deviceModel
|
||||||
|
|
||||||
readonly property string deviceName: d.deviceName
|
readonly property string deviceName: d.deviceName
|
||||||
|
@ -27,10 +27,12 @@ import "../../stores"
|
|||||||
SettingsContentBase {
|
SettingsContentBase {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property DevicesStore devicesStore
|
property var devicesStore
|
||||||
property ProfileStore profileStore
|
property ProfileStore profileStore
|
||||||
property PrivacyStore privacyStore
|
property PrivacyStore privacyStore
|
||||||
property AdvancedStore advancedStore
|
property var advancedStore
|
||||||
|
|
||||||
|
required property bool isProduction
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: layout
|
id: layout
|
||||||
@ -247,11 +249,10 @@ SettingsContentBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StatusButton {
|
StatusButton {
|
||||||
|
|
||||||
objectName: "setupSyncBackupDataButton"
|
objectName: "setupSyncBackupDataButton"
|
||||||
|
|
||||||
id: backupBtn
|
id: backupBtn
|
||||||
visible: !production
|
visible: !root.isProduction
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
text: qsTr("Backup Data")
|
text: qsTr("Backup Data")
|
||||||
onClicked : {
|
onClicked : {
|
||||||
@ -264,7 +265,7 @@ SettingsContentBase {
|
|||||||
id: personalizeDevicePopup
|
id: personalizeDevicePopup
|
||||||
|
|
||||||
SyncDeviceCustomizationPopup {
|
SyncDeviceCustomizationPopup {
|
||||||
anchors.centerIn: parent
|
destroyOnClose: true
|
||||||
devicesStore: root.devicesStore
|
devicesStore: root.devicesStore
|
||||||
advancedStore: root.advancedStore
|
advancedStore: root.advancedStore
|
||||||
}
|
}
|
||||||
@ -274,7 +275,7 @@ SettingsContentBase {
|
|||||||
id: setupSyncingPopup
|
id: setupSyncingPopup
|
||||||
|
|
||||||
SetupSyncingPopup {
|
SetupSyncingPopup {
|
||||||
anchors.centerIn: parent
|
destroyOnClose: true
|
||||||
devicesStore: root.devicesStore
|
devicesStore: root.devicesStore
|
||||||
profileStore: root.profileStore
|
profileStore: root.profileStore
|
||||||
}
|
}
|
||||||
|
@ -4,3 +4,4 @@ AppearanceView 1.0 AppearanceView.qml
|
|||||||
NotificationsView 1.0 NotificationsView.qml
|
NotificationsView 1.0 NotificationsView.qml
|
||||||
CommunitiesView 1.0 CommunitiesView.qml
|
CommunitiesView 1.0 CommunitiesView.qml
|
||||||
BrowserView 1.0 BrowserView.qml
|
BrowserView 1.0 BrowserView.qml
|
||||||
|
SyncingView 1.0 SyncingView.qml
|
||||||
|
Loading…
x
Reference in New Issue
Block a user