2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2020-05-11 21:24:08 +00:00
|
|
|
import Qt.labs.platform 1.1
|
2020-06-04 07:38:24 +00:00
|
|
|
import QtQml.StateMachine 1.14 as DSM
|
2020-07-09 17:02:58 +00:00
|
|
|
import QtMultimedia 5.13
|
2020-06-23 20:49:04 +00:00
|
|
|
import Qt.labs.settings 1.0
|
2020-07-10 21:47:31 +00:00
|
|
|
import QtQuick.Window 2.12
|
2020-06-23 20:49:04 +00:00
|
|
|
import QtQml 2.13
|
2020-07-12 16:47:46 +00:00
|
|
|
import QtQuick.Window 2.0
|
feat: Support system dark mode theme
Supports system dark mode. Changes the user appearance setting to a 3-way setting of System, Light, Dark.
New accounts will have their appearance setting set to "System", which uses the system setting to determine if dark mode should be applied.
Breaking change: Users who had their settings on Light Theme, will now get the system theme (light or dark). Users who had their theme set to Dark, will now get the Light theme.
At startup, the onboarding screens will have the system-level setting of dark mode applied or not. Once, logged in, the user settings will be applied.
## Note
An appearance setting of "System" is not dynamic to the system-level setting. This means that if a user has "System" set for their appearance (and ie, the user has light mode set), and then user then changes their system setting from light to dark, the app will not respond until it is restarted. This is due to a limitation of Qt not having a reliable way to propagate these changes to QML.
2020-09-29 06:18:00 +00:00
|
|
|
import QtQuick.Controls.Universal 2.12
|
2020-07-12 16:47:46 +00:00
|
|
|
|
2020-05-13 02:51:26 +00:00
|
|
|
import "./onboarding"
|
|
|
|
import "./app"
|
2020-07-09 17:02:58 +00:00
|
|
|
import "./sounds"
|
2020-07-10 21:47:31 +00:00
|
|
|
import "./shared"
|
2020-06-19 18:06:58 +00:00
|
|
|
import "./imports"
|
2020-05-11 21:24:08 +00:00
|
|
|
|
|
|
|
ApplicationWindow {
|
2020-07-01 15:37:36 +00:00
|
|
|
property bool hasAccounts: !!loginModel.rowCount()
|
2020-06-23 20:49:04 +00:00
|
|
|
|
feat: Support system dark mode theme
Supports system dark mode. Changes the user appearance setting to a 3-way setting of System, Light, Dark.
New accounts will have their appearance setting set to "System", which uses the system setting to determine if dark mode should be applied.
Breaking change: Users who had their settings on Light Theme, will now get the system theme (light or dark). Users who had their theme set to Dark, will now get the Light theme.
At startup, the onboarding screens will have the system-level setting of dark mode applied or not. Once, logged in, the user settings will be applied.
## Note
An appearance setting of "System" is not dynamic to the system-level setting. This means that if a user has "System" set for their appearance (and ie, the user has light mode set), and then user then changes their system setting from light to dark, the app will not respond until it is restarted. This is due to a limitation of Qt not having a reliable way to propagate these changes to QML.
2020-09-29 06:18:00 +00:00
|
|
|
Universal.theme: Universal.System
|
|
|
|
|
2020-05-11 21:24:08 +00:00
|
|
|
id: applicationWindow
|
2020-11-18 14:01:09 +00:00
|
|
|
minimumWidth: 800
|
|
|
|
minimumHeight: 600
|
|
|
|
width: 1232
|
|
|
|
height: 770
|
2020-07-13 18:45:54 +00:00
|
|
|
color: Style.current.background
|
2020-06-23 20:49:04 +00:00
|
|
|
title: {
|
|
|
|
// Set application settings
|
2020-09-04 16:07:11 +00:00
|
|
|
//% "Status Desktop"
|
|
|
|
Qt.application.name = qsTrId("status-desktop")
|
2020-06-23 20:49:04 +00:00
|
|
|
Qt.application.organization = "Status"
|
|
|
|
Qt.application.domain = "status.im"
|
|
|
|
return Qt.application.name
|
|
|
|
}
|
2020-05-11 21:24:08 +00:00
|
|
|
visible: true
|
2020-05-18 15:07:30 +00:00
|
|
|
|
2020-11-17 03:07:01 +00:00
|
|
|
Action {
|
|
|
|
shortcut: StandardKey.FullScreen
|
|
|
|
onTriggered: {
|
|
|
|
if (visibility === Window.FullScreen) {
|
|
|
|
showNormal()
|
|
|
|
} else {
|
|
|
|
showFullScreen()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Action {
|
|
|
|
shortcut: "Ctrl+M"
|
|
|
|
onTriggered: {
|
|
|
|
if (visibility === Window.Minimized) {
|
|
|
|
showNormal()
|
|
|
|
} else {
|
|
|
|
showMinimized()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-12 16:47:46 +00:00
|
|
|
Component.onCompleted: {
|
feat: Support system dark mode theme
Supports system dark mode. Changes the user appearance setting to a 3-way setting of System, Light, Dark.
New accounts will have their appearance setting set to "System", which uses the system setting to determine if dark mode should be applied.
Breaking change: Users who had their settings on Light Theme, will now get the system theme (light or dark). Users who had their theme set to Dark, will now get the Light theme.
At startup, the onboarding screens will have the system-level setting of dark mode applied or not. Once, logged in, the user settings will be applied.
## Note
An appearance setting of "System" is not dynamic to the system-level setting. This means that if a user has "System" set for their appearance (and ie, the user has light mode set), and then user then changes their system setting from light to dark, the app will not respond until it is restarted. This is due to a limitation of Qt not having a reliable way to propagate these changes to QML.
2020-09-29 06:18:00 +00:00
|
|
|
// Change the theme to the system theme (dark/light) until we get the
|
|
|
|
// user's saved setting from status-go (after login)
|
|
|
|
Style.changeTheme(Universal.theme === Universal.Dark ? "dark" : "light")
|
2020-07-14 16:20:08 +00:00
|
|
|
setX(Qt.application.screens[0].width / 2 - width / 2);
|
|
|
|
setY(Qt.application.screens[0].height / 2 - height / 2);
|
2020-07-12 16:47:46 +00:00
|
|
|
}
|
|
|
|
|
2020-06-04 07:38:24 +00:00
|
|
|
signal navigateTo(string path)
|
|
|
|
|
2020-07-10 18:31:12 +00:00
|
|
|
ErrorSound {
|
|
|
|
id: errorSound
|
2020-07-09 17:02:58 +00:00
|
|
|
}
|
|
|
|
|
2020-07-10 18:31:12 +00:00
|
|
|
Audio {
|
|
|
|
id: sendMessageSound
|
|
|
|
audioRole: Audio.NotificationRole
|
|
|
|
source: "../../../../sounds/send_message.wav"
|
2020-09-17 10:18:16 +00:00
|
|
|
volume: appSettings.volume
|
2020-10-15 15:04:53 +00:00
|
|
|
muted: !appSettings.notificationSoundsEnabled
|
2020-07-09 17:02:58 +00:00
|
|
|
}
|
|
|
|
|
2020-07-10 21:47:31 +00:00
|
|
|
Audio {
|
|
|
|
id: notificationSound
|
|
|
|
audioRole: Audio.NotificationRole
|
|
|
|
source: "../../../../sounds/notification.wav"
|
2020-09-17 10:18:16 +00:00
|
|
|
volume: appSettings.volume
|
2020-10-15 15:04:53 +00:00
|
|
|
muted: !appSettings.notificationSoundsEnabled
|
2020-07-10 21:47:31 +00:00
|
|
|
}
|
|
|
|
|
2020-09-16 14:28:03 +00:00
|
|
|
signal settingsLoaded()
|
2020-11-19 15:07:52 +00:00
|
|
|
|
2020-06-23 20:49:04 +00:00
|
|
|
Settings {
|
2020-11-19 15:07:52 +00:00
|
|
|
id: defaultAppSettings
|
2021-01-05 16:36:42 +00:00
|
|
|
property bool communitiesEnabled: false
|
2020-09-15 19:47:13 +00:00
|
|
|
property bool walletEnabled: false
|
2021-01-14 14:12:37 +00:00
|
|
|
property bool nodeManagementEnabled: false
|
2020-09-22 15:12:48 +00:00
|
|
|
property bool browserEnabled: false
|
2020-09-15 19:47:13 +00:00
|
|
|
property bool displayChatImages: false
|
2020-12-17 10:40:37 +00:00
|
|
|
property bool timelineEnabled: true
|
2020-09-15 19:47:13 +00:00
|
|
|
property bool compactMode
|
|
|
|
property string locale: "en"
|
|
|
|
property var recentEmojis: []
|
2020-09-17 10:18:16 +00:00
|
|
|
property real volume: 0.2
|
2020-11-19 15:07:52 +00:00
|
|
|
property int notificationSetting: Constants.notifyAllMessages
|
2020-10-15 15:04:53 +00:00
|
|
|
property bool notificationSoundsEnabled: true
|
2020-12-07 17:37:39 +00:00
|
|
|
property bool useOSNotifications: true
|
2020-11-17 19:02:56 +00:00
|
|
|
property int notificationMessagePreviewSetting: Constants.notificationPreviewNameAndMessage
|
2020-11-18 12:50:38 +00:00
|
|
|
property bool allowNotificationsFromNonContacts: false
|
2020-10-23 17:57:28 +00:00
|
|
|
property var whitelistedUnfurlingSites: ({})
|
2020-10-23 20:38:36 +00:00
|
|
|
property bool neverAskAboutUnfurlingAgain: false
|
2020-11-26 15:58:01 +00:00
|
|
|
property bool hideChannelSuggestions: false
|
2020-11-27 16:21:15 +00:00
|
|
|
property bool hideSignPhraseModal: false
|
2021-01-15 15:37:23 +00:00
|
|
|
property bool onlyShowContactsProfilePics: true
|
2020-10-21 14:49:13 +00:00
|
|
|
|
2020-11-25 10:46:18 +00:00
|
|
|
property int fontSize: Constants.fontSizeM
|
|
|
|
|
2020-10-21 14:49:13 +00:00
|
|
|
// Browser settings
|
2020-12-29 20:33:54 +00:00
|
|
|
property bool showBrowserSelector: true
|
|
|
|
property bool openLinksInStatus: true
|
2020-12-29 15:31:26 +00:00
|
|
|
property bool showFavoritesBar: false
|
2021-01-04 20:34:46 +00:00
|
|
|
property string browserHomepage: ""
|
2021-01-04 21:06:38 +00:00
|
|
|
property int browserSearchEngine: Constants.browserSearchEngineNone
|
2021-01-04 21:23:20 +00:00
|
|
|
property int browserEthereumExplorer: Constants.browserEthereumExplorerNone
|
2020-10-21 14:49:13 +00:00
|
|
|
property bool autoLoadImages: true
|
|
|
|
property bool javaScriptEnabled: true
|
|
|
|
property bool errorPageEnabled: true
|
|
|
|
property bool pluginsEnabled: true
|
|
|
|
property bool autoLoadIconsForPage: true
|
|
|
|
property bool touchIconsEnabled: true
|
|
|
|
property bool webRTCPublicInterfacesOnly: false
|
|
|
|
property bool devToolsEnabled: false
|
|
|
|
property bool pdfViewerEnabled: true
|
2020-10-21 16:50:21 +00:00
|
|
|
property bool compatibilityMode: true
|
2020-07-16 22:04:47 +00:00
|
|
|
}
|
2020-10-21 14:49:13 +00:00
|
|
|
|
2020-11-19 15:07:52 +00:00
|
|
|
Settings {
|
|
|
|
id: appSettings
|
|
|
|
fileName: profileModel.profileSettingsFile
|
|
|
|
property var chatSplitView
|
|
|
|
property var walletSplitView
|
|
|
|
property var profileSplitView
|
2021-01-05 16:36:42 +00:00
|
|
|
property bool communitiesEnabled: defaultAppSettings.communitiesEnabled
|
2021-01-07 14:31:07 +00:00
|
|
|
property bool removeMnemonicAfterLogin: false
|
2020-11-19 15:07:52 +00:00
|
|
|
property bool walletEnabled: defaultAppSettings.walletEnabled
|
2021-01-14 14:12:37 +00:00
|
|
|
property bool nodeManagementEnabled: defaultAppSettings.nodeManagementEnabled
|
2020-11-19 15:07:52 +00:00
|
|
|
property bool browserEnabled: defaultAppSettings.browserEnabled
|
|
|
|
property bool displayChatImages: defaultAppSettings.displayChatImages
|
|
|
|
property bool compactMode: defaultAppSettings.compactMode
|
2020-12-17 10:40:37 +00:00
|
|
|
property bool timelineEnabled: defaultAppSettings.timelineEnabled
|
2020-11-19 15:07:52 +00:00
|
|
|
property string locale: defaultAppSettings.locale
|
|
|
|
property var recentEmojis: defaultAppSettings.recentEmojis
|
|
|
|
property real volume: defaultAppSettings.volume
|
|
|
|
property int notificationSetting: defaultAppSettings.notificationSetting
|
|
|
|
property bool notificationSoundsEnabled: defaultAppSettings.notificationSoundsEnabled
|
2020-12-07 17:37:39 +00:00
|
|
|
property bool useOSNotifications: defaultAppSettings.useOSNotifications
|
2020-11-19 15:07:52 +00:00
|
|
|
property int notificationMessagePreviewSetting: defaultAppSettings.notificationMessagePreviewSetting
|
|
|
|
property bool allowNotificationsFromNonContacts: defaultAppSettings.allowNotificationsFromNonContacts
|
|
|
|
property var whitelistedUnfurlingSites: defaultAppSettings.whitelistedUnfurlingSites
|
|
|
|
property bool neverAskAboutUnfurlingAgain: defaultAppSettings.neverAskAboutUnfurlingAgain
|
2020-11-26 15:58:01 +00:00
|
|
|
property bool hideChannelSuggestions: defaultAppSettings.hideChannelSuggestions
|
2020-11-25 10:46:18 +00:00
|
|
|
property int fontSize: defaultAppSettings.fontSize
|
2020-11-27 16:21:15 +00:00
|
|
|
property bool hideSignPhraseModal: defaultAppSettings.hideSignPhraseModal
|
2021-01-15 15:37:23 +00:00
|
|
|
property bool onlyShowContactsProfilePics: defaultAppSettings.onlyShowContactsProfilePics
|
2020-11-25 10:46:18 +00:00
|
|
|
|
2020-11-19 15:07:52 +00:00
|
|
|
// Browser settings
|
2020-12-29 20:33:54 +00:00
|
|
|
property bool showBrowserSelector: defaultAppSettings.showBrowserSelector
|
|
|
|
property bool openLinksInStatus: defaultAppSettings.openLinksInStatus
|
2020-12-29 15:31:26 +00:00
|
|
|
property bool showFavoritesBar: defaultAppSettings.showFavoritesBar
|
2021-01-04 20:34:46 +00:00
|
|
|
property string browserHomepage: defaultAppSettings.browserHomepage
|
2021-01-04 21:06:38 +00:00
|
|
|
property int browserSearchEngine: defaultAppSettings.browserSearchEngine
|
2021-01-04 21:23:20 +00:00
|
|
|
property int browserEthereumExplorer: defaultAppSettings.browserEthereumExplorer
|
2020-11-19 15:07:52 +00:00
|
|
|
property bool autoLoadImages: defaultAppSettings.autoLoadImages
|
|
|
|
property bool javaScriptEnabled: defaultAppSettings.javaScriptEnabled
|
|
|
|
property bool errorPageEnabled: defaultAppSettings.errorPageEnabled
|
|
|
|
property bool pluginsEnabled: defaultAppSettings.pluginsEnabled
|
|
|
|
property bool autoLoadIconsForPage: defaultAppSettings.autoLoadIconsForPage
|
|
|
|
property bool touchIconsEnabled: defaultAppSettings.touchIconsEnabled
|
|
|
|
property bool webRTCPublicInterfacesOnly: defaultAppSettings.webRTCPublicInterfacesOnly
|
|
|
|
property bool devToolsEnabled: defaultAppSettings.devToolsEnabled
|
|
|
|
property bool pdfViewerEnabled: defaultAppSettings.pdfViewerEnabled
|
|
|
|
property bool compatibilityMode: defaultAppSettings.compatibilityMode
|
|
|
|
}
|
|
|
|
|
2020-09-16 14:28:03 +00:00
|
|
|
Connections {
|
|
|
|
target: profileModel
|
|
|
|
onProfileSettingsFileChanged: {
|
|
|
|
if (appSettings.locale !== "en") {
|
|
|
|
profileModel.changeLocale(appSettings.locale)
|
|
|
|
}
|
feat: whitelist gifs (no url extension needed)
Fixes #1377.
Fixes #1479.
Two sites have been added to the whitelist: giphy.com and tenor.com.
`imageUrls` in its entirety has been removed and instead all links are being handle through the message `linkUrls`. This prevents double-handling of urls that may or may not be images.
The logic to automatically show links previews works like this:
1. If the setting "display chat images" is enabled, all links that *contain* ".png", ".jpg", ".jpeg", ".svg", ".gif" will be automatically shown. If the URL doesn't contain the extension, we are not downloading it. This was meant to be somewhat of a security compromise as we do not want to download each and every link posted in a message just to find out its true content type.
2. If the above setting is *disabled*, then we follow the whitelist settings for tenor and giphy. This allows us to preview gifs that do not have a file extension in their url.
feat: bump status-go to the commit that supports the new whitelist (https://github.com/status-im/status-go/pull/2094), and also lets us get link preview data from urls in the whitelist. NOTE: this commit was branched off status-go `develop`, so once it is merged, and we update this PR to the new commit, we will effectively be getting status-go develop changes. We *could* base that status-go PR off of master if it makes things easier.
fix: height on settings update issue
feat: move date/time of message below links
fix: layout issues when changing setting `neverAskAboutUnfurlingAgain`
feat: Add MessageBorder component to aid in showing rounded corners with different radius
2020-12-11 00:53:44 +00:00
|
|
|
const whitelist = profileModel.getLinkPreviewWhitelist()
|
|
|
|
try {
|
|
|
|
const whiteListedSites = JSON.parse(whitelist)
|
|
|
|
let settingsUpdated = false
|
|
|
|
const settings = appSettings.whitelistedUnfurlingSites
|
|
|
|
const whitelistedHostnames = []
|
|
|
|
|
|
|
|
// Add whitelisted sites in to app settings that are not already there
|
|
|
|
whiteListedSites.forEach(site => {
|
|
|
|
if (!settings.hasOwnProperty(site.address)) {
|
|
|
|
settings[site.address] = false
|
|
|
|
settingsUpdated = true
|
|
|
|
}
|
|
|
|
whitelistedHostnames.push(site.address)
|
|
|
|
})
|
|
|
|
// Remove any whitelisted sites from app settings that don't exist in the
|
|
|
|
// whitelist from status-go
|
|
|
|
Object.keys(settings).forEach(settingsHostname => {
|
|
|
|
if (!whitelistedHostnames.includes(settingsHostname)) {
|
|
|
|
delete settings[settingsHostname]
|
|
|
|
settingsUpdated = true
|
|
|
|
}
|
|
|
|
})
|
|
|
|
if (settingsUpdated) {
|
|
|
|
appSettings.whitelistedUnfurlingSites = settings
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
console.error('Could not parse the whitelist for sites', e)
|
|
|
|
}
|
|
|
|
applicationWindow.settingsLoaded()
|
2020-09-16 14:28:03 +00:00
|
|
|
}
|
|
|
|
}
|
2021-01-07 14:31:07 +00:00
|
|
|
Connections {
|
|
|
|
target: profileModel
|
|
|
|
ignoreUnknownSignals: true
|
|
|
|
enabled: appSettings.removeMnemonicAfterLogin
|
|
|
|
onInitialized: {
|
|
|
|
profileModel.mnemonic.remove()
|
|
|
|
}
|
|
|
|
}
|
2020-06-23 20:49:04 +00:00
|
|
|
|
2020-05-18 15:07:30 +00:00
|
|
|
SystemTrayIcon {
|
2020-12-07 17:37:39 +00:00
|
|
|
id: systemTray
|
2020-05-18 15:07:30 +00:00
|
|
|
visible: true
|
2021-01-14 12:16:14 +00:00
|
|
|
icon.source: "shared/img/status-logo.png"
|
2020-05-18 15:07:30 +00:00
|
|
|
menu: Menu {
|
|
|
|
MenuItem {
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "Quit"
|
|
|
|
text: qsTrId("quit")
|
2020-05-18 15:07:30 +00:00
|
|
|
onTriggered: Qt.quit()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
onActivated: {
|
|
|
|
applicationWindow.show()
|
|
|
|
applicationWindow.raise()
|
|
|
|
applicationWindow.requestActivate()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-04 07:38:24 +00:00
|
|
|
DSM.StateMachine {
|
|
|
|
id: stateMachine
|
|
|
|
initialState: onboardingState
|
|
|
|
running: true
|
|
|
|
|
|
|
|
DSM.State {
|
|
|
|
id: onboardingState
|
2021-01-06 13:11:26 +00:00
|
|
|
initialState: hasAccounts ? stateLogin : keysMainState
|
2020-06-04 07:38:24 +00:00
|
|
|
|
|
|
|
DSM.State {
|
|
|
|
id: stateIntro
|
|
|
|
onEntered: loader.sourceComponent = intro
|
|
|
|
}
|
|
|
|
|
|
|
|
DSM.State {
|
|
|
|
id: keysMainState
|
|
|
|
onEntered: loader.sourceComponent = keysMain
|
|
|
|
|
|
|
|
DSM.SignalTransition {
|
|
|
|
targetState: genKeyState
|
|
|
|
signal: applicationWindow.navigateTo
|
|
|
|
guard: path === "GenKey"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DSM.State {
|
|
|
|
id: existingKeyState
|
|
|
|
onEntered: loader.sourceComponent = existingKey
|
|
|
|
|
|
|
|
DSM.SignalTransition {
|
|
|
|
targetState: appState
|
|
|
|
signal: onboardingModel.loginResponseChanged
|
|
|
|
guard: !error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DSM.State {
|
|
|
|
id: genKeyState
|
|
|
|
onEntered: loader.sourceComponent = genKey
|
|
|
|
|
|
|
|
DSM.SignalTransition {
|
|
|
|
targetState: appState
|
|
|
|
signal: onboardingModel.loginResponseChanged
|
|
|
|
guard: !error
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DSM.State {
|
|
|
|
id: stateLogin
|
|
|
|
onEntered: loader.sourceComponent = login
|
|
|
|
|
|
|
|
DSM.SignalTransition {
|
|
|
|
targetState: appState
|
|
|
|
signal: loginModel.loginResponseChanged
|
|
|
|
guard: !error
|
|
|
|
}
|
|
|
|
|
|
|
|
DSM.SignalTransition {
|
|
|
|
targetState: genKeyState
|
|
|
|
signal: applicationWindow.navigateTo
|
|
|
|
guard: path === "GenKey"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-12 20:47:44 +00:00
|
|
|
DSM.SignalTransition {
|
2020-07-01 15:37:36 +00:00
|
|
|
targetState: hasAccounts ? stateLogin : stateIntro
|
2020-06-12 20:47:44 +00:00
|
|
|
signal: applicationWindow.navigateTo
|
|
|
|
guard: path === "InitialState"
|
|
|
|
}
|
|
|
|
|
|
|
|
DSM.SignalTransition {
|
|
|
|
targetState: existingKeyState
|
|
|
|
signal: applicationWindow.navigateTo
|
|
|
|
guard: path === "ExistingKey"
|
|
|
|
}
|
|
|
|
|
2020-07-01 15:37:36 +00:00
|
|
|
DSM.SignalTransition {
|
|
|
|
targetState: keysMainState
|
|
|
|
signal: applicationWindow.navigateTo
|
|
|
|
guard: path === "KeysMain"
|
|
|
|
}
|
|
|
|
|
2020-06-04 07:38:24 +00:00
|
|
|
DSM.FinalState {
|
|
|
|
id: onboardingDoneState
|
|
|
|
}
|
|
|
|
}
|
2020-09-22 15:12:48 +00:00
|
|
|
|
2020-06-04 07:38:24 +00:00
|
|
|
DSM.State {
|
|
|
|
id: appState
|
|
|
|
onEntered: loader.sourceComponent = app
|
|
|
|
|
|
|
|
DSM.SignalTransition {
|
|
|
|
targetState: stateLogin
|
|
|
|
signal: loginModel.onLoggedOut
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: loader
|
2020-05-18 15:07:30 +00:00
|
|
|
anchors.fill: parent
|
2020-05-19 13:22:38 +00:00
|
|
|
}
|
2020-05-18 15:07:30 +00:00
|
|
|
|
2020-06-04 07:38:24 +00:00
|
|
|
Component {
|
2020-05-19 13:22:38 +00:00
|
|
|
id: app
|
2020-09-15 19:47:13 +00:00
|
|
|
AppMain {}
|
2020-06-04 07:38:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: intro
|
|
|
|
Intro {
|
|
|
|
btnGetStarted.onClicked: applicationWindow.navigateTo("KeysMain")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: keysMain
|
|
|
|
KeysMain {
|
|
|
|
btnGenKey.onClicked: applicationWindow.navigateTo("GenKey")
|
|
|
|
btnExistingKey.onClicked: applicationWindow.navigateTo("ExistingKey")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: existingKey
|
2020-06-12 20:47:44 +00:00
|
|
|
ExistingKey {
|
|
|
|
onClosed: function () {
|
2021-01-07 14:31:07 +00:00
|
|
|
appSettings.removeMnemonicAfterLogin = false
|
2020-07-01 15:37:36 +00:00
|
|
|
if (hasAccounts) {
|
|
|
|
applicationWindow.navigateTo("InitialState")
|
|
|
|
} else {
|
|
|
|
applicationWindow.navigateTo("KeysMain")
|
|
|
|
}
|
2020-06-12 20:47:44 +00:00
|
|
|
}
|
|
|
|
}
|
2020-06-04 07:38:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: genKey
|
|
|
|
GenKey {
|
2020-06-13 15:17:54 +00:00
|
|
|
onClosed: function () {
|
2020-07-01 15:37:36 +00:00
|
|
|
if (hasAccounts) {
|
|
|
|
applicationWindow.navigateTo("InitialState")
|
|
|
|
} else {
|
|
|
|
applicationWindow.navigateTo("KeysMain")
|
|
|
|
}
|
2020-06-13 15:17:54 +00:00
|
|
|
}
|
2020-06-04 07:38:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: login
|
|
|
|
Login {
|
2020-06-12 20:47:44 +00:00
|
|
|
onGenKeyClicked: function () {
|
|
|
|
applicationWindow.navigateTo("GenKey")
|
|
|
|
}
|
|
|
|
onExistingKeyClicked: function () {
|
|
|
|
applicationWindow.navigateTo("ExistingKey")
|
|
|
|
}
|
2020-06-04 07:38:24 +00:00
|
|
|
}
|
2020-05-11 21:24:08 +00:00
|
|
|
}
|
2020-07-10 21:47:31 +00:00
|
|
|
|
|
|
|
NotificationWindow {
|
|
|
|
id: notificationWindow
|
|
|
|
}
|
2020-05-11 21:24:08 +00:00
|
|
|
}
|
2020-07-01 17:35:57 +00:00
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
|
|
|
D{i:0;formeditorZoom:0.5}
|
|
|
|
}
|
|
|
|
##^##*/
|