refactor: remove dynamic scoping from profile module

closes #4247
This commit is contained in:
Khushboo Mehta 2021-12-09 14:28:02 +01:00 committed by Sale Djenic
parent ad93b9d92b
commit 1977420db2
25 changed files with 178 additions and 162 deletions

View File

@ -12,15 +12,22 @@ import "views"
import StatusQ.Layout 0.1 import StatusQ.Layout 0.1
StatusAppTwoPanelLayout { StatusAppTwoPanelLayout {
id: profileView id: profileView
property RootStore store
property var globalStore
property int contentMaxWidth: 624
property int contentMinWidth: 450
property alias changeProfileSection: leftTab.changeProfileSection property alias changeProfileSection: leftTab.changeProfileSection
property RootStore store: RootStore { }
property var globalStore
property var systemPalette
property bool networkGuarded: false
QtObject {
id: _internal
readonly property int contentMaxWidth: 624
readonly property int contentMinWidth: 450
property int profileContentWidth: Math.max(contentMinWidth, Math.min(profileContainer.width * 0.8, contentMaxWidth))
}
leftPanel: LeftTabView { leftPanel: LeftTabView {
id: leftTab id: leftTab
store: profileView.store store: profileView.store
@ -29,7 +36,7 @@ StatusAppTwoPanelLayout {
rightPanel: StackLayout { rightPanel: StackLayout {
id: profileContainer id: profileContainer
property int profileContentWidth: Math.max(contentMinWidth, Math.min(profileContainer.width * 0.8, contentMaxWidth))
anchors.fill: parent anchors.fill: parent
currentIndex: Global.currentMenuTab currentIndex: Global.currentMenuTab
@ -42,39 +49,51 @@ StatusAppTwoPanelLayout {
MyProfileView { MyProfileView {
store: profileView.store store: profileView.store
profileContentWidth: _internal.profileContentWidth
} }
ContactsView { ContactsView {
store: profileView.store store: profileView.store
profileContentWidth: _internal.profileContentWidth
} }
EnsView { EnsView {
id: ensContainer id: ensContainer
store: profileView.store store: profileView.store
messageStore: profileView.globalStore.messageStore messageStore: profileView.globalStore.messageStore
networkGuarded: profileView.networkGuarded
profileContentWidth: _internal.profileContentWidth
} }
PrivacyView { PrivacyView {
store: profileView.store store: profileView.store
profileContentWidth: _internal.profileContentWidth
} }
AppearanceView { AppearanceView {
store: profileView.store store: profileView.store
globalStore: profileView.globalStore globalStore: profileView.globalStore
profileContentWidth: _internal.profileContentWidth
systemPalette: profileView.systemPalette
} }
SoundsView {} SoundsView {
profileContentWidth: _internal.profileContentWidth
}
LanguageView { LanguageView {
store: profileView.store store: profileView.store
profileContentWidth: _internal.profileContentWidth
} }
NotificationsView { NotificationsView {
store: profileView.store store: profileView.store
profileContentWidth: _internal.profileContentWidth
} }
SyncView { SyncView {
store: profileView.store store: profileView.store
profileContentWidth: _internal.profileContentWidth
} }
DevicesView { DevicesView {
@ -83,16 +102,21 @@ StatusAppTwoPanelLayout {
BrowserView { BrowserView {
store: profileView.store store: profileView.store
profileContentWidth: _internal.profileContentWidth
} }
AdvancedView { AdvancedView {
store: profileView.store store: profileView.store
profileContentWidth: _internal.profileContentWidth
} }
HelpView {} HelpView {
profileContentWidth: _internal.profileContentWidth
}
AboutView { AboutView {
store: profileView.store store: profileView.store
profileContentWidth: _internal.profileContentWidth
} }
} }
} }

View File

@ -1,15 +1,16 @@
import QtQuick 2.13 import QtQuick 2.13
import QtQuick.Controls 2.13 import QtQuick.Controls 2.13
import utils 1.0 import StatusQ.Controls 0.1
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1 as StatusQControls
import shared 1.0
import shared.panels 1.0 import shared.panels 1.0
import shared.popups 1.0 import shared.popups 1.0
import shared.status 1.0 import shared.status 1.0
import utils 1.0
// TODO: replace with StatusModal // TODO: replace with StatusModal
ModalPopup { ModalPopup {
id: popup id: popup
@ -45,7 +46,7 @@ ModalPopup {
text: qsTrId("websites") text: qsTrId("websites")
width: parent.width width: parent.width
StatusQControls.StatusFlatButton { StatusFlatButton {
//% "Enable all" //% "Enable all"
text: qsTrId("enable-all") text: qsTrId("enable-all")
anchors.right: parent.right anchors.right: parent.right
@ -64,7 +65,7 @@ ModalPopup {
} }
Connections { Connections {
target: appMain target: Global
onSettingsLoaded: { onSettingsLoaded: {
popup.populatePreviewableSites() popup.populatePreviewableSites()
} }
@ -149,9 +150,10 @@ ModalPopup {
} }
} }
StyledText { StatusBaseText {
id: siteTitle id: siteTitle
text: title text: title
color: Theme.palette.directColor1
font.pixelSize: 15 font.pixelSize: 15
font.weight: Font.Medium font.weight: Font.Medium
anchors.top: thumbnail.top anchors.top: thumbnail.top
@ -159,7 +161,7 @@ ModalPopup {
anchors.leftMargin: Style.current.padding anchors.leftMargin: Style.current.padding
} }
StyledText { StatusBaseText {
text: address text: address
font.pixelSize: 15 font.pixelSize: 15
font.weight: Font.Thin font.weight: Font.Thin
@ -168,7 +170,7 @@ ModalPopup {
anchors.left: siteTitle.left anchors.left: siteTitle.left
} }
StatusQControls.StatusSwitch { StatusSwitch {
id: settingSwitch id: settingSwitch
checked: !!isWhitelisted checked: !!isWhitelisted
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -203,7 +205,7 @@ ModalPopup {
} }
} }
StyledText { StatusBaseText {
id: infoText id: infoText
//% "Previewing links from these websites may share your metadata with their owners." //% "Previewing links from these websites may share your metadata with their owners."
text: qsTrId("previewing-links-from-these-websites-may-share-your-metadata-with-their-owners-") text: qsTrId("previewing-links-from-these-websites-may-share-your-metadata-with-their-owners-")
@ -216,9 +218,3 @@ ModalPopup {
} }
} }
} }
/*##^##
Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/

View File

@ -44,15 +44,9 @@ ModalPopup {
model: root.store.dappList model: root.store.dappList
delegate: Dapp { delegate: Dapp {
name: model.name name: model.name
onDappClicked: permissionListPopup.createObject(appMain, {dapp: dapp}).open() onDappClicked: Global.openPopup(permissionListPopup, {dapp: dapp})
} }
} }
} }
} }
} }
/*##^##
Designer {
D{i:0;height:300;width:300}
}
##^##*/

View File

@ -2,15 +2,12 @@ import QtQuick 2.13
import QtQuick.Controls 2.13 import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13 import QtQuick.Layouts 1.13
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1 import StatusQ.Controls 0.1
import utils 1.0
import shared 1.0
import shared.popups 1.0 import shared.popups 1.0
import "./" import utils 1.0
import "../panels" import "../panels"
// TODO: replace with StatusModal // TODO: replace with StatusModal
@ -63,7 +60,7 @@ ModalPopup {
footer: StatusButton { footer: StatusButton {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
type: StatusBaseButton.type.Danger type: StatusBaseButton.Type.Danger
//% "Revoke all access" //% "Revoke all access"
text: qsTrId("revoke-all-access") text: qsTrId("revoke-all-access")
onClicked: { onClicked: {
@ -73,9 +70,3 @@ ModalPopup {
} }
} }
} }
/*##^##
Designer {
D{i:0;height:300;width:300}
}
##^##*/

View File

@ -6,6 +6,8 @@ import utils 1.0
import shared.popups 1.0 import shared.popups 1.0
import shared.controls 1.0 import shared.controls 1.0
import "../../Onboarding/shared" as OnboardingComponents
// TODO: replace with StatusModal // TODO: replace with StatusModal
ModalPopup { ModalPopup {
id: popup id: popup
@ -89,5 +91,13 @@ ModalPopup {
} }
} }
} }
Component {
id: storePasswordModal
OnboardingComponents.CreatePasswordModal {
storingPasswordModal: true
height: 350
}
}
} }
} }

View File

@ -16,13 +16,14 @@ Item {
clip: true clip: true
property var store property var store
property int profileContentWidth
Column { Column {
id: generalColumn id: generalColumn
spacing: Style.current.bigPadding spacing: Style.current.bigPadding
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 46 anchors.topMargin: 46
width: profileContainer.profileContentWidth width: profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
// TODO: replace with StatusListItem // TODO: replace with StatusListItem
@ -59,7 +60,7 @@ Item {
} }
onClicked: { onClicked: {
root.store.checkForUpdates(); root.store.checkForUpdates();
Global.openPopup(downloadModalComponent, {newVersionAvailable: newVersionJSON.available, downloadURL: newVersionJSON.url}) Global.openDownloadModal()
} }
} }
} }
@ -87,9 +88,3 @@ Item {
} }
} }
} }
/*##^##
Designer {
D{i:0;height:600;width:800}
}
##^##*/

View File

@ -15,17 +15,19 @@ import "../panels"
ScrollView { ScrollView {
id: root id: root
property bool isWakuV2: store.fleet == Constants.waku_prod || store.fleet === Constants.waku_test
property var store
property int profileContentWidth
height: parent.height height: parent.height
width: parent.width width: parent.width
contentHeight: advancedContainer.height + 100 contentHeight: advancedContainer.height + 100
clip: true clip: true
property bool isWakuV2: store.fleet == Constants.waku_prod || store.fleet === Constants.waku_test
property var store
Item { Item {
id: advancedContainer id: advancedContainer
width: profileContainer.profileContentWidth width: profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
height: generalColumn.height height: generalColumn.height
@ -524,9 +526,3 @@ ScrollView {
} }
} }
} }
/*##^##
Designer {
D{i:0;height:400;width:700}
}
##^##*/

View File

@ -16,13 +16,12 @@ import StatusQ.Controls 0.1 as StatusQ
import "../popups" import "../popups"
ScrollView { ScrollView {
height: parent.height id: appearanceView
width: parent.width
id: root property var systemPalette
contentHeight: appearanceContainer.height
clip: true
property var store property var store
property var globalStore property var globalStore
property int profileContentWidth
enum Theme { enum Theme {
Light, Light,
@ -39,9 +38,14 @@ ScrollView {
Style.changeFontSize(fontSize) Style.changeFontSize(fontSize)
} }
height: parent.height
width: parent.width
contentHeight: appearanceContainer.height
clip: true
Item { Item {
id: appearanceContainer id: appearanceContainer
width: profileContainer.profileContentWidth width: profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
height: this.childrenRect.height + 100 height: this.childrenRect.height + 100
@ -82,8 +86,8 @@ ScrollView {
anchors.topMargin: Style.current.padding*2 anchors.topMargin: Style.current.padding*2
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: Style.current.smallPadding anchors.leftMargin: Style.current.smallPadding
// rootStore: root.rootStore // rootStore: appearanceView.rootStore
// messageStore: root.globalStore.messageStore // messageStore: appearanceView.globalStore.messageStore
///////////TODO Remove ///////////TODO Remove
// userName: "@vitalik" // userName: "@vitalik"
// identicon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAb0lEQVR4Ae3UQQqAIBRF0Wj9ba9Bq6l5JBQqfn/ngDMH3YS3AAB/tO3H+XRG3b9bR/+gVoREI2RapVXpfd5+X5oXERKNkHS+rk3tOpWkeREh0QiZVu91ql2zNC8iJBoh0yqtSqt1slpCghICANDPBc0ESPh0bHkHAAAAAElFTkSuQmCC" // identicon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAb0lEQVR4Ae3UQQqAIBRF0Wj9ba9Bq6l5JBQqfn/ngDMH3YS3AAB/tO3H+XRG3b9bR/+gVoREI2RapVXpfd5+X5oXERKNkHS+rk3tOpWkeREh0QiZVu91ql2zNC8iJBoh0yqtSqt1slpCghICANDPBc0ESPh0bHkHAAAAAElFTkSuQmCC"
@ -135,7 +139,7 @@ ScrollView {
value: localAccountSensitiveSettings.fontSize value: localAccountSensitiveSettings.fontSize
onValueChanged: { onValueChanged: {
localAccountSensitiveSettings.fontSize = value localAccountSensitiveSettings.fontSize = value
root.updateFontSize(value) appearanceView.updateFontSize(value)
} }
RowLayout { RowLayout {
@ -214,7 +218,7 @@ ScrollView {
StatusQ.StatusSlider { StatusQ.StatusSlider {
id: zoomSlider id: zoomSlider
readonly property int initialValue: { readonly property int initialValue: {
let scaleFactorStr = root.store.readTextFile(uiScaleFilePath) let scaleFactorStr = appearanceView.store.readTextFile(uiScaleFilePath)
if (scaleFactorStr === "") { if (scaleFactorStr === "") {
return 100 return 100
} }
@ -234,7 +238,7 @@ ScrollView {
value: initialValue value: initialValue
onValueChanged: { onValueChanged: {
if (value !== initialValue) { if (value !== initialValue) {
root.store.writeTextFile(uiScaleFilePath, value / 100.0) appearanceView.store.writeTextFile(uiScaleFilePath, value / 100.0)
} }
} }
onPressedChanged: { onPressedChanged: {
@ -328,7 +332,7 @@ ScrollView {
control.checked: localAppSettings.theme === Universal.Light control.checked: localAppSettings.theme === Universal.Light
onRadioCheckedChanged: { onRadioCheckedChanged: {
if (checked) { if (checked) {
root.updateTheme(Universal.Light) appearanceView.updateTheme(Universal.Light)
} }
} }
} }
@ -344,7 +348,7 @@ ScrollView {
control.checked: localAppSettings.theme === Universal.Dark control.checked: localAppSettings.theme === Universal.Dark
onRadioCheckedChanged: { onRadioCheckedChanged: {
if (checked) { if (checked) {
root.updateTheme(Universal.Dark) appearanceView.updateTheme(Universal.Dark)
} }
} }
} }
@ -360,7 +364,7 @@ ScrollView {
control.checked: localAppSettings.theme === Universal.System control.checked: localAppSettings.theme === Universal.System
onRadioCheckedChanged: { onRadioCheckedChanged: {
if (checked) { if (checked) {
root.updateTheme(Universal.System) appearanceView.updateTheme(Universal.System)
} }
} }
} }

View File

@ -20,6 +20,7 @@ Item {
clip: true clip: true
property var store property var store
property int profileContentWidth
property Component dappListPopup: DappList { property Component dappListPopup: DappList {
store: root.store store: root.store
@ -33,7 +34,7 @@ Item {
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 64 anchors.topMargin: 64
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
width: profileContainer.profileContentWidth width: profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
@ -139,9 +140,3 @@ Item {
} }
} }
} }
/*##^##
Designer {
D{i:0;height:400;width:700}
}
##^##*/

View File

@ -20,6 +20,7 @@ Item {
id: root id: root
property var store property var store
property int profileContentWidth
property alias searchStr: searchBox.text property alias searchStr: searchBox.text
property bool isPending: false property bool isPending: false
@ -31,7 +32,7 @@ Item {
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 32 anchors.topMargin: 32
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
width: profileContainer.profileContentWidth width: profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter

View File

@ -21,6 +21,7 @@ Item {
signal selectEns(string username) signal selectEns(string username)
property var store property var store
property int profileContentWidth
// Defaults to show message // Defaults to show message
property bool isMessage: true property bool isMessage: true
@ -45,7 +46,7 @@ Item {
Item { Item {
anchors.top: parent.top anchors.top: parent.top
width: profileContainer.profileContentWidth width: profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
Component { Component {

View File

@ -16,6 +16,7 @@ Item {
id: root id: root
property var store property var store
property int profileContentWidth
signal continueClicked(string output, string username) signal continueClicked(string output, string username)
signal usernameUpdated(username: string); signal usernameUpdated(username: string);
@ -89,7 +90,7 @@ Item {
Item { Item {
id: ensContainer id: ensContainer
anchors.top: parent.top anchors.top: parent.top
width: profileContainer.profileContentWidth width: profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
Rectangle { Rectangle {

View File

@ -5,43 +5,40 @@ import QtQml.StateMachine 1.14 as DSM
import utils 1.0 import utils 1.0
import shared 1.0 import shared 1.0
/* import "./Ens" */
import "../stores" import "../stores"
import "."
Item { Item {
id: root id: ensView
Layout.fillHeight: true
Layout.fillWidth: true
clip: true
property var store property var store
property var messageStore
property bool networkGuarded: false
property int profileContentWidth
property bool showSearchScreen: false property bool showSearchScreen: false
property string addedUsername: "" property string addedUsername: ""
property string selectedUsername: "" property string selectedUsername: ""
property var messageStore
signal next(output: string) signal next(output: string)
signal back() signal back()
signal done(ensUsername: string) signal done(ensUsername: string)
signal connect(ensUsername: string) signal connect(ensUsername: string)
signal changePubKey(ensUsername: string) signal changePubKey(ensUsername: string)
signal goToWelcome(); signal goToWelcome();
signal goToList(); signal goToList();
function goToStart(){ function goToStart(){
if(root.store.ens.rowCount() > 0 && networkGuarded){ if(ensView.store.ens.rowCount() > 0 && networkGuarded){
goToList(); goToList();
} else { } else {
goToWelcome(); goToWelcome();
} }
} }
Layout.fillHeight: true
Layout.fillWidth: true
clip: true
DSM.StateMachine { DSM.StateMachine {
id: stateMachine id: stateMachine
initialState: welcomeState initialState: welcomeState
@ -215,15 +212,18 @@ Item {
Component { Component {
id: welcome id: welcome
EnsWelcomeView { EnsWelcomeView {
username: root.store.username username: ensView.store.username
onStartBtnClicked: next(null) onStartBtnClicked: next(null)
networkGuarded: ensView.networkGuarded
profileContentWidth: ensView.profileContentWidth
} }
} }
Component { Component {
id: search id: search
EnsSearchView { EnsSearchView {
store: root.store store: ensView.store
profileContentWidth: ensView.profileContentWidth
onContinueClicked: { onContinueClicked: {
if(output === "connected"){ if(output === "connected"){
connect(username) connect(username)
@ -242,7 +242,7 @@ Item {
Component { Component {
id: termsAndConditions id: termsAndConditions
EnsTermsAndConditionsView { EnsTermsAndConditionsView {
store: root.store store: ensView.store
username: selectedUsername username: selectedUsername
onBackBtnClicked: back(); onBackBtnClicked: back();
onUsernameRegistered: done(userName); onUsernameRegistered: done(userName);
@ -283,11 +283,12 @@ Item {
Component { Component {
id: list id: list
EnsListView { EnsListView {
store: root.store store: ensView.store
messageStore: ensContainer.messageStore messageStore: ensView.messageStore
profileContentWidth: ensView.profileContentWidth
onAddBtnClicked: next("search") onAddBtnClicked: next("search")
onSelectEns: { onSelectEns: {
root.store.ensDetails(username) ensView.store.ensDetails(username)
selectedUsername = username; selectedUsername = username;
next("details") next("details")
} }
@ -297,7 +298,7 @@ Item {
Component { Component {
id: details id: details
EnsDetailsView { EnsDetailsView {
store: root.store store: ensView.store
username: selectedUsername username: selectedUsername
onBackBtnClicked: back(); onBackBtnClicked: back();
onUsernameReleased: { onUsernameReleased: {
@ -308,21 +309,21 @@ Item {
} }
Connections { Connections {
target: root target: ensView
onConnect: { onConnect: {
addedUsername = ensUsername; addedUsername = ensUsername;
} }
} }
Connections { Connections {
target: root.store.ens target: ensView.store.ens
onTransactionWasSent: { onTransactionWasSent: {
//% "Transaction pending..." //% "Transaction pending..."
toastMessage.title = qsTrId("ens-transaction-pending") toastMessage.title = qsTrId("ens-transaction-pending")
toastMessage.source = Style.svg("loading") toastMessage.source = Style.svg("loading")
toastMessage.iconColor = Style.current.primary toastMessage.iconColor = Style.current.primary
toastMessage.iconRotates = true toastMessage.iconRotates = true
toastMessage.link = `${root.store.etherscanLink}/${txResult}` toastMessage.link = `${ensView.store.etherscanLink}/${txResult}`
toastMessage.open() toastMessage.open()
} }
onTransactionCompleted: { onTransactionCompleted: {
@ -353,7 +354,7 @@ Item {
toastMessage.iconColor = Style.current.danger toastMessage.iconColor = Style.current.danger
} }
toastMessage.link = `${root.store.etherscanLink}/${txHash}` toastMessage.link = `${ensView.store.etherscanLink}/${txHash}`
toastMessage.open() toastMessage.open()
} }
} }

View File

@ -10,9 +10,12 @@ import utils 1.0
Item { Item {
id: root id: root
signal startBtnClicked() signal startBtnClicked()
property string username: "" property string username: ""
property int profileContentWidth
property bool networkGuarded: false
ScrollView { ScrollView {
id: sview id: sview
@ -28,7 +31,7 @@ Item {
Item { Item {
id: contentItem id: contentItem
width: profileContainer.profileContentWidth width: profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
Image { Image {

View File

@ -14,6 +14,9 @@ import "../panels"
Item { Item {
id: helpContainer id: helpContainer
property int profileContentWidth
height: parent.height height: parent.height
Layout.fillWidth: true Layout.fillWidth: true
clip: true clip: true
@ -27,7 +30,7 @@ Item {
id: glossary id: glossary
anchors.top: parent.top anchors.top: parent.top
height: this.childrenRect.height height: this.childrenRect.height
width: profileContainer.profileContentWidth width: profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
@ -134,7 +137,7 @@ Item {
anchors.top: glossary.bottom anchors.top: glossary.bottom
anchors.topMargin: Style.current.bigPadding * 2 anchors.topMargin: Style.current.bigPadding * 2
height: this.childrenRect.height height: this.childrenRect.height
width: profileContainer.profileContentWidth width: profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter

View File

@ -17,6 +17,7 @@ Item {
clip: true clip: true
property var store property var store
property int profileContentWidth
property Component languagePopup: LanguageModal { property Component languagePopup: LanguageModal {
store: languageContainer.store store: languageContainer.store
} }
@ -25,7 +26,7 @@ Item {
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 64 anchors.topMargin: 64
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
width: profileContainer.profileContentWidth width: profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter

View File

@ -18,6 +18,7 @@ Item {
id: root id: root
property var store property var store
property int profileContentWidth
property string ensName: store.preferredUsername || store.firstEnsUsername || "" property string ensName: store.preferredUsername || store.firstEnsUsername || ""
property string username: store.username property string username: store.username
@ -45,7 +46,7 @@ Item {
id: profileImgNameContainer id: profileImgNameContainer
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 64 anchors.topMargin: 64
width: profileContainer.profileContentWidth width: profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter

View File

@ -18,16 +18,18 @@ import "./"
ScrollView { ScrollView {
id: root id: root
property var store
property int profileContentWidth
height: parent.height height: parent.height
width: parent.width width: parent.width
contentHeight: notificationsContainer.height contentHeight: notificationsContainer.height
clip: true clip: true
property var store
Item { Item {
id: notificationsContainer id: notificationsContainer
width: profileContainer.profileContentWidth width: profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
height: this.childrenRect.height + 100 height: this.childrenRect.height + 100

View File

@ -6,7 +6,6 @@ import QtGraphicalEffects 1.13
import utils 1.0 import utils 1.0
import shared.panels 1.0 import shared.panels 1.0
import shared.status 1.0 import shared.status 1.0
import "../../Onboarding/shared" as OnboardingComponents
import StatusQ.Core 0.1 import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1 import StatusQ.Core.Theme 0.1
@ -22,12 +21,13 @@ Item {
clip: true clip: true
property var store property var store
property int profileContentWidth
Column { Column {
id: containerColumn id: containerColumn
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 64 anchors.topMargin: 64
width: profileContainer.profileContentWidth width: profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
@ -107,14 +107,6 @@ Item {
] ]
sensor.onClicked: Global.openPopup(storeToKeychainSelectionModal) sensor.onClicked: Global.openPopup(storeToKeychainSelectionModal)
Component {
id: storePasswordModal
OnboardingComponents.CreatePasswordModal {
storingPasswordModal: true
height: 350
}
}
Component { Component {
id: storeToKeychainSelectionModal id: storeToKeychainSelectionModal
StoreToKeychainSelectionModal {} StoreToKeychainSelectionModal {}
@ -128,8 +120,7 @@ Item {
ChangePasswordModal { ChangePasswordModal {
id: changePasswordModal id: changePasswordModal
anchors.centerIn: parent anchors.centerIn: parent
successPopup: successPopup
onPasswordChanged: successPopup.open()
} }
ChangePasswordSuccessModal { ChangePasswordSuccessModal {
@ -167,15 +158,10 @@ Item {
StatusQControls.StatusSwitch { StatusQControls.StatusSwitch {
id: switch1 id: switch1
checked: !localAccountSensitiveSettings.onlyShowContactsProfilePics checked: !localAccountSensitiveSettings.onlyShowContactsProfilePics
onCheckedChanged: {
if (localAccountSensitiveSettings.onlyShowContactsProfilePics !== !checked) {
localAccountSensitiveSettings.onlyShowContactsProfilePics = !checked
}
}
} }
] ]
sensor.onClicked: { sensor.onClicked: {
switch1.checked = !switch1.checked switch1.checked = localAccountSensitiveSettings.onlyShowContactsProfilePics = !switch1.checked
} }
} }
@ -189,17 +175,12 @@ Item {
implicitHeight: 52 implicitHeight: 52
components: [ components: [
StatusQControls.StatusSwitch { StatusQControls.StatusSwitch {
id: switch2 id: switch2
checked: localAccountSensitiveSettings.displayChatImages checked: localAccountSensitiveSettings.displayChatImages
onCheckedChanged: {
if (localAccountSensitiveSettings.displayChatImages !== checked) {
localAccountSensitiveSettings.displayChatImages !== checked
}
}
} }
] ]
sensor.onClicked: { sensor.onClicked: {
switch2.checked = !switch2.checked switch2.checked = localAccountSensitiveSettings.displayChatImages = !switch2.checked
} }
} }
@ -274,22 +255,11 @@ Item {
StatusQControls.StatusSwitch { StatusQControls.StatusSwitch {
id: switch3 id: switch3
checked: !root.store.messagesFromContactsOnly checked: !root.store.messagesFromContactsOnly
onCheckedChanged: {
if (root.store.messagesFromContactsOnly !== !checked) {
root.store.messagesFromContactsOnly = !checked
}
}
} }
] ]
sensor.onClicked: { sensor.onClicked: {
switch3.checked = !switch3.checked root.store.setMessagesFromContactsOnly(!switch3.checked)
} }
} }
} }
} }
/*##^##
Designer {
D{i:0;autoSize:true;formeditorColor:"#ffffff";height:480;width:640}
}
##^##*/

View File

@ -10,12 +10,16 @@ import StatusQ.Controls 0.1
Item { Item {
id: soundsContainer id: soundsContainer
property var store
property int profileContentWidth
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
clip: true clip: true
Item { Item {
width: profileContainer.profileContentWidth width: profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter

View File

@ -13,10 +13,13 @@ import shared.controls 1.0
Item { Item {
id: root id: root
Layout.fillHeight: true
Layout.fillWidth: true
property var store property var store
property string activeMailserver: "" property string activeMailserver: ""
property int profileContentWidth
Layout.fillHeight: true
Layout.fillWidth: true
Connections { Connections {
target: root.store.mailservers target: root.store.mailservers
@ -27,7 +30,7 @@ Item {
} }
Item { Item {
width: profileContainer.profileContentWidth width: profileContentWidth
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter

View File

@ -32,6 +32,8 @@ Item {
anchors.fill: parent anchors.fill: parent
property alias appLayout: appLayout property alias appLayout: appLayout
// set from main.qml
property var sysPalette
// Not Refactored Yet // Not Refactored Yet
property var newVersionJSON: "" //JSON.parse(utilsModel.newVersion) property var newVersionJSON: "" //JSON.parse(utilsModel.newVersion)
property bool profilePopupOpened: false property bool profilePopupOpened: false
@ -39,7 +41,6 @@ Item {
// property bool networkGuarded: profileModel.network.current === Constants.networkMainnet || (profileModel.network.current === Constants.networkRopsten && localAccountSensitiveSettings.stickersEnsRopsten) // property bool networkGuarded: profileModel.network.current === Constants.networkMainnet || (profileModel.network.current === Constants.networkRopsten && localAccountSensitiveSettings.stickersEnsRopsten)
property RootStore rootStore: RootStore { } property RootStore rootStore: RootStore { }
signal settingsLoaded()
signal openContactsPopup() signal openContactsPopup()
Connections { Connections {
@ -55,6 +56,11 @@ Item {
popup.open(); popup.open();
return popup; return popup;
} }
onOpenDownloadModalRequested: {
const popup = downloadModalComponent.createObject(appMain, {newVersionAvailable: newVersionJSON.available, downloadURL: newVersionJSON.url})
popup.open()
return popup
}
} }
function changeAppSectionBySectionId(sectionId) { function changeAppSectionBySectionId(sectionId) {
@ -170,7 +176,7 @@ Item {
text: qsTr("A new version of Status (%1) is available").arg(newVersionJSON.version) text: qsTr("A new version of Status (%1) is available").arg(newVersionJSON.version)
btnText: qsTr("Download") btnText: qsTr("Download")
onClick: function(){ onClick: function(){
Global.openPopup(downloadModalComponent, {newVersionAvailable: newVersionJSON.available, downloadURL: newVersionJSON.url}) Global.openDownloadModal()
} }
} }
@ -467,6 +473,8 @@ Item {
Layout.alignment: Qt.AlignLeft | Qt.AlignTop Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.fillHeight: true Layout.fillHeight: true
globalStore: appMain.rootStore globalStore: appMain.rootStore
systemPalette: appMain.sysPalette
networkGuarded: appMain.networkGuarded
} }
NodeLayout { NodeLayout {
@ -815,6 +823,6 @@ Item {
// } catch (e) { // } catch (e) {
// console.error('Could not parse the whitelist for sites', e) // console.error('Could not parse the whitelist for sites', e)
// } // }
appMain.settingsLoaded() Global.settingsHasLoaded()
} }
} }

View File

@ -182,7 +182,7 @@ Popup {
Connections { Connections {
id: connectionSettings id: connectionSettings
target: appMain target: Global
onSettingsLoaded: { onSettingsLoaded: {
connectionSettings.enabled = false connectionSettings.enabled = false
// Add recent // Add recent

View File

@ -14,6 +14,12 @@ QtObject {
signal openLinkInBrowser(string link) signal openLinkInBrowser(string link)
signal openChooseBrowserPopup(string link) signal openChooseBrowserPopup(string link)
signal openPopupRequested(var popupComponent, var params) signal openPopupRequested(var popupComponent, var params)
signal openDownloadModalRequested()
signal settingsLoaded()
function openDownloadModal(){
openDownloadModalRequested()
}
function openPopup(popupComponent, params = {}) { function openPopup(popupComponent, params = {}) {
root.openPopupRequested(popupComponent, params); root.openPopupRequested(popupComponent, params);
@ -39,4 +45,8 @@ QtObject {
function playErrorSound() { function playErrorSound() {
errorSound.play(); errorSound.play();
} }
function settingsHasLoaded() {
settingsLoaded()
}
} }

View File

@ -504,7 +504,9 @@ StatusWindow {
Component { Component {
id: app id: app
AppMain {} AppMain {
sysPalette: systemPalette
}
} }
Component { Component {