refactor(@desktop/profile): introduce new QML and store structure in profile section

Closes #3712
This commit is contained in:
Pascal Precht 2021-10-06 11:16:39 +02:00 committed by Iuri Matias
parent 4c55ad26bb
commit 4e8f2303e6
74 changed files with 1634 additions and 1052 deletions

View File

@ -5,7 +5,6 @@ import utils 1.0
import "../../../../shared"
import "../../../../shared/status"
import "../../Chat/ChatColumn/ChatComponents"
import "../../Profile/LeftTab/constants.js" as ProfileConstants
PopupMenu {
property var addNewTab: function () {}
@ -114,7 +113,9 @@ PopupMenu {
shortcut: "Ctrl+,"
onTriggered: {
appMain.changeAppSection(Constants.profile)
profileLayoutContainer.changeProfileSection(ProfileConstants.BROWSER_SETTINGS)
// TODO: replace with shared store constant
// Profile/RootStore.browser_settings_id
profileLayoutContainer.changeProfileSection(10)
}
}
}

View File

@ -5,7 +5,6 @@ import utils 1.0
import "../../../../../shared"
import "../../../../../shared/status"
import ".."
import "../../../Profile/LeftTab/constants.js" as ProfileConstants
Item {
width: parent.width
@ -119,7 +118,9 @@ Item {
onTriggered: {
activityCenter.close()
appMain.changeAppSection(Constants.profile)
profileLayoutContainer.changeProfileSection(ProfileConstants.NOTIFICATIONS)
// TODO: replace with shared store constant
// Profile/RootStore.notifications_id
profileLayoutContainer.changeProfileSection(7)
}
}
}

View File

@ -6,7 +6,6 @@ import utils 1.0
import "../../../../../shared"
import "../../../../../shared/status"
import "./" as MessageComponents
import "../../../Profile/LeftTab/constants.js" as ProfileConstants
Column {
id: root
@ -346,7 +345,9 @@ Column {
type: "secondary"
onClicked: {
appMain.changeAppSection(Constants.profile)
profileLayoutContainer.changeProfileSection(ProfileConstants.PRIVACY_AND_SECURITY)
// TODO: replace with shared store constant
// Profile/RootStore.privacy_and_security_id
profileLayoutContainer.changeProfileSection(3)
}
width: parent.width
anchors.top: sep1.bottom

View File

@ -6,7 +6,6 @@ import QtGraphicalEffects 1.13
import utils 1.0
import "../../../../shared"
import "../../../../shared/status"
import "../../Profile/Sections/Contacts"
ModalPopup {
id: popup

View File

@ -1,37 +0,0 @@
import QtQuick 2.13
import StatusQ.Components 0.1
import utils 1.0
import "./LeftTab"
Item {
property alias changeProfileSection: profileMenu.changeProfileSection
id: profileInfoContainer
StatusNavigationPanelHeadline {
id: title
text: qsTr("Settings")
anchors.top: parent.top
anchors.topMargin: Style.current.padding
anchors.horizontalCenter: parent.horizontalCenter
}
Menu {
id: profileMenu
anchors.right: parent.right
anchors.rightMargin: Style.current.smallPadding
anchors.left: parent.left
anchors.leftMargin: Style.current.smallPadding
anchors.top: title.bottom
anchors.topMargin: Style.current.padding
anchors.bottom: parent.bottom
}
}
/*##^##
Designer {
D{i:0;autoSize:true;formeditorColor:"#ffffff";height:600;width:340}
}
##^##*/

View File

@ -1,93 +0,0 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import StatusQ.Components 0.1
import "../../../../shared"
import utils 1.0
import "./constants.js" as ProfileConstants
ScrollView {
property var changeProfileSection: function (sectionId) {
Config.currentMenuTab = sectionId
}
ScrollBar.horizontal.policy: Qt.ScrollBarAlwaysOff
contentHeight: menuItems.height + 24
id: profileMenu
clip: true
Column {
id: menuItems
spacing: 4
Repeater {
model: ProfileConstants.mainMenuButtons
delegate: StatusNavigationListItem {
itemId: modelData.id
title: modelData.text
icon.name: modelData.icon
selected: Config.currentMenuTab === modelData.id
onClicked: Config.currentMenuTab = modelData.id
}
}
StatusListSectionHeadline { text: "Settings" }
Repeater {
model: ProfileConstants.settingsMenuButtons
delegate: StatusNavigationListItem {
id: settingsMenuDelegate
itemId: modelData.id
title: modelData.text
icon.name: modelData.icon
selected: Config.currentMenuTab === modelData.id
onClicked: Config.currentMenuTab = modelData.id
visible: {
if((profileModel.fleets.fleet == Constants.waku_prod || profileModel.fleets.fleet === Constants.waku_test) && modelData.id === 8){
// Disable sync settings. - TODO: remove this once wakuV2 compatibility is added
return false;
}
return modelData.ifEnabled !== "browser" || appSettings.isBrowserEnabled
}
badge.value: (!profileModel.mnemonic.isBackedUp && (settingsMenuDelegate.title ===
ProfileConstants.settingsMenuButtons[0].text)) ? 1 : 0
}
}
Item {
id: invisibleSeparator
height: 16
width: parent.width
}
Repeater {
model: ProfileConstants.extraMenuButtons
delegate: StatusNavigationListItem {
itemId: modelData.id
title: modelData.text
icon.name: modelData.icon
selected: Config.currentMenuTab === modelData.id
visible: modelData.ifEnabled !== "browser" || appSettings.isBrowserEnabled
onClicked: function () {
if (modelData.function === "exit") {
return confirmDialog.open()
}
Config.currentMenuTab = modelData.id
}
}
}
}
ConfirmationDialog {
id: confirmDialog
header.title: qsTr("Sign out")
confirmationText: qsTr("Make sure you have your account password and seed phrase stored. Without them you can lock yourself out of your account and lose funds.")
confirmButtonLabel: qsTr("Sign out & Quit")
onConfirmButtonClicked: {
Qt.quit()
}
}
}

View File

@ -1,83 +0,0 @@
var PROFILE = 0
var CONTACTS = 1
var ENS = 2
var PRIVACY_AND_SECURITY = 3
var APPEARANCE = 4
var SOUND = 5
var LANGUAGE = 6
var NOTIFICATIONS = 7
var SYNC_SETTINGS = 8
var DEVICES_SETTINGS = 9
var BROWSER_SETTINGS = 10
var ADVANCED = 11
var NEED_HELP = 12
var ABOUT = 13
var SIGNOUT = 14
var mainMenuButtons = [{
"id": PROFILE,
"text": qsTr("My Profile"),
"icon": "profile"
}, {
"id": CONTACTS,
"text": qsTr("Contacts"),
"icon": "contact"
}, {
"id": ENS,
"text": qsTr("ENS usernames"),
"icon": "username"
}]
var settingsMenuButtons = [{
"id": PRIVACY_AND_SECURITY,
"text": qsTr("Privacy and security"),
"icon": "security"
}, {
"id": APPEARANCE,
"text": qsTr("Appearance"),
"icon": "appearance"
}, {
"id": SOUND,
"text": qsTr("Sound"),
"icon": "sound"
}, {
"id": LANGUAGE,
"text": qsTr("Language"),
"icon": "language"
}, {
"id": NOTIFICATIONS,
"text": qsTr("Notifications"),
"icon": "notification"
}, {
"id": SYNC_SETTINGS,
"text": qsTr("Sync settings"),
"icon": "mobile"
}, {
"id": DEVICES_SETTINGS,
"text": qsTr("Devices settings"),
"icon": "mobile"
}, {
"id": BROWSER_SETTINGS,
"text": qsTr("Browser settings"),
"icon": "browser",
"ifEnabled": "browser"
}, {
"id": ADVANCED,
"text": qsTr("Advanced"),
"icon": "settings"
}]
var extraMenuButtons = [{
"id": NEED_HELP,
"text": qsTr("Need help?"),
"icon": "help"
}, {
"id": ABOUT,
"text": qsTr("About"),
"icon": "info"
}, {
"id": SIGNOUT,
"function": "exit",
"text": qsTr("Sign out & Quit"),
"icon": "logout"
}]

View File

@ -1,2 +0,0 @@
Profile 1.0 Profile.qml
Menu 1.0 Menu.qml

View File

@ -4,7 +4,10 @@ import QtQuick.Layouts 1.13
import utils 1.0
import "../../../shared"
import "./Sections"
import "stores"
import "popups"
import "views"
import StatusQ.Layout 0.1
@ -12,14 +15,16 @@ StatusAppTwoPanelLayout {
id: profileView
property RootStore store: RootStore { }
property int contentMaxWidth: 624
property int contentMinWidth: 450
property int topMargin: 46
property alias changeProfileSection: leftTab.changeProfileSection
leftPanel: LeftTab {
leftPanel: LeftTabView {
id: leftTab
anchors.fill:parent
store: profileView.store
anchors.fill: parent
}
rightPanel: StackLayout {
@ -27,7 +32,7 @@ StatusAppTwoPanelLayout {
property int profileContentWidth: Math.max(contentMinWidth, Math.min(profileContainer.width * 0.8, contentMaxWidth))
anchors.fill: parent
currentIndex: Config.currentMenuTab
currentIndex: profileView.store.selectedMenuItem
onCurrentIndexChanged: {
if(visibleChildren[0] === ensContainer){
@ -35,42 +40,64 @@ StatusAppTwoPanelLayout {
}
}
// This list needs to match LeftTab/constants.js
// Would be better if we could make them match automatically
MyProfileContainer {}
ContactsContainer {}
EnsContainer {
id: ensContainer
MyProfileView {
store: profileView.store
}
PrivacyContainer {}
ContactsView {
store: profileView.store
}
AppearanceContainer {}
EnsView {
id: ensContainer
store: profileView.store
}
SoundsContainer {}
PrivacyView {
store: profileView.store
}
LanguageContainer {}
AppearanceView {
store: profileView.store
}
NotificationsContainer {}
SoundsView {}
SyncContainer {}
LanguageView {
store: profileView.store
}
DevicesContainer {}
NotificationsView {
store: profileView.store
}
BrowserContainer {}
SyncView {
store: profileView.store
}
AdvancedContainer {}
DevicesView {
store: profileView.store
}
HelpContainer {}
BrowserView {
store: profileView.store
}
AboutContainer {}
AdvancedView {
store: profileView.store
}
HelpView {}
AboutView {
store: profileView.store
}
}
}
/*##^##
Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/

View File

@ -1,88 +0,0 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import "./samples/"
import utils 1.0
import "../../../../../shared"
import "../../../Chat/components"
import "."
ListView {
id: contactList
property var contacts: ContactsData {}
property string searchStr: ""
property string searchString: ""
property string lowerCaseSearchString: searchString.toLowerCase()
property string contactToRemove: ""
property bool hideBlocked: false
property Component profilePopupComponent: ProfilePopup {
id: profilePopup
onClosed: destroy()
}
width: parent.width
model: contacts
delegate: Contact {
name: Utils.removeStatusEns(model.name)
address: model.address
localNickname: model.localNickname
identicon: model.thumbnailImage || model.identicon
isContact: model.isContact
isBlocked: model.isBlocked
profileClick: function (showFooter, userName, fromAuthor, identicon, textParam, nickName) {
var popup = profilePopupComponent.createObject(contactList);
popup.openPopup(showFooter, userName, fromAuthor, identicon, textParam, nickName);
}
visible: {
if (hideBlocked && model.isBlocked) {
return false
}
return searchString === "" ||
model.name.toLowerCase().includes(lowerCaseSearchString) ||
model.address.toLowerCase().includes(lowerCaseSearchString)
}
onBlockContactActionTriggered: {
blockContactConfirmationDialog.contactName = name
blockContactConfirmationDialog.contactAddress = address
blockContactConfirmationDialog.open()
}
onRemoveContactActionTriggered: {
removeContactConfirmationDialog.value = address
removeContactConfirmationDialog.open()
}
}
// TODO: Make BlockContactConfirmationDialog a dynamic component on a future refactor
BlockContactConfirmationDialog {
id: blockContactConfirmationDialog
onBlockButtonClicked: {
profileModel.contacts.blockContact(blockContactConfirmationDialog.contactAddress)
blockContactConfirmationDialog.close()
}
}
// TODO: Make ConfirmationDialog a dynamic component on a future refactor
ConfirmationDialog {
id: removeContactConfirmationDialog
//% "Remove contact"
header.title: qsTrId("remove-contact")
//% "Are you sure you want to remove this contact?"
confirmationText: qsTrId("are-you-sure-you-want-to-remove-this-contact-")
onConfirmButtonClicked: {
if (profileModel.contacts.isAdded(removeContactConfirmationDialog.value)) {
profileModel.contacts.removeContact(removeContactConfirmationDialog.value);
}
removeContactConfirmationDialog.close()
}
}
}
/*##^##
Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/

View File

@ -1,2 +0,0 @@
Contact 1.0 Contact.qml
ContactList 1.0 ContactList.qml

View File

@ -1,20 +0,0 @@
import QtQuick 2.13
ListModel {
ListElement {
name: "Ferocious Herringbone Sinewave2"
identicon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAg0lEQVR4nOzXwQmAMBAFURV7sQybsgybsgyr0QYUlE1g+Mw7ioQMe9lMQwhDaAyhMYTGEJqYkPnrj/t5XE/ft2UdW1yken7MRAyhMYTGEBpDaAyhKe9JbzvSX9WdLWYihtAYQuMLkcYQGkPUScxEDKExhMYQGkNoDKExhMYQmjsAAP//ZfIUZgXTZXQAAAAASUVORK5CYII="
address: "0x123456789009876543211234567890"
}
ListElement {
name: "Another Account"
identicon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAg0lEQVR4nOzXwQmAMBAFURV7sQybsgybsgyr0QYUlE1g+Mw7ioQMe9lMQwhDaAyhMYTGEJqYkPnrj/t5XE/ft2UdW1yken7MRAyhMYTGEBpDaAyhKe9JbzvSX9WdLWYihtAYQuMLkcYQGkPUScxEDKExhMYQGkNoDKExhMYQmjsAAP//ZfIUZgXTZXQAAAAASUVORK5CYII="
address: "0x123456789009876543211234567890"
}
}
/*##^##
Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/

View File

@ -1 +0,0 @@
ContactsData 1.0 ContactsData.qml

View File

@ -1,39 +0,0 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import utils 1.0
import "../../../../shared"
import "../../../../shared/status"
import "./Data/locales.js" as Locales_JSON
Item {
id: languageContainer
Layout.fillHeight: true
Layout.fillWidth: true
clip: true
property Component languagePopup: LanguageModal {}
Item {
anchors.top: parent.top
anchors.topMargin: topMargin
anchors.bottom: parent.bottom
width: profileContainer.profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter
Column {
id: generalColumn
width: parent.width
StatusSettingsLineButton {
//% "Language"
text: qsTrId("language")
//% "Default"
currentValue: globalSettings.locale === "" ? qsTrId("default") : globalSettings.locale
onClicked: languagePopup.createObject(languageContainer).open()
}
}
}
}

View File

@ -1,178 +0,0 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import QtGraphicalEffects 1.13
import utils 1.0
import "../../../../shared"
import "../../../../shared/status"
import "../../Onboarding/shared" as OnboardingComponents
Item {
id: privacyContainer
Layout.fillHeight: true
Layout.fillWidth: true
clip: true
Column {
id: containerColumn
anchors.top: parent.top
anchors.topMargin: topMargin
width: profileContainer.profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter
StatusSectionHeadline {
id: labelSecurity
//% "Security"
text: qsTrId("security")
bottomPadding: Style.current.halfPadding
}
StatusSettingsLineButton {
id: backupSeedPhrase
//% "Backup Seed Phrase"
text: qsTrId("backup-seed-phrase")
isBadge: !profileModel.mnemonic.isBackedUp
isEnabled: !profileModel.mnemonic.isBackedUp
onClicked: {
backupSeedModal.open()
}
}
StatusSettingsLineButton {
text: qsTr("Change password")
onClicked: {
changePasswordModal.open()
}
}
StatusSettingsLineButton {
text: qsTr("Store pass to Keychain")
visible: Qt.platform.os == "osx" // For now, this is available only on MacOS
currentValue: {
let value = accountSettings.storeToKeychain
if(value == Constants.storeToKeychainValueStore)
return qsTr("Store")
if(value == Constants.storeToKeychainValueNever)
return qsTr("Never")
return qsTr("Not now")
}
onClicked: openPopup(storeToKeychainSelectionModal)
Component {
id: storePasswordModal
OnboardingComponents.CreatePasswordModal {
storingPasswordModal: true
height: 350
}
}
Component {
id: storeToKeychainSelectionModal
StoreToKeychainSelectionModal {}
}
}
BackupSeedModal {
id: backupSeedModal
}
ChangePasswordModal {
id: changePasswordModal
anchors.centerIn: parent
successPopup: successPopup
}
ChangePasswordSuccessModal {
id: successPopup
anchors.centerIn: parent
}
Item {
id: spacer1
height: Style.current.bigPadding
width: parent.width
}
Separator {
id: separator
}
StatusSectionHeadline {
id: labelPrivacy
//% "Privacy"
text: qsTrId("privacy")
topPadding: Style.current.padding
bottomPadding: Style.current.halfPadding
}
StatusSettingsLineButton {
//% "Display all profile pictures (not only contacts)"
text: qsTrId("display-all-profile-pictures--not-only-contacts-")
isSwitch: true
switchChecked: !appSettings.onlyShowContactsProfilePics
onClicked: appSettings.onlyShowContactsProfilePics = !checked
}
StatusSettingsLineButton {
//% "Display images in chat automatically"
text: qsTrId("display-images-in-chat-automatically")
isSwitch: true
switchChecked: appSettings.displayChatImages
onClicked: appSettings.displayChatImages = checked
}
StyledText {
width: parent.width
//% "All images (links that contain an image extension) will be downloaded and displayed, regardless of the whitelist settings below"
text: qsTrId("all-images--links-that-contain-an-image-extension--will-be-downloaded-and-displayed--regardless-of-the-whitelist-settings-below")
font.pixelSize: 15
font.weight: Font.Thin
color: Style.current.secondaryText
wrapMode: Text.WordWrap
bottomPadding: Style.current.smallPadding
}
StatusSettingsLineButton {
//% "Chat link previews"
text: qsTrId("chat-link-previews")
onClicked: openPopup(chatLinksPreviewModal)
}
Component {
id: chatLinksPreviewModal
ChatLinksPreviewModal {}
}
Component {
id: openLinksWithModal
OpenLinksWithModal {}
}
StatusSettingsLineButton {
//% "Open links with..."
text: qsTrId("open-links-with---")
//% "My default browser"
currentValue: appSettings.openLinksInStatus ? "Status" : qsTrId("my-default-browser")
onClicked: openPopup(openLinksWithModal)
}
StatusSettingsLineButton {
//% "Allow new contact requests"
text: qsTrId("allow-new-contact-requests")
isSwitch: true
switchChecked: !profileModel.profile.messagesFromContactsOnly
onClicked: function (checked) {
profileModel.setMessagesFromContactsOnly(!checked)
}
}
}
}
/*##^##
Designer {
D{i:0;autoSize:true;formeditorColor:"#ffffff";height:480;width:640}
}
##^##*/

View File

@ -1,13 +0,0 @@
EnsContainer 1.0 EnsContainer.qml
ContactsContainer 1.0 ContactsContainer.qml
PrivacyContainer 1.0 PrivacyContainer.qml
SyncContainer 1.0 SyncContainer.qml
DevicesContainer 1.0 DevicesContainer.qml
LanguageContainer 1.0 LanguageContainer.qml
NotificationsContainer 1.0 NotificationsContainer.qml
AdvancedContainer 1.0 AdvancedContainer.qml
HelpContainer 1.0 HelpContainer.qml
AboutContainer 1.0 AboutContainer.qml
BackupSeedModal 1.0 BackupSeedModal.qml
LanguageModal 1.0 LanguageModal.qml
ConfirmAppRestartModal 1.0 ConfirmAppRestartModal.qml

View File

@ -6,6 +6,7 @@ import utils 1.0
import "../../../../shared"
import "../../../../shared/status"
// TODO: replace with StatusQ component
StatusRadioButtonRow {
property string fleetName: ""
property string newFleet: ""

View File

@ -6,6 +6,7 @@ import utils 1.0
import "../../../../shared"
import "../../../../shared/status"
// TODO: replace with StatusQ component
StatusRadioButtonRow {
property string network: ""
property string networkName: ""

View File

@ -3,8 +3,8 @@ import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/status"
import "../../../../shared"
import "../../../../shared/status"
Rectangle {
property string name: "Jotaro Kujo"
@ -15,6 +15,9 @@ Rectangle {
property bool isContact: true
property bool isBlocked: false
property string searchStr: ""
signal clicked()
signal sendMessageActionTriggered()
signal unblockContactActionTriggered()
signal blockContactActionTriggered(name: string, address: string)
signal removeContactActionTriggered(address: string)
property bool isHovered: false
@ -63,8 +66,7 @@ Rectangle {
contactContextMenu.popup()
return
}
changeAppSection(Constants.chat)
chatsModel.channelView.joinPrivateChat(address, "")
container.clicked();
}
}
@ -110,10 +112,7 @@ Rectangle {
icon.height: menuButton.iconSize
//% "Send message"
text: qsTrId("send-message")
onTriggered: {
changeAppSection(Constants.chat)
chatsModel.channelView.joinPrivateChat(address, "")
}
onTriggered: container.sendMessageActionTriggered()
enabled: !container.isBlocked
}
Action {
@ -147,7 +146,7 @@ Rectangle {
text: qsTrId("unblock-user")
enabled: container.isBlocked
onTriggered: {
profileModel.contacts.unblockContact(address)
container.unblockContactActionTriggered()
contactContextMenu.close()
}
}
@ -155,3 +154,4 @@ Rectangle {
}
}
}

View File

@ -0,0 +1,68 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import utils 1.0
import "../../../../shared"
import "../../Chat/components"
import "."
ListView {
id: contactList
property var contacts
property string searchStr: ""
property string searchString: ""
property string lowerCaseSearchString: searchString.toLowerCase()
property string contactToRemove: ""
property bool hideBlocked: false
property Component profilePopupComponent: ProfilePopup {
id: profilePopup
onClosed: destroy()
}
signal contactClicked(var contact)
signal sendMessageActionTriggered(var contact)
signal unblockContactActionTriggered(var contact)
signal blockContactActionTriggered(var contact)
signal removeContactActionTriggered(var contact)
width: parent.width
model: contacts
delegate: ContactPanel {
name: Utils.removeStatusEns(model.name)
address: model.address
localNickname: model.localNickname
identicon: model.thumbnailImage || model.identicon
isContact: model.isContact
isBlocked: model.isBlocked
profileClick: function (showFooter, userName, fromAuthor, identicon, textParam, nickName) {
var popup = profilePopupComponent.createObject(contactList);
popup.openPopup(showFooter, userName, fromAuthor, identicon, textParam, nickName);
}
onClicked: contactList.contactClicked(model)
onSendMessageActionTriggered: contactList.sendMessageActionTriggered(model)
onUnblockContactActionTriggered: contactList.unblockContactActionTriggered(model)
onBlockContactActionTriggered: contactList.blockContactActionTriggered(model)
onRemoveContactActionTriggered: contactList.removeContactActionTriggered(model)
visible: {
if (hideBlocked && model.isBlocked) {
return false
}
return searchString === "" ||
model.name.toLowerCase().includes(lowerCaseSearchString) ||
model.address.toLowerCase().includes(lowerCaseSearchString)
}
}
}
/*##^##
Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/

View File

@ -3,8 +3,10 @@ import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import Qt.labs.platform 1.1
import StatusQ.Core 0.1
import utils 1.0
import "../../../../../shared"
import "../../../../shared"
Item {
property string name: "Status.im"
@ -26,7 +28,7 @@ Item {
source: Style.svg("generalDappIcon")
}
StyledText {
StatusBaseText {
id: dappText
text: name
elide: Text.ElideRight

View File

@ -0,0 +1,68 @@
import QtQuick 2.13
import QtQuick.Layouts 1.13
import StatusQ.Components 0.1
import "../../../../shared"
import utils 1.0
Column {
id: root
spacing: 4
property alias mainMenuItems: mainMenuItems.model
property alias settingsMenuItems: settingsMenuItems.model
property alias extraMenuItems: extraMenuItems.model
property int selectedMenuItem
property bool browserMenuItemEnabled: false
signal menuItemClicked(var menu_item)
Repeater {
id: mainMenuItems
delegate: StatusNavigationListItem {
itemId: model.menu_id
title: model.text
icon.name: model.icon
selected: root.selectedMenuItem === model.menu_id
onClicked: root.menuItemClicked(model)
}
}
StatusListSectionHeadline { text: qsTr("Settings") }
Repeater {
id: settingsMenuItems
delegate: StatusNavigationListItem {
id: settingsMenuDelegate
itemId: model.menu_id
title: model.text
icon.name: model.icon
selected: root.selectedMenuItem === model.menu_id
onClicked: root.menuItemClicked(model)
visible: model.ifEnabled !== "browser" || root.browserMenuItemEnabled
badge.value: (!profileModel.mnemonic.isBackedUp && (settingsMenuDelegate.title ===
settingsMenuItems.itemAt(0).text)) ? 1 : 0
}
}
Item {
id: invisibleSeparator
height: 16
width: parent.width
}
Repeater {
id: extraMenuItems
delegate: StatusNavigationListItem {
itemId: model.menu_id
title: model.text
icon.name: model.icon
selected: root.selectedMenuItem === model.menu_id
visible: model.ifEnabled !== "browser" || root.browserMenuItemEnabled
onClicked: root.menuItemClicked(model)
}
}
}

View File

@ -39,7 +39,8 @@ Item {
anchors.leftMargin: Style.current.padding
}
StatusNotificationWithDropShadow {
// TODO: move to StatusQ
StatusNotificationWithDropShadowPanel {
id: notificationPreview
anchors.top: radioButton.bottom
anchors.topMargin: Style.current.halfPadding

View File

@ -3,8 +3,11 @@ import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import Qt.labs.platform 1.1
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import utils 1.0
import "../../../../../shared"
import "../../../../shared"
Item {
property string name: "permission-name-here"
@ -15,7 +18,7 @@ Item {
signal removeBtnClicked(string permission)
StyledText {
StatusBaseText {
id: dappText
text: name
elide: Text.ElideRight
@ -29,10 +32,10 @@ Item {
}
StyledText {
StatusBaseText {
//% "Revoke access"
text: qsTrId("revoke-access")
color: Style.current.red
color: Theme.palette.dangerColor1
anchors.top: parent.top
anchors.topMargin: Style.current.smallPadding
anchors.right: parent.right

View File

@ -11,6 +11,12 @@ ModalPopup {
id: popup
property url largeImage: ""
property bool hasIdentityImage: false
signal cropFinished(var aX, var aY, var bX, var bY)
signal removeImageButtonClicked()
//% "Profile picture"
title: qsTrId("profile-picture")
@ -31,7 +37,7 @@ ModalPopup {
RoundedImage {
id: profilePic
source: profileModel.profile.largeImage
source: popup.largeImage
width: 160
height: 160
anchors.verticalCenter: parent.verticalCenter
@ -60,9 +66,7 @@ ModalPopup {
selectedImage: popup.selectedImage
ratio: "1:1"
onCropFinished: {
uploadError = profileModel.picture.upload(selectedImage, aX, aY, bX, bY)
}
onCropFinished: popup.cropFinished(selectedImage, aX, aY, bX, bY)
}
}
@ -71,7 +75,7 @@ ModalPopup {
height: uploadBtn.height
StatusButton {
visible: profileModel.profile.hasIdentityImage
visible: popup.hasIdentityImage
type: "secondary"
flat: true
color: Style.current.danger
@ -80,9 +84,7 @@ ModalPopup {
anchors.right: uploadBtn.left
anchors.rightMargin: Style.current.padding
anchors.bottom: parent.bottom
onClicked: {
uploadError = profileModel.picture.remove()
}
onClicked: popup.removeImageButtonClicked()
}
StatusButton {
@ -112,8 +114,3 @@ ModalPopup {
}
}
/*##^##
Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/

View File

@ -3,20 +3,26 @@ import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import utils 1.0
import "../../../../../shared"
import "./"
import "../../../../shared"
import "./"
import "../panels"
// TODO: replace with StatusModal
ModalPopup {
id: popup
id: root
//% "Dapp permissions"
title: qsTrId("dapp-permissions")
Component.onCompleted: profileModel.dappList.init()
Component.onDestruction: profileModel.dappList.clearData()
property var store
Component.onCompleted: store.initDappList()
Component.onDestruction: store.clearDappList()
property Component permissionListPopup: PermissionList {
onClosed: destroy()
onAccessRevoked: profileModel.dappList.init()
store: root.store
onAccessRevoked: store.initDappList()
}
Item {
@ -35,7 +41,7 @@ ModalPopup {
spacing: 0
clip: true
id: dappListView
model: profileModel.dappList
model: root.store.dappList
delegate: Dapp {
name: model.name
onDappClicked: permissionListPopup.createObject(privacyContainer, {dapp: dapp}).open()

View File

@ -4,7 +4,7 @@ import QtQuick.Layouts 1.3
import QtQml.Models 2.3
import utils 1.0
import "../../../../../shared"
import "../../../../shared"
ModalPopup {
id: popup

View File

@ -2,9 +2,10 @@ import QtQuick 2.13
import QtQuick.Controls 2.13
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/status"
import "../../../../shared"
import "../../../../shared/status"
// TODO: replace with StatusModal
ModalPopup {
id: popup

View File

@ -6,6 +6,9 @@ import utils 1.0
import "../../../../shared"
import "../../../../shared/status"
import "../controls"
// TODO: replace with StatusModal
ModalPopup {
id: popup
//% "Fleet"

View File

@ -2,9 +2,10 @@ import QtQuick 2.13
import QtQuick.Controls 2.13
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/status"
import "../../../../shared"
import "../../../../shared/status"
// TODO: replace with StatusModal
ModalPopup {
id: popup

View File

@ -4,14 +4,17 @@ import QtQuick.Controls 2.13
import utils 1.0
import "../../../../shared"
import "../../../../shared/status"
import "./Data/locales.js" as Locales_JSON
import "../locales.js" as Locales_JSON
// TODO: replace with StatusQ StatusModal
ModalPopup {
id: popup
id: root
//% "Language"
title: qsTrId("Language")
property var store
onClosed: {
destroy()
}
@ -34,12 +37,12 @@ ModalPopup {
confirmButtonLabel: qsTr("Close the app now")
cancelButtonLabel: qsTr("I'll do that later")
onConfirmButtonClicked: {
profileModel.changeLocale(newLocale)
root.store.changeLocale(newLocale)
Qt.quit();
}
onCancelButtonClicked: {
languageChangeConfirmationDialog.item.close()
popup.close()
root.close()
}
}
@ -78,7 +81,7 @@ ModalPopup {
languageChangeConfirmationDialog.item.newLocale = modelData.locale
languageChangeConfirmationDialog.item.open()
} else {
profileModel.changeLocale(modelData.locale)
root.store.changeLocale(modelData.locale)
}
}
}

View File

@ -6,6 +6,10 @@ import utils 1.0
import "../../../../shared"
import "../../../../shared/status"
import "../controls"
import "../panels"
// TODO: replace with StatusQ component
ModalPopup {
id: popup
//% "Network"

View File

@ -2,22 +2,31 @@ import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/status"
import "./"
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
import utils 1.0
import "../../../../shared"
import "../../../../shared/status"
import "./"
import "../panels"
// TODO: replace with StatusModal
ModalPopup {
property string dapp: ""
id: popup
id: root
title: dapp
width: 400
height: 400
Component.onCompleted: profileModel.dappList.permissionList.init(dapp)
Component.onDestruction: profileModel.dappList.permissionList.clearData()
property var store
Component.onCompleted: store.initPermissionList(dapp)
Component.onDestruction: store.clearPermissionList()
signal accessRevoked(string dapp)
@ -37,29 +46,30 @@ ModalPopup {
spacing: 0
clip: true
id: permissionListView
model: profileModel.dappList.permissionList
model: root.store.permissionList
delegate: Permission {
name: model.name
onRemoveBtnClicked: {
profileModel.dappList.permissionList.revokePermission(model.name);
root.store.revokePermission(model.name);
if(permissionListView.count === 1){
accessRevoked(dapp);
close();
}
profileModel.dappList.permissionList.init(dapp)
root.store.initPermissionList(dapp)
}
}
}
}
}
// TODO: replace with StatusQ component
footer: StatusButton {
anchors.horizontalCenter: parent.horizontalCenter
type: "warn"
//% "Revoke all access"
text: qsTrId("revoke-all-access")
onClicked: {
profileModel.dappList.permissionList.revokeAccess();
root.store.revokeAllPermissionAccess()
accessRevoked(dapp);
close();
}

View File

@ -2,9 +2,10 @@ import QtQuick 2.13
import QtQuick.Controls 2.13
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/status"
import "../../../../shared"
import "../../../../shared/status"
// TODO: replace with StatusModal
ModalPopup {
id: popup

View File

@ -0,0 +1,366 @@
import QtQuick 2.13
import utils 1.0
QtObject {
id: root
property var profileModelInst: profileModel
property var chatsModelInst: chatsModel
property var utilsModelInst: utilsModel
property var walletModelInst: walletModel
property var nodeModelInst: nodeModel
property var ens: profileModelInst.ens
property var dappList: profileModelInst.dappList
property var permissionList: profileModelInst.dappList.permissionList
property var mailservers: profileModelInst.mailservers
property var mailserversList: profileModelInst.mailservers.list
property var contacts: profileModelInst.contacts
property var blockedContacts: profileModelInst.contacts.blockedContacts
property var addedContacts: profileModelInst.contacts.addedContacts
property var mutedChatsContacts: profileModelInst.mutedChats.contacts
property var mutedChats: profileModelInst.mutedChats.chats
property var devicesList: profileModelInst.devices.list
property string ensRegisterAddress: utilsModelInst.ensRegisterAddress
property string etherscanLink: walletModelInst.utilsView.etherscanLink
property string pubKey: profileModelInst.profile.pubKey
property string fleet: profileModelInst.fleets.fleet
property string bloomLevel: nodeModelInst.bloomLevel
property string currentNetwork: profileModelInst.network.current
property string preferredUsername: profileModelInst.ens.preferredUsername
property string firstEnsUsername: profileModelInst.ens.firstEnsUsername
property string username: profileModelInst.profile.username
property string identicon: profileModelInst.profile.identicon
property string profileLargeImage: profileModelInst.profile.largeImage
property string profileThumbnailImage: profileModelInst.profile.thumbnailImage
property bool profileHasIdentityImage: profileModelInst.profile.hasIdentityImage
property bool automaticMailserverSelection: profileModelInst.mailservers.automaticSelection
property bool isWakuV2LightClient: nodeModelInst.WakuV2LightClient
property bool devicesSetup: profileModelInst.devices.isSetup
property bool mnemonicBackedUp: profileModelInst.mnemonic.isBackedUp
property bool messagesFromContactsOnly: profileModelInst.profile.messagesFromContactsOnly
property int profile_id: 0
property int contacts_id: 1
property int ens_id: 2
property int privacy_and_security_id: 3
property int appearance_id: 4
property int sound_id: 5
property int language_id: 6
property int notifications_id: 7
property int sync_settings_id: 8
property int devices_settings_id: 9
property int browser_settings_id: 10
property int advanced_id: 11
property int need_help_id: 12
property int about_id: 13
property int signout_id: 14
property bool browserMenuItemEnabled: appSettings.isBrowserEnabled
property int selectedMenuItem: 0
property ListModel mainMenuItems: ListModel {
ListElement {
menu_id: 0
text: qsTr("My Profile")
icon: "profile"
}
ListElement {
menu_id: 1
text: qsTr("Contacts")
icon: "contact"
}
ListElement {
menu_id: 2
text: qsTr("ENS usernames")
icon: "username"
}
}
property ListModel settingsMenuItems: ListModel {
ListElement {
menu_id: 3
text: qsTr("Privacy and security")
icon: "security"
}
ListElement {
menu_id: 4
text: qsTr("Appearance")
icon: "appearance"
}
ListElement {
menu_id: 5
text: qsTr("Sound")
icon: "sound"
}
ListElement {
menu_id: 6
text: qsTr("Language")
icon: "language"
}
ListElement {
menu_id: 7
text: qsTr("Notifications")
icon: "notification"
}
ListElement {
menu_id: 8
text: qsTr("Sync settings")
icon: "mobile"
}
ListElement {
menu_id: 9
text: qsTr("Devices settings")
icon: "mobile"
}
ListElement {
menu_id: 10
text: qsTr("Browser settings")
icon: "browser"
ifEnabled: "browser"
}
ListElement {
menu_id: 11
text: qsTr("Advanced")
icon: "settings"
}
}
property ListModel extraMenuItems: ListModel {
ListElement {
menu_id: 12
text: qsTr("Need help?")
icon: "help"
}
ListElement {
menu_id: 13
text: qsTr("About")
icon: "info"
}
ListElement {
menu_id: 14
function_name: "exit"
text: qsTr("Sign out & Quit")
icon: "logout"
}
}
function initPermissionList(name) {
profileModelInst.dappList.permissionList.init(name)
}
function clearPermissionList() {
profileModelInst.dappList.permissionList.clearData()
}
function revokePermission(name) {
profileModelInst.dappList.permissionList.revokePermission(name)
}
function revokeAllPermissionAccess() {
profileModelInst.dappList.permissionList.revokeAccess()
}
function initDappList() {
profileModelInst.dappList.init()
}
function clearDappList() {
profileModelInst.dappList.clearData()
}
function getQrCodeSource(publicKey) {
return profileModelInst.qrCode(publicKey)
}
function copyToClipboard(value) {
chatsModelInst.copyToClipboard(value)
}
function uploadImage(source, aX, aY, bX, bY) {
return profileModelInst.picture.upload(source, aX, aY, bX, bY)
}
function removeImage() {
return profileModelInst.picture.remove()
}
function lookupContact(value) {
profileModelInst.contacts.lookupContact(value)
}
function addContact(pubKey) {
profileModelInst.contacts.addContact(pubKey)
}
function generateAlias(pubKey) {
return utilsModelInst.generateAlias(pubKey)
}
function changeAppSection(section) {
appMain.changeAppSection(section)
}
function joinPrivateChat(address) {
chatsModelInst.channelView.joinPrivateChat(address, "");
}
function unblockContact(address) {
profileModelInst.contacts.unblockContact(address)
}
function blockContact(address) {
profileModelInst.contacts.blockContact(address)
}
function isContactAdded(address) {
return profileModelInst.contacts.isAdded(address)
}
function removeContact(address) {
profileModelInst.contacts.removeContact(address)
}
function ensDetails(username) {
profileModelInst.ens.details(username)
}
function ensPendingLen() {
return profileModelInst.ens.pendingLen()
}
function validateEns(ensName, isStatus) {
profileModelInst.ens.validate(ensName, isStatus)
}
function registerEnsGasEstimate(username, address) {
return profileModelInst.ens.registerENSGasEstimate(username, address)
}
function registerEns(username, address, gasLimit, tipLimit, overallLimit, gasPrice, password) {
return profileModelInst.ens.registerENS(username,
address, gasLimit, tipLimit, overallLimit, gasPrice, password)
}
function getEnsUsernameRegistrar() {
return profileModelInst.ens.getUsernameRegistrar()
}
function getEnsRegistry() {
return profileModelInst.ens.getENSRegistry()
}
function releaseEnsEstimate(username, address) {
return profileModelInst.ens.releaseEstimate(username, address)
}
function releaseEns(username, address, gasLimit, gasPrice, password) {
return profileModelInst.ens.release(username, address, gasLimit, gasPrice, password)
}
function getGasPrice() {
walletModelInst.gasView.getGasPrice()
}
function getGasPricePredictions() {
walletModelInst.gasView.getGasPricePredictions()
}
function ensConnectOwnedUsername(name, isStatus) {
profileModelInst.ens.connectOwnedUsername(name, isStatus)
}
function getWalletDefaultAddress() {
return walletModelInst.getDefaultAddress()
}
function getSntBalance() {
return utilsModelInst.getSNTBalance()
}
function changeLocale(l) {
profileModelInst.changeLocale(l)
}
function getMailserverName(mailserver) {
return profileModelInst.mailservers.list.getMailserverName(mailserver)
}
function setMailserver(mailserver) {
profileModelInst.mailservers.setMailserver(mailserver);
}
function saveMailserver(name, enode) {
profileModelInst.mailservers.save(name, enode)
}
function enableAutomaticMailserverSelection(checked) {
profileModelInst.mailservers.enableAutomaticSelection(checked)
}
function getNetworkName() {
return utilsModelInst.getNetworkName()
}
function logDir() {
return profileModelInst.logDir()
}
function setBloomLevel(mode) {
nodeModelInst.setBloomLevel(mode)
}
function setWakuV2LightClient(mode) {
nodeModelInst.setWakuV2LightClient(mode)
}
function getCurrentVersion() {
return utilsModelInst.getCurrentVersion()
}
function nodeVersion() {
return profileModelInst.nodeVersion()
}
function checkForUpdates() {
utilsModelInst.checkForUpdates()
}
function setPubKeyGasEstimate(username, address) {
return profileModelInst.ens.setPubKeyGasEstimate(username, address)
}
function setPubKey(username, address, gasLimit, gasPrice, password) {
return profileModelInst.ens.setPubKey(username, address, gasLimit, gasPrice, password)
}
function setDeviceName(name) {
profileModelInst.devices.setName(name)
}
function advertiseDevice() {
profileModelInst.devices.advertise()
}
function enableDeviceInstallation(id, pairedSwitch) {
profileModelInst.devices.enableInstallation(id, pairedSwitch)
}
function syncAllDevices() {
profileModelInst.devices.syncAll()
}
function readTextFile(path) {
return utilsModelInst.readTextFile(path)
}
function writeTextFile(path, value) {
utilsModelInst.writeTextFile(path, value)
}
function setMessagesFromContactsOnly(checked) {
profileModelInst.setMessagesFromContactsOnly(checked)
}
}

View File

@ -2,16 +2,21 @@ import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import utils 1.0
import "../../../../shared"
import "../../../../shared/status"
Item {
id: aboutContainer
id: root
Layout.fillHeight: true
Layout.fillWidth: true
clip: true
property var store
Column {
id: generalColumn
spacing: Style.current.bigPadding
@ -20,25 +25,27 @@ Item {
width: profileContainer.profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter
// TODO: replace with StatusListItem
StatusSectionDescItem {
//% "App version"
name: qsTrId("version")
//% "Version: %1"
description: qsTrId("version---1").arg(utilsModel.getCurrentVersion())
description: qsTrId("version---1").arg(root.store.getCurrentVersion())
tooltipUnder: true
}
// TODO: replace with StatusListItem
StatusSectionDescItem {
//% "Node version "
name: qsTrId("node-version-")
description: profileModel.nodeVersion()
description: root.store.nodeVersion()
}
StyledText {
StatusBaseText {
//% "Check for updates"
text: qsTrId("check-for-updates")
font.pixelSize: 15
color: Style.current.blue
color: Theme.palette.primaryColor1
MouseArea {
anchors.fill: parent
@ -51,17 +58,17 @@ Item {
parent.font.underline = false
}
onClicked: {
utilsModel.checkForUpdates();
root.store.checkForUpdates();
openPopup(downloadModalComponent, {newVersionAvailable: newVersionJSON.available, downloadURL: newVersionJSON.url})
}
}
}
StyledText {
StatusBaseText {
//% "Privacy Policy"
text: qsTrId("privacy-policy")
font.pixelSize: 15
color: Style.current.blue
color: Theme.palette.primaryColor1
MouseArea {
anchors.fill: parent

View File

@ -7,12 +7,19 @@ import utils 1.0
import "../../../../shared"
import "../../../../shared/status"
import "../controls"
import "../popups"
import "../panels"
ScrollView {
id: root
height: parent.height
width: parent.width
contentHeight: advancedContainer.height + 100
clip: true
property bool isWakuV2: profileModel.fleets.fleet == Constants.waku_prod || profileModel.fleets.fleet === Constants.waku_test
property bool isWakuV2: store.fleet == Constants.waku_prod || store.fleet === Constants.waku_test
property var store
Item {
id: advancedContainer
@ -23,24 +30,27 @@ ScrollView {
Column {
id: generalColumn
anchors.top: parent.top
anchors.topMargin: topMargin
anchors.topMargin: 64
anchors.left: parent.left
anchors.right: parent.right
// TODO: replace with StatusQ component
StatusSettingsLineButton {
//% "Network"
text: qsTrId("network")
currentValue: utilsModel.getNetworkName()
currentValue: root.store.getNetworkName()
onClicked: networksModal.open()
}
// TODO: replace with StatusQ component
StatusSettingsLineButton {
//% "Fleet"
text: qsTrId("fleet")
currentValue: profileModel.fleets.fleet
currentValue: root.store.fleet
onClicked: fleetModal.open()
}
// TODO: replace with StatusQ component
StatusSettingsLineButton {
//% "Minimize on close"
text: qsTrId("minimize-on-close")
@ -51,6 +61,7 @@ ScrollView {
}
}
// TODO: replace with StatusQ component
StyledText {
//% "Application Logs"
text: qsTr("Application Logs")
@ -65,7 +76,7 @@ ScrollView {
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
onClicked: {
Qt.openUrlExternally(profileModel.logDir())
Qt.openUrlExternally(root.store.logDir())
}
}
}
@ -91,6 +102,7 @@ ScrollView {
bottomPadding: Style.current.padding
}
// TODO: replace with StatusQ component
StatusSettingsLineButton {
//% "Wallet"
text: qsTrId("wallet")
@ -106,6 +118,7 @@ ScrollView {
}
}
// TODO: replace with StatusQ component
StatusSettingsLineButton {
text: qsTr("Wallet v2 - do not use, under active development")
isSwitch: true
@ -120,6 +133,7 @@ ScrollView {
}
}
// TODO: replace with StatusQ component
StatusSettingsLineButton {
//% "Dapp Browser"
text: qsTrId("dapp-browser")
@ -135,6 +149,7 @@ ScrollView {
}
}
// TODO: replace with StatusQ component
StatusSettingsLineButton {
//% "Communities"
text: qsTrId("communities")
@ -150,6 +165,7 @@ ScrollView {
}
}
// TODO: replace with StatusQ component
StatusSettingsLineButton {
//% "Activity Center"
text: qsTrId("activity-center")
@ -165,6 +181,7 @@ ScrollView {
}
}
// TODO: replace with StatusQ component
StatusSettingsLineButton {
//% "Node Management"
text: qsTrId("node-management")
@ -180,6 +197,7 @@ ScrollView {
}
}
// TODO: replace with StatusQ component
StatusSettingsLineButton {
id: onlineUsers
//% "Online users"
@ -191,6 +209,7 @@ ScrollView {
}
}
// TODO: replace with StatusQ component
StatusSettingsLineButton {
//% "GIF Widget"
text: qsTrId("gif-widget")
@ -201,6 +220,7 @@ ScrollView {
}
}
// TODO: replace with StatusQ component
StatusSettingsLineButton {
//% "Keycard"
text: qsTr("Keycard")
@ -234,10 +254,10 @@ ScrollView {
//% "The account will be logged out. When you login again, the selected mode will be enabled"
confirmationText: qsTrId("the-account-will-be-logged-out--when-you-login-again--the-selected-mode-will-be-enabled")
onConfirmButtonClicked: {
nodeModel.setBloomLevel(mode)
root.store.setBloomLevel(mode)
}
onClosed: {
switch(nodeModel.bloomLevel){
switch(root.store.nodeModelInst.bloomLevel){
case "light": btnBloomLight.click(); break;
case "normal": btnBloomNormal.click(); break;
case "full": btnBloomFull.click(); break;
@ -254,11 +274,11 @@ ScrollView {
BloomSelectorButton {
id: btnBloomLight
buttonGroup: bloomGroup
checkedByDefault: nodeModel.bloomLevel == "light"
checkedByDefault: root.store.bloomLevel == "light"
//% "Light Node"
btnText: qsTrId("light-node")
onToggled: {
if (nodeModel.bloomLevel != "light") {
if (root.store.bloomLevel != "light") {
openPopup(bloomConfirmationDialogComponent, {mode: "light"})
} else {
btnBloomLight.click()
@ -269,11 +289,11 @@ ScrollView {
BloomSelectorButton {
id: btnBloomNormal
buttonGroup: bloomGroup
checkedByDefault: nodeModel.bloomLevel == "normal"
checkedByDefault: root.store.bloomLevel == "normal"
//% "Normal"
btnText: qsTrId("normal")
onToggled: {
if (nodeModel.bloomLevel != "normal") {
if (root.store.bloomLevel != "normal") {
openPopup(bloomConfirmationDialogComponent, {mode: "normal"})
} else {
btnBloomNormal.click()
@ -284,11 +304,11 @@ ScrollView {
BloomSelectorButton {
id: btnBloomFull
buttonGroup: bloomGroup
checkedByDefault: nodeModel.bloomLevel == "full"
checkedByDefault: root.store.bloomLevel == "full"
//% "Full Node"
btnText: qsTrId("full-node")
onToggled: {
if (nodeModel.bloomLevel != "full") {
if (root.store.bloomLevel != "full") {
openPopup(bloomConfirmationDialogComponent, {mode: "full"})
} else {
btnBloomFull.click()
@ -316,10 +336,10 @@ ScrollView {
//% "The account will be logged out. When you login again, the selected mode will be enabled"
confirmationText: qsTrId("the-account-will-be-logged-out--when-you-login-again--the-selected-mode-will-be-enabled")
onConfirmButtonClicked: {
nodeModel.setWakuV2LightClient(mode)
root.store.setWakuV2LightClient(mode)
}
onClosed: {
if(nodeModel.WakuV2LightClient){
if(root.store.isWakuV2LightClient){
btnWakuV2Light.click()
} else {
btnWakuV2Full.click();
@ -336,11 +356,11 @@ ScrollView {
BloomSelectorButton {
id: btnWakuV2Light
buttonGroup: wakuV2Group
checkedByDefault: nodeModel.WakuV2LightClient
checkedByDefault: root.store.isWakuV2LightClient
//% "Light Node"
btnText: qsTrId("light-node")
onToggled: {
if (!nodeModel.WakuV2LightClient) {
if (!root.store.isWakuV2LightClient) {
openPopup(wakuV2ModeConfirmationDialogComponent, {light: true})
} else {
btnWakuV2Light.click()
@ -351,11 +371,11 @@ ScrollView {
BloomSelectorButton {
id: btnWakuV2Full
buttonGroup: wakuV2Group
checkedByDefault: !nodeModel.WakuV2LightClient
checkedByDefault: !root.store.isWakuV2LightClient
//% "Full Node"
btnText: qsTrId("full-node")
onToggled: {
if (nodeModel.WakuV2LightClient) {
if (root.store.isWakuV2LightClient) {
openPopup(wakuV2ModeConfirmationDialogComponent, {light: false})
} else {
btnWakuV2Full.click()
@ -364,9 +384,7 @@ ScrollView {
}
}
// TODO: replace with StatusQ component
StatusSettingsLineButton {
text: qsTr("Download messages")
isSwitch: true
@ -376,9 +394,10 @@ ScrollView {
}
}
// TODO: replace with StatusQ component
StatusSettingsLineButton {
text: qsTr("Stickers/ENS on ropsten")
visible: profileModel.network.current === Constants.networkRopsten
visible: root.store.currentNetwork === Constants.networkRopsten
isSwitch: true
switchChecked: appSettings.stickersEnsRopsten
onClicked: {

View File

@ -8,6 +8,10 @@ import "../../../../shared"
import "../../../../shared/status"
import "../../Chat/ChatColumn"
import StatusQ.Core 0.1
import "../popups"
ScrollView {
height: parent.height
width: parent.width
@ -21,6 +25,8 @@ ScrollView {
System
}
property var store
function updateTheme(theme) {
globalSettings.theme = theme
Style.changeTheme(theme, systemPalette.isCurrentSystemThemeDark())
@ -92,7 +98,7 @@ ScrollView {
anchors.right: parent.right
}
StyledText {
StatusBaseText {
id: labelFontSize
anchors.top: sectionHeadlineFontSize.bottom
anchors.topMargin: Style.current.padding
@ -125,14 +131,14 @@ ScrollView {
anchors.right: parent.right
spacing: Style.current.smallPadding
StyledText {
StatusBaseText {
font.pixelSize: 15
//% "XS"
text: qsTrId("xs")
Layout.preferredWidth: fontSizeSlider.width/6
}
StyledText {
StatusBaseText {
font.pixelSize: 15
//% "S"
text: qsTrId("s")
@ -140,7 +146,7 @@ ScrollView {
Layout.leftMargin: 2
}
StyledText {
StatusBaseText {
font.pixelSize: 15
//% "M"
text: qsTrId("m")
@ -148,7 +154,7 @@ ScrollView {
Layout.leftMargin: 2
}
StyledText {
StatusBaseText {
font.pixelSize: 15
//% "L"
text: qsTrId("l")
@ -156,7 +162,7 @@ ScrollView {
Layout.leftMargin: 2
}
StyledText {
StatusBaseText {
font.pixelSize: 15
//% "XL"
text: qsTrId("xl")
@ -164,7 +170,7 @@ ScrollView {
Layout.leftMargin: 0
}
StyledText {
StatusBaseText {
font.pixelSize: 15
//% "XXL"
text: qsTrId("xxl")
@ -173,7 +179,7 @@ ScrollView {
}
}
StyledText {
StatusBaseText {
id: labelZoom
anchors.top: fontSizeSliderLegend.bottom
anchors.topMargin: Style.current.xlPadding
@ -185,7 +191,7 @@ ScrollView {
StatusSlider {
id: zoomSlider
readonly property int initialValue: {
let scaleFactorStr = utilsModel.readTextFile(uiScaleFilePath)
let scaleFactorStr = root.store.readTextFile(uiScaleFilePath)
if (scaleFactorStr === "") {
return 100
}
@ -204,7 +210,7 @@ ScrollView {
value: initialValue
onValueChanged: {
if (value !== initialValue) {
utilsModel.writeTextFile(uiScaleFilePath, value / 100.0)
root.store.writeTextFile(uiScaleFilePath, value / 100.0)
}
}
onPressedChanged: {
@ -229,7 +235,7 @@ ScrollView {
anchors.right: parent.right
spacing: 0
StyledText {
StatusBaseText {
font.pixelSize: 15
text: "50%"
}
@ -238,7 +244,7 @@ ScrollView {
Layout.fillWidth: true
}
StyledText {
StatusBaseText {
font.pixelSize: 15
Layout.leftMargin: width / 2
text: "100%"
@ -248,7 +254,7 @@ ScrollView {
Layout.fillWidth: true
}
StyledText {
StatusBaseText {
font.pixelSize: 15
Layout.leftMargin: width / 2
text: "150%"
@ -258,60 +264,12 @@ ScrollView {
Layout.fillWidth: true
}
StyledText {
StatusBaseText {
font.pixelSize: 15
text: "200%"
}
}
// StatusSectionHeadline {
// id: sectionHeadlineChatMode
// //% "Chat mode"
// text: qsTrId("chat-mode")
// anchors.top: fontSizeSliderLegend.bottom
// anchors.topMargin: Style.current.padding*2
// anchors.left: parent.left
// anchors.right: parent.right
// }
// RowLayout {
// id: chatModeSection
// anchors.top: sectionHeadlineChatMode.bottom
// anchors.topMargin: Style.current.padding
// anchors.left: parent.left
// anchors.leftMargin: -Style.current.padding
// anchors.right: parent.right
// anchors.rightMargin: -Style.current.padding
// StatusImageRadioButton {
// padding: Style.current.padding
// image.source: Style.svg("appearance-normal-light")
// image.height: 186
// //% "Normal"
// control.text: qsTrId("normal")
// control.checked: !appSettings.useCompactMode
// onRadioCheckedChanged: {
// if (checked) {
// appSettings.useCompactMode = false
// }
// }
// }
// StatusImageRadioButton {
// padding: Style.current.padding
// image.source: Style.svg("appearance-compact-light")
// image.height: 186
// //% "Compact"
// control.text: qsTrId("compact")
// control.checked: appSettings.useCompactMode
// onRadioCheckedChanged: {
// if (checked) {
// appSettings.useCompactMode = true
// }
// }
// }
// }
StatusSectionHeadline {
id: sectionHeadlineAppearance
//% "Appearance"

View File

@ -1,11 +1,16 @@
import QtQuick 2.13
import QtQuick.Layouts 1.13
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Components 0.1
import StatusQ.Controls 0.1
import utils 1.0
import "../../../../shared"
import "../../../../shared/status"
import "Privileges/"
import "BrowserModals"
import "../popups"
Item {
id: root
@ -13,7 +18,10 @@ Item {
Layout.fillWidth: true
clip: true
property var store
property Component dappListPopup: DappList {
store: root.store
onClosed: destroy()
}
property Component homePagePopup: HomepageModal {}
@ -22,7 +30,7 @@ Item {
Item {
anchors.top: parent.top
anchors.topMargin: topMargin
anchors.topMargin: 64
anchors.bottom: parent.bottom
width: profileContainer.profileContentWidth
@ -38,6 +46,7 @@ Item {
bottomPadding: Style.current.bigPadding
}
// TODO: Replace with StatusQ StatusListItem component
StatusSettingsLineButton {
//% "Homepage"
text: qsTrId("homepage")
@ -46,6 +55,7 @@ Item {
onClicked: homePagePopup.createObject(root).open()
}
// TODO: Replace with StatusQ StatusListItem component
StatusSettingsLineButton {
//% "Show favorites bar"
text: qsTrId("show-favorites-bar")
@ -56,6 +66,7 @@ Item {
}
}
// TODO: Replace with StatusQ StatusListItem component
StatusSettingsLineButton {
//% "Search engine used in the address bar"
text: qsTrId("search-engine-used-in-the-address-bar")
@ -72,6 +83,7 @@ Item {
onClicked: searchEngineModal.createObject(root).open()
}
// TODO: Replace with StatusQ StatusListItem component
StatusSettingsLineButton {
id: ethereumExplorerBtn
//% "Ethereum explorer used in the address bar"
@ -88,11 +100,11 @@ Item {
}
onClicked: ethereumExplorerModal.createObject(root).open()
}
StyledText {
StatusBaseText {
//% "Open an ethereum explorer after a transaction hash or an address is entered"
text: qsTrId("open-an-ethereum-explorer-after-a-transaction-hash-or-an-address-is-entered")
font.pixelSize: 15
color: Style.current.secondaryText
color: Theme.palette.baseColor1
width: parent.width - 150
wrapMode: Text.WordWrap
bottomPadding: Style.current.bigPadding
@ -114,6 +126,7 @@ Item {
bottomPadding: Style.current.padding
}
// TODO: Replace with StatusQ StatusListItem component
StatusSettingsLineButton {
//% "Set DApp access permissions"
text: qsTrId("set-dapp-access-permissions")

View File

@ -6,10 +6,15 @@ import utils 1.0
import "../../../../shared"
import "../../../../shared/status/core"
import "../../../../shared/status"
import "./Contacts"
import "../panels"
import "../popups"
Item {
id: contactsContainer
id: root
property var store
property alias searchStr: searchBox.text
property bool isPending: false
height: parent.height
@ -71,7 +76,7 @@ Item {
anchors.top: addNewContact.bottom
anchors.topMargin: Style.current.bigPadding
width: parent.width
visible: profileModel.contacts.blockedContacts.rowCount() > 0
visible: root.store.blockedContacts.rowCount() > 0
height: 64
StatusRoundButton {
@ -96,7 +101,7 @@ Item {
StyledText {
id: numberOfBlockedContacts
text: profileModel.contacts.blockedContacts.rowCount()
text: root.store.blockedContacts.rowCount()
color: Style.current.darkGrey
anchors.right: parent.right
anchors.rightMargin: Style.current.padding
@ -118,10 +123,10 @@ Item {
//% "Blocked contacts"
title: qsTrId("blocked-contacts")
ContactList {
ContactsListPanel {
anchors.top: parent.top
anchors.bottom: parent.bottom
contacts: profileModel.contacts.blockedContacts
contacts: root.store.blockedContacts
}
}
@ -142,7 +147,7 @@ Item {
function validate(value) {
if (!Utils.isChatKey(value) && !Utils.isValidETHNamePrefix(value)) {
addContactModal.validationError = qsTr("Enter a valid chat key or ENS username");
} else if (profileModel.profile.pubKey === value) {
} else if (root.store.pubKey === value) {
//% "You can't add yourself"
addContactModal.validationError = qsTrId("you-can-t-add-yourself");
} else {
@ -152,9 +157,9 @@ Item {
}
property var lookupContact: Backpressure.debounce(addContactSearchInput, 400, function (value) {
contactsContainer.isPending = true
root.isPending = true
searchResults.showProfileNotFoundMessage = false
profileModel.contacts.lookupContact(value)
root.store.lookupContact(value)
})
onOpened: {
@ -175,7 +180,7 @@ Item {
}
if (!addContactModal.validate(addContactSearchInput.text)) {
searchResults.reset();
contactsContainer.isPending = false;
root.isPending = false;
return;
}
@ -184,19 +189,19 @@ Item {
Connections {
target: profileModel.contacts
target: root.store.contacts
onEnsWasResolved: {
if (resolvedPubKey === "") {
searchResults.pubKey = ""
searchResults.showProfileNotFoundMessage = true
contactsContainer.isPending = false
root.isPending = false
return
}
searchResults.username = Utils.isChatKey(addContactSearchInput.text) ? utilsModel.generateAlias(resolvedPubKey) : Utils.addStatusEns(addContactSearchInput.text.trim())
searchResults.username = Utils.isChatKey(addContactSearchInput.text) ? root.store.generateAlias(resolvedPubKey) : Utils.addStatusEns(addContactSearchInput.text.trim())
searchResults.userAlias = Utils.compactAddress(resolvedPubKey, 4)
searchResults.pubKey = resolvedPubKey
searchResults.showProfileNotFoundMessage = false
contactsContainer.isPending = false
root.isPending = false
}
}
}
@ -216,35 +221,79 @@ Item {
id: searchResults
anchors.top: addContactSearchInput.bottom
anchors.topMargin: Style.current.xlPadding
loading: contactsContainer.isPending
loading: root.isPending
resultClickable: false
onAddToContactsButtonClicked: profileModel.contacts.addContact(pubKey)
onAddToContactsButtonClicked: root.store.addContact(pubKey)
}
}
ContactList {
ContactsListPanel {
id: contactListView
anchors.top: blockedContactsButton.visible ? blockedContactsButton.bottom : addNewContact.bottom
anchors.topMargin: Style.current.bigPadding
anchors.bottom: parent.bottom
contacts: profileModel.contacts.addedContacts
contacts: root.store.addedContacts
hideBlocked: true
searchString: searchBox.text
onContactClicked: {
root.store.changeAppSection(Constants.chat)
root.store.joinPrivateChat(contact.address)
}
onSendMessageActionTriggered: {
root.store.changeAppSection(Constants.chat)
root.store.joinPrivateChat(contact.address)
}
onBlockContactActionTriggered: {
blockContactConfirmationDialog.contactName = Utils.removeStatusEns(contact.name)
blockContactConfirmationDialog.contactAddress = contact.address
blockContactConfirmationDialog.open()
}
onRemoveContactActionTriggered: {
removeContactConfirmationDialog.value = contact.address
removeContactConfirmationDialog.open()
}
onUnblockContactActionTriggered: {
root.store.unblockContact(contact.address)
}
}
NoFriendsRectangle {
id: element
visible: profileModel.contacts.addedContacts.rowCount() === 0
visible: root.store.addedContacts.rowCount() === 0
//% "You dont have any contacts yet"
text: qsTrId("you-don-t-have-any-contacts-yet")
width: parent.width
anchors.verticalCenter: parent.verticalCenter
}
}
// TODO: Make BlockContactConfirmationDialog a dynamic component on a future refactor
BlockContactConfirmationDialog {
id: blockContactConfirmationDialog
onBlockButtonClicked: {
root.store.blockContact(blockContactConfirmationDialog.contactAddress)
blockContactConfirmationDialog.close()
}
}
// TODO: Make ConfirmationDialog a dynamic component on a future refactor
ConfirmationDialog {
id: removeContactConfirmationDialog
//% "Remove contact"
header.title: qsTrId("remove-contact")
//% "Are you sure you want to remove this contact?"
confirmationText: qsTrId("are-you-sure-you-want-to-remove-this-contact-")
onConfirmButtonClicked: {
if (root.store.isContactAdded(removeContactConfirmationDialog.value)) {
root.store.removeContact(removeContactConfirmationDialog.value);
}
removeContactConfirmationDialog.close()
}
}
}
/*##^##
Designer {
D{i:0;autoSize:true;formeditorColor:"#ffffff";formeditorZoom:0.6600000262260437;height:480;width:600}
}
##^##*/

View File

@ -3,13 +3,18 @@ import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import QtGraphicalEffects 1.13
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
import utils 1.0
import "../../../../shared"
import "../../../../shared/status"
Item {
id: syncContainer
id: root
property var store
property bool isSyncing: false
width: 200
@ -20,15 +25,15 @@ Item {
Item {
id: firstTimeSetup
anchors.left: syncContainer.left
anchors.left: root.left
anchors.leftMargin: Style.current.padding
anchors.top: parent.top
anchors.topMargin: 24
anchors.right: syncContainer.right
anchors.right: root.right
anchors.rightMargin: Style.current.padding
visible: !profileModel.devices.isSetup
visible: !root.store.devicesSetup
StyledText {
StatusBaseText {
id: deviceNameLbl
//% "Please set a name for your device."
text: qsTrId("pairing-please-set-a-name")
@ -43,6 +48,7 @@ Item {
anchors.topMargin: Style.current.padding
}
// TODO: replace with StatusQ component
StatusButton {
anchors.top: deviceNameTxt.bottom
anchors.topMargin: 10
@ -50,19 +56,19 @@ Item {
//% "Continue"
text: qsTrId("continue")
enabled: deviceNameTxt.text !== ""
onClicked : profileModel.devices.setName(deviceNameTxt.text.trim())
onClicked : root.store.setDeviceName(deviceNameTxt.text.trim())
}
}
Item {
id: advertiseDeviceItem
anchors.left: syncContainer.left
anchors.left: root.left
anchors.leftMargin: Style.current.padding
anchors.top: parent.top
anchors.topMargin: Style.current.padding
anchors.right: syncContainer.right
anchors.right: root.right
anchors.rightMargin: Style.current.padding
visible: profileModel.devices.isSetup
visible: root.store.devicesSetup
height: childrenRect.height
Rectangle {
@ -87,18 +93,18 @@ Item {
}
}
StyledText {
StatusBaseText {
id: advertiseDeviceTitle
//% "Advertise device"
text: qsTrId("pair-this-device")
font.pixelSize: 18
font.weight: Font.Bold
color: Style.current.blue
color: Theme.palette.primaryColor1
anchors.left: advertiseImg.right
anchors.leftMargin: Style.current.padding
}
StyledText {
StatusBaseText {
id: advertiseDeviceDesk
//% "Pair your devices to sync contacts and chats between them"
text: qsTrId("pair-this-device-description")
@ -112,17 +118,17 @@ Item {
MouseArea {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: profileModel.devices.advertise()
onClicked: root.store.advertiseDevice()
}
}
StyledText {
StatusBaseText {
anchors.top: advertiseDevice.bottom
anchors.topMargin: Style.current.padding
//% "Learn more"
text: qsTrId("learn-more")
font.pixelSize: 16
color: Style.current.blue
color: Theme.palette.primaryColor1
anchors.left: parent.left
MouseArea {
cursorShape: Qt.PointingHandCursor
@ -135,18 +141,18 @@ Item {
Item {
id: deviceListItem
anchors.left: syncContainer.left
anchors.left: root.left
anchors.leftMargin: Style.current.padding
anchors.top: advertiseDeviceItem.bottom
anchors.topMargin: Style.current.padding * 2
anchors.bottom: syncAllBtn.top
anchors.bottomMargin: Style.current.padding
anchors.right: syncContainer.right
anchors.right: root.right
anchors.rightMargin: Style.current.padding
visible: profileModel.devices.isSetup
visible: root.store.devicesSetup
StyledText {
StatusBaseText {
id: deviceListLbl
//% "Paired devices"
text: qsTrId("paired-devices")
@ -162,6 +168,7 @@ Item {
spacing: 5
anchors.right: parent.right
anchors.left: parent.left
// TODO: replace with StatusQ component
delegate: Item {
height: childrenRect.height
SVGImage {
@ -175,7 +182,7 @@ Item {
color: Style.current.blue
}
}
StyledText {
StatusBaseText {
id: deviceItemLbl
text: {
let deviceId = model.installationId.split("-")[0].substr(0, 5)
@ -197,16 +204,17 @@ Item {
anchors.left: deviceItemLbl.right
anchors.leftMargin: Style.current.padding
anchors.top: deviceItemLbl.top
onClicked: profileModel.devices.enableInstallation(model.installationId, devicePairedSwitch)
onClicked: root.store.enableDeviceInstallation(model.installationId, devicePairedSwitch)
}
}
model: profileModel.devices.list
model: root.store.devicesList
}
}
// TODO: replace with StatusQ component
StatusButton {
id: syncAllBtn
anchors.bottom: syncContainer.bottom
anchors.bottom: root.bottom
anchors.bottomMargin: Style.current.padding
anchors.horizontalCenter: parent.horizontalCenter
text: isSyncing ?
@ -217,7 +225,7 @@ Item {
enabled: !isSyncing
onClicked : {
isSyncing = true;
profileModel.devices.syncAll()
root.store.syncAllDevices()
// Currently we don't know how long it takes, so we just disable for 10s, to avoid spamming
timer.setTimeout(function(){
isSyncing = false

View File

@ -3,14 +3,16 @@ import QtQuick.Layouts 1.3
import QtQuick.Controls 2.14
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/status"
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
Item {
property string ensUsername: ""
signal okBtnClicked()
StyledText {
StatusBaseText {
id: sectionTitle
//% "ENS usernames"
text: qsTrId("ens-usernames")
@ -23,6 +25,7 @@ Item {
}
// TODO: replace with StatusQ component
Rectangle {
id: circle
anchors.top: sectionTitle.bottom
@ -31,20 +34,20 @@ Item {
width: 60
height: 60
radius: 120
color: Style.current.blue
color: Theme.palette.primaryColor1
StyledText {
StatusBaseText {
text: "✓"
opacity: 0.7
font.weight: Font.Bold
font.pixelSize: 18
color: Style.current.white
color: Theme.palette.indirectColor1
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
}
StyledText {
StatusBaseText {
id: title
//% "Username added"
text: qsTrId("ens-saved-title")
@ -58,7 +61,7 @@ Item {
wrapMode: Text.WordWrap
}
StyledText {
StatusBaseText {
id: subtitle
//% "%1 is now connected with your chat key and can be used in Status."
text: qsTrId("-1-is-now-connected-with-your-chat-key-and-can-be-used-in-status-").arg(ensUsername)

View File

@ -3,14 +3,16 @@ import QtQuick.Layouts 1.3
import QtQuick.Controls 2.14
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/status"
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
Item {
property string ensUsername: ""
signal okBtnClicked()
StyledText {
StatusBaseText {
id: sectionTitle
//% "ENS usernames"
text: qsTrId("ens-usernames")
@ -23,6 +25,7 @@ Item {
}
// TODO: Replace with StatusQ component
Rectangle {
id: circle
anchors.top: sectionTitle.bottom
@ -31,20 +34,20 @@ Item {
width: 60
height: 60
radius: 120
color: Style.current.blue
color: Theme.palette.primaryColor1
StyledText {
StatusBaseText {
text: "✓"
opacity: 0.7
font.weight: Font.Bold
font.pixelSize: 18
color: Style.current.white
color: Theme.palette.indirectColor1
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
}
StyledText {
StatusBaseText {
id: title
//% "Username added"
text: qsTrId("ens-saved-title")
@ -58,7 +61,7 @@ Item {
wrapMode: Text.WordWrap
}
StyledText {
StatusBaseText {
id: subtitle
//% "%1 will be connected once the transaction is complete."
text: qsTrId("-1-will-be-connected-once-the-transaction-is-complete-").arg(ensUsername)
@ -71,7 +74,7 @@ Item {
wrapMode: Text.WordWrap
}
StyledText {
StatusBaseText {
id: progress
//% "You can follow the progress in the Transaction History section of your wallet."
text: qsTrId("ens-username-you-can-follow-progress")
@ -82,7 +85,7 @@ Item {
anchors.right: parent.right
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
color: Style.current.secondaryText
color: Theme.palette.directColor7
}

View File

@ -2,12 +2,18 @@ import QtQuick 2.14
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.14
import StatusQ.Core 0.1
import StatusQ.Controls 0.1
import StatusQ.Components 0.1
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/status/core"
import "../../../../../shared/status"
import "../../../../shared"
import "../../../../shared/status/core"
import "../../../../shared/status"
Item {
id: root
property var store
property string username: ""
property string walletAddress: "-"
property string key: "-"
@ -16,7 +22,7 @@ Item {
signal backBtnClicked();
signal usernameReleased(username: string);
StyledText {
StatusBaseText {
id: sectionTitle
text: username
anchors.left: parent.left
@ -29,6 +35,7 @@ Item {
Component {
id: loadingImageComponent
// TODO: replace with StatusQ loading indicator
StatusLoadingIndicator {}
}
@ -43,17 +50,15 @@ Item {
}
Connections {
target: profileModel.ens
target: root.store.ens
onDetailsObtained: {
if(username != ensName) return;
walletAddressLbl.text = address;
walletAddressLbl.textToCopy = address;
keyLbl.text = pubkey.substring(0, 20) + "..." + pubkey.substring(pubkey.length - 20);
keyLbl.textToCopy = pubkey;
walletAddressLbl.subTitle = address;
keyLbl.subTitle = pubkey.substring(0, 20) + "..." + pubkey.substring(pubkey.length - 20);
walletAddressLbl.visible = true;
keyLbl.visible = true;
releaseBtn.visible = isStatus
releaseBtn.enabled = (Date.now() / 1000) > expirationTime && expirationTime > 0 && profileModel.ens.preferredUsername != username
releaseBtn.enabled = (Date.now() / 1000) > expirationTime && expirationTime > 0 && root.store.preferredUsername != username
expiration = new Date(expirationTime * 1000).getTime()
}
onLoading: {
@ -66,37 +71,38 @@ Item {
}
}
TextWithLabel {
StatusDescriptionListItem {
id: walletAddressLbl
//% "Wallet address"
label: qsTrId("wallet-address")
title: qsTr("Wallet address")
visible: false
text: ""
textToCopy: ""
anchors.left: parent.left
anchors.leftMargin: 24
anchors.top: sectionTitle.bottom
anchors.topMargin: 24
icon.name: "copy"
tooltip.text: qsTr("Copied to clipboard!")
iconButton.onClicked: {
root.store.copyToClipboard(subTitle)
tooltip.visible = !tooltip.visible
}
}
TextWithLabel {
StatusDescriptionListItem {
id: keyLbl
title: qsTr("Key")
visible: false
//% "Key"
label: qsTrId("key")
text: ""
textToCopy: ""
anchors.left: parent.left
anchors.leftMargin: 24
anchors.top: walletAddressLbl.bottom
anchors.topMargin: 24
icon.name: "copy"
tooltip.text: qsTr("Copied to clipboard!")
iconButton.onClicked: {
root.store.copyToClipboard(subTitle)
tooltip.visible = !tooltip.visible
}
}
Component {
id: transactionDialogComponent
StatusETHTransactionModal {
onOpened: {
walletModel.gasView.getGasPricePredictions()
root.store.getGasPricePredictions()
}
title: qsTr("Connect username with your pubkey")
onClosed: {
@ -104,14 +110,14 @@ Item {
}
estimateGasFunction: function(selectedAccount) {
if (username === "" || !selectedAccount) return 100000;
return profileModel.ens.releaseEstimate(Utils.removeStatusEns(username), selectedAccount.address)
return root.store.releaseEnsEstimate(Utils.removeStatusEns(username), selectedAccount.address)
}
onSendTransaction: function(selectedAddress, gasLimit, gasPrice, password) {
return profileModel.ens.release(username,
selectedAddress,
gasLimit,
gasPrice,
password)
return root.store.releaseEns(username,
selectedAddress,
gasLimit,
gasPrice,
password)
}
onSuccess: function(){
usernameReleased(username);

View File

@ -3,14 +3,22 @@ import QtQuick.Layouts 1.3
import QtQuick.Controls 2.14
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/status"
import "../../../Chat/ChatColumn/MessageComponents"
import "../../../../shared"
import "../../../../shared/status"
import "../../Chat/ChatColumn/MessageComponents"
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import "../popups"
Item {
id: root
signal addBtnClicked()
signal selectEns(string username)
property var store
// Defaults to show message
property bool isMessage: true
property bool isEmoji: false
@ -22,11 +30,11 @@ Item {
property string authorPrevMsg: "1"
property bool isText: true
property var clickMessage: function(){}
property string identicon: profileModel.profile.identicon
property string identicon: store.identicon
property int timestamp: 1577872140
function shouldDisplayExampleMessage(){
return profileModel.ens.rowCount() > 0 && profileModel.ens.pendingLen() !== profileModel.ens.rowCount() && profileModel.ens.preferredUsername !== ""
return store.ens.rowCount() > 0 && store.ensPendingLen() !== store.ens.rowCount() && store.preferredUsername !== ""
}
anchors.fill: parent
@ -88,14 +96,14 @@ Item {
width: 35
height: 35
radius: 35
color: Style.current.blue
color: Theme.palette.primaryColor1
StyledText {
StatusBaseText {
text: "@"
opacity: 0.7
font.weight: Font.Bold
font.pixelSize: 16
color: Style.current.white
color: Theme.palette.indirectColor1
anchors.centerIn: parent
verticalAlignment: Text.AlignVCenter
anchors.verticalCenter: parent.verticalCenter
@ -117,7 +125,7 @@ Item {
id: ensPopup
}
StyledText {
StatusBaseText {
id: sectionTitle
//% "ENS usernames"
text: qsTrId("ens-usernames")
@ -144,11 +152,11 @@ Item {
anchors.verticalCenter: parent.verticalCenter
}
StyledText {
StatusBaseText {
id: usernameText
//% "Add username"
text: qsTrId("ens-add-username")
color: Style.current.blue
color: Theme.palette.primaryColor1
anchors.left: addButton.right
anchors.leftMargin: Style.current.padding
anchors.verticalCenter: addButton.verticalCenter
@ -163,7 +171,7 @@ Item {
}
StyledText {
StatusBaseText {
id: usernamesLabel
//% "Your usernames"
text: qsTrId("ens-your-usernames")
@ -192,7 +200,7 @@ Item {
ListView {
id: lvEns
anchors.fill: parent
model: profileModel.ens
model: root.store.ens
spacing: 10
clip: true
delegate: ensDelegate
@ -206,9 +214,9 @@ Item {
anchors.top: ensList.bottom
}
StyledText {
StatusBaseText {
id: chatSettingsLabel
visible: profileModel.ens.rowCount() > 0 && profileModel.ens.pendingLen() != profileModel.ens.rowCount()
visible: root.store.ens.rowCount() > 0 && root.store.ensPendingLen() != root.store.ens.rowCount()
//% "Chat settings"
text: qsTrId("chat-settings")
anchors.left: parent.left
@ -226,7 +234,7 @@ Item {
anchors.top: chatSettingsLabel.bottom
anchors.topMargin: 24
StyledText {
StatusBaseText {
id: usernameLabel
visible: chatSettingsLabel.visible
//% "Primary Username"
@ -235,11 +243,11 @@ Item {
font.weight: Font.Bold
}
StyledText {
StatusBaseText {
id: usernameLabel2
visible: chatSettingsLabel.visible
//% "None selected"
text: profileModel.ens.preferredUsername || qsTrId("none-selected")
text: root.store.preferredUsername || qsTrId("none-selected")
anchors.left: usernameLabel.right
anchors.leftMargin: Style.current.padding
font.pixelSize: 14
@ -268,7 +276,7 @@ Item {
UsernameLabel {
id: chatName
label.text: "@" + (profileModel.ens.preferredUsername.replace(".stateofus.eth", ""))
label.text: "@" + (root.store.preferredUsername.replace(".stateofus.eth", ""))
label.color: Style.current.blue
anchors.leftMargin: 20
anchors.top: parent.top
@ -310,14 +318,14 @@ Item {
anchors.rightMargin: Style.current.padding
}
StyledText {
StatusBaseText {
anchors.top: chatTime.bottom
anchors.left: chatImage.left
anchors.topMargin: Style.current.padding
//% "Youre displaying your ENS username in chats"
text: qsTrId("you-re-displaying-your-ens-username-in-chats")
font.pixelSize: 14
color: Style.current.secondaryText
color: Theme.palette.baseColor1
}
@ -325,7 +333,7 @@ Item {
Connections {
target: profileModel.ens
target: root.store.ens
onPreferredUsernameChanged: {
messagesShownAs.visible = shouldDisplayExampleMessage()
}
@ -336,3 +344,4 @@ Item {
}
}
}

View File

@ -3,14 +3,18 @@ import QtQuick.Layouts 1.3
import QtQuick.Controls 2.14
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/status"
import "../../../../shared"
import "../../../../shared/status"
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
Item {
property string ensUsername: ""
signal okBtnClicked()
StyledText {
StatusBaseText {
id: sectionTitle
//% "ENS usernames"
text: qsTrId("ens-usernames")
@ -23,6 +27,7 @@ Item {
}
// Replace with StatusQ component
Rectangle {
id: circle
anchors.top: sectionTitle.bottom
@ -31,20 +36,20 @@ Item {
width: 60
height: 60
radius: 120
color: Style.current.blue
color: Theme.palette.primaryColor1
StyledText {
StatusBaseText {
text: "✓"
opacity: 0.7
font.weight: Font.Bold
font.pixelSize: 18
color: Style.current.white
color: Theme.palette.indirectColor1
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
}
StyledText {
StatusBaseText {
id: title
//% "Username added"
text: qsTrId("ens-saved-title")
@ -58,7 +63,7 @@ Item {
wrapMode: Text.WordWrap
}
StyledText {
StatusBaseText {
id: subtitle
//% "Nice! You own %1.stateofus.eth once the transaction is complete."
text: qsTrId("nice--you-own--1-stateofus-eth-once-the-transaction-is-complete-").arg(ensUsername)
@ -71,7 +76,7 @@ Item {
wrapMode: Text.WordWrap
}
StyledText {
StatusBaseText {
id: progress
//% "You can follow the progress in the Transaction History section of your wallet."
text: qsTrId("ens-username-you-can-follow-progress")
@ -82,7 +87,7 @@ Item {
anchors.right: parent.right
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
color: Style.current.secondaryText
color: Theme.palette.directColor7
}

View File

@ -3,14 +3,16 @@ import QtQuick.Layouts 1.3
import QtQuick.Controls 2.14
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/status"
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
Item {
property string ensUsername: ""
signal okBtnClicked()
StyledText {
StatusBaseText {
id: sectionTitle
//% "ENS usernames"
text: qsTrId("ens-usernames")
@ -23,6 +25,7 @@ Item {
}
// TODO: replace with StatusQ component
Rectangle {
id: circle
anchors.top: sectionTitle.bottom
@ -31,20 +34,20 @@ Item {
width: 60
height: 60
radius: 120
color: Style.current.blue
color: Theme.palette.primaryColor1
StyledText {
StatusBaseText {
text: "✓"
opacity: 0.7
font.weight: Font.Bold
font.pixelSize: 18
color: Style.current.white
color: Theme.palette.indirectColor1
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
}
StyledText {
StatusBaseText {
id: title
text: qsTr("Username removed")
anchors.top: circle.bottom
@ -57,7 +60,7 @@ Item {
wrapMode: Text.WordWrap
}
StyledText {
StatusBaseText {
id: subtitle
text: qsTr("The username %1 will be removed and your deposit will be returned once the transaction is mined").arg(ensUsername)
anchors.top: title.bottom
@ -69,7 +72,7 @@ Item {
wrapMode: Text.WordWrap
}
StyledText {
StatusBaseText {
id: progress
//% "You can follow the progress in the Transaction History section of your wallet."
text: qsTrId("ens-username-you-can-follow-progress")
@ -80,7 +83,7 @@ Item {
anchors.right: parent.right
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
color: Style.current.secondaryText
color: Theme.palette.directColor7
}

View File

@ -2,12 +2,17 @@ import QtQuick 2.14
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.14
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/status"
import "../../../../shared"
import "../../../../shared/status"
Item {
id: searchENS
id: root
property var store
signal continueClicked(string output, string username)
signal usernameUpdated(username: string);
@ -19,8 +24,8 @@ Item {
property bool loading: false
property string ensStatus: ""
property var validateENS: Backpressure.debounce(searchENS, 500, function (ensName, isStatus){
profileModel.ens.validate(ensName, isStatus)
property var validateENS: Backpressure.debounce(root, 500, function (ensName, isStatus){
store.validateEns(ensName, isStatus)
});
function validate(ensUsername) {
@ -52,7 +57,7 @@ Item {
id: transactionDialogComponent
StatusETHTransactionModal {
onOpened: {
walletModel.gasView.getGasPrice()
root.store.getGasPrice()
}
title: qsTr("Connect username with your pubkey")
onClosed: {
@ -60,10 +65,10 @@ Item {
}
estimateGasFunction: function(selectedAccount) {
if (ensUsername.text === "" || !selectedAccount) return 80000;
return profileModel.ens.setPubKeyGasEstimate(ensUsername.text + (isStatus ? ".stateofus.eth" : "" ), selectedAccount.address)
return root.store.setPubKeyGasEstimate(ensUsername.text + (isStatus ? ".stateofus.eth" : "" ), selectedAccount.address)
}
onSendTransaction: function(selectedAddress, gasLimit, gasPrice, password) {
return profileModel.ens.setPubKey(ensUsername.text + (isStatus ? ".stateofus.eth" : "" ),
return root.store.setPubKey(ensUsername.text + (isStatus ? ".stateofus.eth" : "" ),
selectedAddress,
gasLimit,
gasPrice,
@ -92,7 +97,7 @@ Item {
width: 60
height: 60
radius: 120
color: Style.current.blue
color: Theme.palette.primaryColor1
SVGImage {
id: imgIcon
@ -105,7 +110,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter
}
StyledText {
StatusBaseText {
visible: ensStatus !== Constants.ens_taken
text: {
if((ensStatus === Constants.ens_available ||
@ -119,7 +124,7 @@ Item {
opacity: 0.7
font.weight: Font.Bold
font.pixelSize: 18
color: Style.current.white
color: Theme.palette.indirectColor1
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
@ -137,7 +142,7 @@ Item {
}
Connections {
target: profileModel.ens
target: root.store.ens
onEnsWasResolved: {
if(!validate(ensUsername.text)) return;
valid = false;
@ -162,6 +167,7 @@ Item {
}
}
// TODO: replace with StatusQ component
StatusRoundButton {
id: btnContinue
width: 44
@ -179,7 +185,7 @@ Item {
if(!valid) return;
if(ensStatus === Constants.ens_connected){
profileModel.ens.connectOwnedUsername(ensUsername.text, isStatus);
root.store.ensConnectOwnedUsername(ensUsername.text, isStatus);
continueClicked(ensStatus, ensUsername.text)
return;
}
@ -215,7 +221,7 @@ Item {
anchors.leftMargin: Style.current.padding
height: 20
StyledText {
StatusBaseText {
text: !isStatus ?
//% "Custom domain"
qsTrId("ens-custom-domain")
@ -224,10 +230,10 @@ Item {
font.weight: Font.Bold
font.pixelSize: 12
anchors.leftMargin: Style.current.padding
color: Style.current.textColor
color: Theme.palette.directColor1
}
StyledText {
StatusBaseText {
text: !isStatus ?
//% "I want a stateofus.eth domain"
qsTrId("ens-want-domain")
@ -235,7 +241,7 @@ Item {
//% "I own a name on another domain"
qsTrId("ens-want-custom-domain")
font.pixelSize: 12
color: Style.current.blue
color: Theme.palette.primaryColor1
anchors.right: parent.right
anchors.rightMargin: Style.current.padding
@ -253,7 +259,7 @@ Item {
}
}
StyledText {
StatusBaseText {
id: validationResult
text: validationMessage
anchors.horizontalCenter: parent.horizontalCenter
@ -264,3 +270,4 @@ Item {
}
}
}

View File

@ -3,16 +3,23 @@ import QtQuick.Layouts 1.3
import QtQuick.Controls 2.14
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/status"
import "../../../../shared"
import "../../../../shared/status"
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
import StatusQ.Components 0.1
Item {
id: root
property var store
property string username: ""
signal backBtnClicked();
signal usernameRegistered(userName: string);
StyledText {
StatusBaseText {
id: sectionTitle
//% "ENS usernames"
text: qsTrId("ens-usernames")
@ -35,13 +42,13 @@ Item {
}
sourceComponent: StatusSNTTransactionModal {
assetPrice: "10"
contractAddress: utilsModel.ensRegisterAddress
contractAddress: root.store.ensRegisterAddress
estimateGasFunction: function(selectedAccount, uuid) {
if (username === "" || !selectedAccount) return 380000;
return profileModel.ens.registerENSGasEstimate(username, selectedAccount.address)
return root.store.registerEnsGasEstimate(username, selectedAccount.address)
}
onSendTransaction: function(selectedAddress, gasLimit, gasPrice, tipLimit, overallLimit, password) {
return profileModel.ens.registerENS(username,
return root.store.registerEns(username,
selectedAddress,
gasLimit,
tipLimit,
@ -58,6 +65,7 @@ Item {
}
}
// TODO: Replace with StatusModal
ModalPopup {
id: popup
//% "Terms of name registration"
@ -76,7 +84,7 @@ Item {
width: parent.width
StyledText {
StatusBaseText {
//% "Funds are deposited for 1 year. Your SNT will be locked, but not spent."
text: qsTrId("ens-terms-point-1")
wrapMode: Text.WordWrap
@ -84,7 +92,7 @@ Item {
anchors.right: parent.right
}
StyledText {
StatusBaseText {
//% "After 1 year, you can release the name and get your deposit back, or take no action to keep the name."
text: qsTrId("ens-terms-point-2")
wrapMode: Text.WordWrap
@ -92,7 +100,7 @@ Item {
anchors.right: parent.right
}
StyledText {
StatusBaseText {
//% "If terms of the contract change e.g. Status makes contract upgrades user has the right to release the username regardless of time held."
text: qsTrId("ens-terms-point-3")
wrapMode: Text.WordWrap
@ -100,7 +108,7 @@ Item {
anchors.right: parent.right
}
StyledText {
StatusBaseText {
//% "The contract controller cannot access your deposited funds. They can only be moved back to the address that sent them."
text: qsTrId("ens-terms-point-4")
wrapMode: Text.WordWrap
@ -108,7 +116,7 @@ Item {
anchors.right: parent.right
}
StyledText {
StatusBaseText {
//% "Your address(es) will be publicly associated with your ENS name."
text: qsTrId("ens-terms-point-5")
wrapMode: Text.WordWrap
@ -116,7 +124,7 @@ Item {
anchors.right: parent.right
}
StyledText {
StatusBaseText {
//% "Usernames are created as subdomain nodes of stateofus.eth and are subject to the ENS smart contract terms."
text: qsTrId("ens-terms-point-6")
wrapMode: Text.WordWrap
@ -124,7 +132,7 @@ Item {
anchors.right: parent.right
}
StyledText {
StatusBaseText {
//% "You authorize the contract to transfer SNT on your behalf. This can only occur when you approve a transaction to authorize the transfer."
text: qsTrId("ens-terms-point-7")
wrapMode: Text.WordWrap
@ -132,7 +140,7 @@ Item {
anchors.right: parent.right
}
StyledText {
StatusBaseText {
//% "These terms are guaranteed by the smart contract logic at addresses:"
text: qsTrId("ens-terms-point-8")
wrapMode: Text.WordWrap
@ -141,18 +149,18 @@ Item {
font.weight: Font.Bold
}
StyledText {
StatusBaseText {
//% "%1 (Status UsernameRegistrar)."
text: qsTrId("-1--status-usernameregistrar--").arg(profileModel.ens.getUsernameRegistrar())
text: qsTrId("-1--status-usernameregistrar--").arg(root.store.getEnsUsernameRegistrar())
wrapMode: Text.WordWrap
anchors.left: parent.left
anchors.right: parent.right
font.family: Style.current.fontHexRegular.name
}
StyledText {
StatusBaseText {
//% "<a href='%1%2'>Look up on Etherscan</a>"
text: qsTrId("-a-href---1-2--look-up-on-etherscan--a-").arg(walletModel.utilsView.etherscanLink.replace("/tx", "/address")).arg(profileModel.ens.getUsernameRegistrar())
text: qsTrId("-a-href---1-2--look-up-on-etherscan--a-").arg(root.store.etherscanLink.replace("/tx", "/address")).arg(root.store.getEnsUsernameRegistrar())
anchors.left: parent.left
anchors.right: parent.right
onLinkActivated: appMain.openLink(link)
@ -163,18 +171,18 @@ Item {
}
}
StyledText {
StatusBaseText {
//% "%1 (ENS Registry)."
text: qsTrId("-1--ens-registry--").arg(profileModel.ens.getENSRegistry())
text: qsTrId("-1--ens-registry--").arg(root.store.getEnsRegistry())
wrapMode: Text.WordWrap
anchors.left: parent.left
anchors.right: parent.right
font.family: Style.current.fontHexRegular.name
}
StyledText {
StatusBaseText {
//% "<a href='%1%2'>Look up on Etherscan</a>"
text: qsTrId("-a-href---1-2--look-up-on-etherscan--a-").arg(walletModel.utilsView.etherscanLink.replace("/tx", "/address")).arg(profileModel.ens.getENSRegistry())
text: qsTrId("-a-href---1-2--look-up-on-etherscan--a-").arg(root.store.etherscanLink.replace("/tx", "/address")).arg(root.store.getEnsRegistry())
anchors.left: parent.left
anchors.right: parent.right
onLinkActivated: appMain.openLink(link)
@ -216,7 +224,7 @@ Item {
radius: 120
color: Style.current.blue
StyledText {
StatusBaseText {
text: "@"
opacity: 0.7
font.weight: Font.Bold
@ -227,7 +235,7 @@ Item {
}
}
StyledText {
StatusBaseText {
id: ensUsername
text: username + ".stateofus.eth"
font.weight: Font.Bold
@ -239,29 +247,35 @@ Item {
horizontalAlignment: Text.AlignHCenter
}
TextWithLabel {
StatusDescriptionListItem {
id: walletAddressLbl
//% "Wallet address"
label: qsTrId("wallet-address")
text: walletModel.getDefaultAddress()
textToCopy: text
anchors.left: parent.left
anchors.leftMargin: 24
title: qsTrId("wallet-address")
subTitle: root.store.getWalletDefaultAddress()
tooltip.text: qsTr("Copied to clipboard!")
icon.name: "copy"
iconButton.onClicked: {
root.store.copyToClipboard(subTitle)
tooltip.visible = !tooltip.visible
}
anchors.top: ensUsername.bottom
anchors.topMargin: 24
}
TextWithLabel {
StatusDescriptionListItem {
id: keyLbl
//% "Key"
label: qsTrId("key")
text: {
let pubKey = profileModel.profile.pubKey;
title: qsTrId("key")
subTitle: {
let pubKey = root.store.pubKey;
return pubKey.substring(0, 20) + "..." + pubKey.substring(pubKey.length - 20);
}
textToCopy: profileModel.profile.pubKey
anchors.left: parent.left
anchors.leftMargin: 24
tooltip.text: qsTr("Copied to clipboard!")
icon.name: "copy"
iconButton.onClicked: {
root.store.copyToClipboard(root.store.pubKey)
tooltip.visible = !tooltip.visible
}
anchors.top: walletAddressLbl.bottom
anchors.topMargin: 24
}
@ -274,7 +288,7 @@ Item {
anchors.leftMargin: 24
}
StyledText {
StatusBaseText {
//% "Agree to <a href=\"#\">Terms of name registration.</a> I understand that my wallet address will be publicly connected to my username."
text: qsTrId("agree-to--a-href-------terms-of-name-registration---a--i-understand-that-my-wallet-address-will-be-publicly-connected-to-my-username-")
anchors.left: termsAndConditionsCheckbox.right
@ -315,25 +329,25 @@ Item {
sourceSize: Qt.size(width, height)
}
StyledText {
StatusBaseText {
id: ensPriceLbl
//% "10 SNT"
text: qsTrId("ens-10-SNT")
anchors.left: image1.right
anchors.leftMargin: 5
anchors.top: image1.top
color: Style.current.textColor
color: Theme.palette.directColor1
font.pixelSize: 14
}
StyledText {
StatusBaseText {
//% "Deposit"
text: qsTrId("ens-deposit")
anchors.left: image1.right
anchors.leftMargin: 5
anchors.topMargin: 5
anchors.top: ensPriceLbl.bottom
color: Style.current.secondaryText
color: Theme.palette.directColor7
font.pixelSize: 14
}
}
@ -344,12 +358,12 @@ Item {
anchors.bottomMargin: Style.current.padding
anchors.right: parent.right
anchors.rightMargin: Style.current.padding
text: parseFloat(utilsModel.getSNTBalance()) < 10 ?
text: parseFloat(root.store.getSntBalance()) < 10 ?
//% "Not enough SNT"
qsTrId("not-enough-snt") :
//% "Register"
qsTrId("ens-register")
enabled: parseFloat(utilsModel.getSNTBalance()) >= 10 && termsAndConditionsCheckbox.checked
enabled: parseFloat(root.store.getSntBalance()) >= 10 && termsAndConditionsCheckbox.checked
onClicked: appSettings.isWalletEnabled ? transactionDialog.open() : confirmationPopup.open()
}

View File

@ -5,14 +5,20 @@ import QtQml.StateMachine 1.14 as DSM
import utils 1.0
import "../../../../shared"
import "./Ens"
/* import "./Ens" */
import "../stores"
import "."
Item {
id: ensContainer
id: root
Layout.fillHeight: true
Layout.fillWidth: true
clip: true
property var store
property bool showSearchScreen: false
property string addedUsername: ""
property string selectedUsername: ""
@ -28,7 +34,7 @@ Item {
signal goToList();
function goToStart(){
if(profileModel.ens.rowCount() > 0 && networkGuarded){
if(root.store.ens.rowCount() > 0 && networkGuarded){
goToList();
} else {
goToWelcome();
@ -207,14 +213,16 @@ Item {
Component {
id: welcome
Welcome {
EnsWelcomeView {
username: root.store.username
onStartBtnClicked: next(null)
}
}
Component {
id: search
Search {
EnsSearchView {
store: root.store
onContinueClicked: {
if(output === "connected"){
connect(username)
@ -232,7 +240,8 @@ Item {
Component {
id: termsAndConditions
TermsAndConditions {
EnsTermsAndConditionsView {
store: root.store
username: selectedUsername
onBackBtnClicked: back();
onUsernameRegistered: done(userName);
@ -241,14 +250,14 @@ Item {
Component {
id: added
Added {
EnsAddedView {
onOkBtnClicked: next(null)
}
}
Component {
id: ensRegistered
ENSRegistered {
EnsRegisteredView {
ensUsername: selectedUsername
onOkBtnClicked: next(null)
}
@ -256,7 +265,7 @@ Item {
Component {
id: ensReleased
ENSReleased {
EnsReleasedView {
ensUsername: selectedUsername
onOkBtnClicked: next(null)
}
@ -264,7 +273,7 @@ Item {
Component {
id: ensConnected
ENSConnected {
EnsConnectedView {
ensUsername: selectedUsername
onOkBtnClicked: next(null)
}
@ -272,10 +281,11 @@ Item {
Component {
id: list
List {
EnsListView {
store: root.store
onAddBtnClicked: next("search")
onSelectEns: {
profileModel.ens.details(username)
root.store.ensDetails(username)
selectedUsername = username;
next("details")
}
@ -284,7 +294,8 @@ Item {
Component {
id: details
ENSDetails {
EnsDetailsView {
store: root.store
username: selectedUsername
onBackBtnClicked: back();
onUsernameReleased: {
@ -295,21 +306,21 @@ Item {
}
Connections {
target: ensContainer
target: root
onConnect: {
addedUsername = ensUsername;
}
}
Connections {
target: profileModel.ens
target: root.store.ens
onTransactionWasSent: {
//% "Transaction pending..."
toastMessage.title = qsTrId("ens-transaction-pending")
toastMessage.source = Style.svg("loading")
toastMessage.iconColor = Style.current.primary
toastMessage.iconRotates = true
toastMessage.link = `${walletModel.utilsView.etherscanLink}/${txResult}`
toastMessage.link = `${root.store.etherscanLink}/${txResult}`
toastMessage.open()
}
onTransactionCompleted: {
@ -340,8 +351,9 @@ Item {
toastMessage.iconColor = Style.current.danger
}
toastMessage.link = `${walletModel.utilsView.etherscanLink}/${txHash}`
toastMessage.link = `${root.store.etherscanLink}/${txHash}`
toastMessage.open()
}
}
}

View File

@ -2,13 +2,19 @@ import QtQuick 2.14
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.14
import StatusQ.Core 0.1
import StatusQ.Controls 0.1
import utils 1.0
import "../../../../../shared"
import "../../../../../shared/status"
import "../../../../shared"
import "../../../../shared/status"
Item {
id: root
signal startBtnClicked()
property string username: ""
ScrollView {
id: sview
clip: true
@ -34,7 +40,7 @@ Item {
source: Style.png("ens-header-" + Style.current.name + "@2x")
}
StyledText {
StatusBaseText {
id: title
//% "Get a universal username"
text: qsTrId("ens-get-name")
@ -48,7 +54,7 @@ Item {
wrapMode: Text.WordWrap
}
StyledText {
StatusBaseText {
id: subtitle
//% "ENS names transform those crazy-long addresses into unique usernames."
text: qsTrId("ens-welcome-hints")
@ -61,7 +67,7 @@ Item {
wrapMode: Text.WordWrap
}
StyledText {
StatusBaseText {
id: element1Number
text: "1"
anchors.left: parent.left
@ -72,7 +78,7 @@ Item {
font.pixelSize: 14
}
StyledText {
StatusBaseText {
id: element1Title
//% "Customize your chat name"
text: qsTrId("ens-welcome-point-customize-title")
@ -86,10 +92,10 @@ Item {
font.pixelSize: 14
}
StyledText {
StatusBaseText {
id: element1Subtitle
//% "An ENS name can replace your random 3-word name in chat. Be @yourname instead of %1."
text: qsTrId("an-ens-name-can-replace-your-random-3-word-name-in-chat--be--yourname-instead-of--1-").arg(profileModel.profile.username)
text: qsTrId("an-ens-name-can-replace-your-random-3-word-name-in-chat--be--yourname-instead-of--1-").arg(root.username)
anchors.left: element1Number.right
anchors.leftMargin: 24
anchors.top: element1Title.bottom
@ -99,7 +105,7 @@ Item {
font.pixelSize: 14
}
StyledText {
StatusBaseText {
id: element2Number
text: "2"
anchors.left: parent.left
@ -110,7 +116,7 @@ Item {
font.pixelSize: 14
}
StyledText {
StatusBaseText {
id: element2Title
//% "Simplify your ETH address"
text: qsTrId("ens-welcome-point-simplify-title")
@ -124,7 +130,7 @@ Item {
font.pixelSize: 14
}
StyledText {
StatusBaseText {
id: element2Subtitle
//% "You can receive funds to your easy-to-share ENS name rather than your hexadecimal hash (0x...)."
text: qsTrId("ens-welcome-point-simplify")
@ -137,7 +143,7 @@ Item {
font.pixelSize: 14
}
StyledText {
StatusBaseText {
id: element3Number
text: "3"
anchors.left: parent.left
@ -148,7 +154,7 @@ Item {
font.pixelSize: 14
}
StyledText {
StatusBaseText {
id: element3Title
//% "Receive transactions in chat"
text: qsTrId("ens-welcome-point-receive-title")
@ -162,7 +168,7 @@ Item {
font.pixelSize: 14
}
StyledText {
StatusBaseText {
id: element3Subtitle
//% "Others can send you funds via chat in one simple step."
text: qsTrId("ens-welcome-point-receive")
@ -175,7 +181,7 @@ Item {
font.pixelSize: 14
}
StyledText {
StatusBaseText {
id: element4Number
text: "4"
anchors.left: parent.left
@ -186,7 +192,7 @@ Item {
font.pixelSize: 14
}
StyledText {
StatusBaseText {
id: element4Title
//% "10 SNT to register"
text: qsTrId("ens-welcome-point-register-title")
@ -200,7 +206,7 @@ Item {
font.pixelSize: 14
}
StyledText {
StatusBaseText {
id: element4Subtitle
//% "Register once to keep the name forever. After 1 year you can release the name and get your SNT back."
text: qsTrId("ens-welcome-point-register")
@ -214,7 +220,7 @@ Item {
}
StyledText {
StatusBaseText {
id: element5Number
text: "@"
anchors.left: parent.left
@ -225,7 +231,7 @@ Item {
font.pixelSize: 14
}
StyledText {
StatusBaseText {
id: element5Title
//% "Already own a username?"
text: qsTrId("ens-welcome-point-verify-title")
@ -239,7 +245,7 @@ Item {
font.pixelSize: 14
}
StyledText {
StatusBaseText {
id: element5Subtitle
//% "You can verify and add any usernames you own in the next steps."
text: qsTrId("ens-welcome-point-verify")
@ -252,7 +258,7 @@ Item {
font.pixelSize: 14
}
StyledText {
StatusBaseText {
id: poweredBy
//% "Powered by Ethereum Name Services"
text: qsTrId("ens-powered-by")
@ -281,3 +287,4 @@ Item {
onClicked: startBtnClicked()
}
}

View File

@ -2,10 +2,15 @@ import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import utils 1.0
import "../../../../shared"
import "../../../../shared/status"
import "../panels"
Item {
id: helpContainer
height: parent.height
@ -132,12 +137,12 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
StyledText {
StatusBaseText {
id: faqLink
//% "Frequently asked questions"
text: qsTrId("faq")
font.pixelSize: 15
color: Style.current.blue
color: Theme.palette.primaryColor1
anchors.topMargin: Style.current.bigPadding
anchors.top: parent.top
@ -156,12 +161,12 @@ Item {
}
}
}
StyledText {
StatusBaseText {
id: issueLink
//% "Submit a bug"
text: qsTrId("submit-bug")
font.pixelSize: 15
color: Style.current.blue
color: Theme.palette.primaryColor1
anchors.topMargin: Style.current.bigPadding
anchors.top: faqLink.bottom
@ -181,11 +186,11 @@ Item {
}
}
StyledText {
StatusBaseText {
//% "Request a feature"
text: qsTrId("request-feature")
font.pixelSize: 15
color: Style.current.blue
color: Theme.palette.primaryColor1
anchors.topMargin: Style.current.bigPadding
anchors.top: issueLink.bottom

View File

@ -0,0 +1,51 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import utils 1.0
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Components 0.1
import "../popups"
Item {
id: languageContainer
Layout.fillHeight: true
Layout.fillWidth: true
clip: true
property var store
property Component languagePopup: LanguageModal {
store: languageContainer.store
}
Item {
anchors.top: parent.top
anchors.topMargin: 64
anchors.bottom: parent.bottom
width: profileContainer.profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter
Column {
id: generalColumn
width: parent.width
StatusListItem {
//% "Language"
title: qsTrId("language")
label: globalSettings.locale === "" ? qsTrId("default") : globalSettings.locale
components: [
StatusIcon {
icon: "chevron-down"
rotation: 270
color: Theme.palette.baseColor1
}
]
sensor.onClicked: languagePopup.createObject(languageContainer).open()
}
}
}
}

View File

@ -0,0 +1,64 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import StatusQ.Components 0.1
import utils 1.0
import "../../../../shared"
import "../panels"
Item {
property var store
property var changeProfileSection: function (sectionId) {
Config.currentMenuTab = sectionId
}
StatusNavigationPanelHeadline {
id: title
text: qsTr("Settings")
anchors.top: parent.top
anchors.topMargin: Style.current.padding
anchors.horizontalCenter: parent.horizontalCenter
}
ScrollView {
ScrollBar.horizontal.policy: Qt.ScrollBarAlwaysOff
contentHeight: profileMenu.height + 24
clip: true
anchors.right: parent.right
anchors.rightMargin: Style.current.smallPadding
anchors.left: parent.left
anchors.leftMargin: Style.current.smallPadding
anchors.top: title.bottom
anchors.topMargin: Style.current.padding
anchors.bottom: parent.bottom
MenuPanel {
id: profileMenu
mainMenuItems: store.mainMenuItems
settingsMenuItems: store.settingsMenuItems
extraMenuItems: store.extraMenuItems
selectedMenuItem: store.selectedMenuItem
browserMenuItemEnabled: store.browserMenuItemEnabled
onMenuItemClicked: {
if (!!menu_item.function_name && menu_item.function_name === "exit") {
return confirmDialog.open()
}
store.selectedMenuItem = menu_item.menu_id
}
}
}
ConfirmationDialog {
id: confirmDialog
header.title: qsTr("Sign out")
confirmationText: qsTr("Make sure you have your account password and seed phrase stored. Without them you can lock yourself out of your account and lose funds.")
confirmButtonLabel: qsTr("Sign out & Quit")
onConfirmButtonClicked: {
Qt.quit()
}
}
}

View File

@ -6,23 +6,37 @@ import utils 1.0
import "../../../../shared"
import "../../../../shared/status"
import "../popups"
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Components 0.1
Item {
property string ensName: profileModel.ens.preferredUsername ||
profileModel.ens.firstEnsUsername || ""
property string username: profileModel.profile.username
property string pubkey: profileModel.profile.pubKey
id: root
property var store
property string ensName: store.preferredUsername || store.firstEnsUsername || ""
property string username: store.username
property string pubkey: store.pubKey
id: profileHeaderContent
clip: true
height: parent.height
Layout.fillWidth: true
Component {
id: changeProfileModalComponent
ChangeProfilePicModal {}
ChangeProfilePicModal {
largeImage: store.profileLargeImage
hasIdentityImage: store.hasIdentityImage
onCropFinished: {
uploadError = store.uploadImage(selectedImage, aX, aY, bX, bY)
}
onRemoveImageButtonClicked: {
uploadError = store.removeImage()
}
}
}
Item {
@ -46,7 +60,7 @@ Item {
height: 64
border.width: 1
border.color: Style.current.border
source: profileModel.profile.thumbnailImage || ""
source: root.store.profileThumbnailImage
smooth: false
antialiasing: true
}
@ -67,26 +81,27 @@ Item {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
const popup = changeProfileModalComponent.createObject(profileHeaderContent);
const popup = changeProfileModalComponent.createObject(root);
popup.open()
}
}
}
StyledText {
StatusBaseText {
id: profileName
text: ensName !== "" ? ensName : username
text: root.ensName !== "" ? root.ensName : root.username
anchors.left: profileImgContainer.right
anchors.leftMargin: Style.current.halfPadding
anchors.top: profileImgContainer.top
anchors.topMargin: 4
font.weight: Font.Bold
font.pixelSize: 20
color: Theme.palette.directColor1
}
Address {
id: pubkeyText
text: ensName !== "" ? username : pubkey
text: root.ensName !== "" ? root.username : root.pubkey
anchors.bottom: profileImgContainer.bottom
anchors.left: profileName.left
anchors.bottomMargin: 4
@ -112,7 +127,6 @@ Item {
id: lineSeparator
anchors.top: profileImgContainer.bottom
anchors.topMargin: 36
}
}
@ -123,7 +137,7 @@ Item {
Image {
asynchronous: true
fillMode: Image.PreserveAspectFit
source: profileModel.qrCode(pubkey)
source: root.store.getQrCodeSource(pubkey)
anchors.verticalCenterOffset: 20
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
@ -142,12 +156,12 @@ Item {
StatusDescriptionListItem {
title: qsTr("ENS username")
subTitle: ensName
subTitle: root.ensName
tooltip.text: qsTr("Copy to clipboard")
icon.name: "copy"
visible: !!ensName
visible: !!root.ensName
iconButton.onClicked: {
chatsModel.copyToClipboard(ensName)
root.store.copyToClipboard(root.ensName)
tooltip.visible = !tooltip.visible
}
width: parent.width
@ -155,14 +169,14 @@ Item {
StatusDescriptionListItem {
title: qsTr("Chat key")
subTitle: pubkey
subTitle: root.pubkey
subTitleComponent.elide: Text.ElideMiddle
subTitleComponent.width: 320
subTitleComponent.font.family: Theme.palette.monoFont.name
tooltip.text: qsTr("Copy to clipboard")
icon.name: "copy"
iconButton.onClicked: {
chatsModel.copyToClipboard(pubkey)
root.store.copyToClipboard(root.pubkey)
tooltip.visible = !tooltip.visible
}
width: parent.width
@ -170,11 +184,11 @@ Item {
StatusDescriptionListItem {
title: qsTr("Share Profile URL")
subTitle: `${Constants.userLinkPrefix}${ensName !== "" ? ensName : (pubkey.substring(0, 5) + "..." + pubkey.substring(pubkey.length - 5))}`
subTitle: `${Constants.userLinkPrefix}${root.ensName !== "" ? root.ensName : (root.pubkey.substring(0, 5) + "..." + root.pubkey.substring(root.pubkey.length - 5))}`
tooltip.text: qsTr("Copy to clipboard")
icon.name: "copy"
iconButton.onClicked: {
chatsModel.copyToClipboard(Constants.userLinkPrefix + (ensName !== "" ? ensName : pubkey))
root.store.copyToClipboard(Constants.userLinkPrefix + (root.ensName !== "" ? root.ensName : root.pubkey))
tooltip.visible = !tooltip.visible
}
width: parent.width
@ -182,8 +196,3 @@ Item {
}
}
/*##^##
Designer {
D{i:0;formeditorColor:"#ffffff"}
}
##^##*/

View File

@ -8,12 +8,21 @@ import utils 1.0
import "../../../../shared"
import "../../../../shared/status"
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import "../popups"
import "../panels"
ScrollView {
id: root
height: parent.height
width: parent.width
contentHeight: notificationsContainer.height
clip: true
property var store
Item {
id: notificationsContainer
width: profileContainer.profileContentWidth
@ -51,6 +60,7 @@ ScrollView {
anchors.left: parent.left
anchors.right: parent.right
// TODO: replace with StatusListItem
StatusRadioButtonRow {
//% "All messages"
text: qsTrId("all-messages")
@ -63,6 +73,7 @@ ScrollView {
}
}
// TODO: replace with StatusListItem
StatusRadioButtonRow {
//% "Just @mentions"
text: qsTrId("just--mentions")
@ -75,6 +86,7 @@ ScrollView {
}
}
// TODO: replace with StatusListItem
StatusRadioButtonRow {
//% "Nothing"
text: qsTrId("nothing")
@ -115,6 +127,7 @@ ScrollView {
anchors.right: parent.right
width: parent.width
// TODO: replace with StatusListItem
StatusSettingsLineButton {
//% "Play a sound when receiving a notification"
text: qsTrId("play-a-sound-when-receiving-a-notification")
@ -125,6 +138,7 @@ ScrollView {
}
}
// TODO: replace with StatusListItem
StatusSettingsLineButton {
//% "Use your operating system's notifications"
text: qsTrId("use-your-operating-system-s-notifications")
@ -134,11 +148,11 @@ ScrollView {
appSettings.useOSNotifications = checked
}
StyledText {
StatusBaseText {
id: detailText
//% "Setting this to false will instead use Status' notification style as seen below"
text: qsTrId("setting-this-to-false-will-instead-use-status--notification-style-as-seen-below")
color: Style.current.secondaryText
color: Theme.palette.baseColor1
width: parent.width
font.pixelSize: 12
wrapMode: Text.WordWrap
@ -158,7 +172,7 @@ ScrollView {
anchors.left: parent.left
anchors.right: parent.right
StyledText {
StatusBaseText {
//% "Message preview"
text: qsTrId("message-preview")
font.pixelSize: 15
@ -172,7 +186,7 @@ ScrollView {
anchors.right: parent.right
spacing: 10
NotificationAppearancePreview {
NotificationAppearancePreviewPanel {
//% "Anonymous"
name: qsTrId("anonymous")
notificationTitle: "Status"
@ -187,7 +201,7 @@ ScrollView {
}
}
NotificationAppearancePreview {
NotificationAppearancePreviewPanel {
//% "Name only"
name: qsTrId("name-only")
notificationTitle: "Vitalik Buterin"
@ -202,7 +216,7 @@ ScrollView {
}
}
NotificationAppearancePreview {
NotificationAppearancePreviewPanel {
//% "Name & Message"
name: qsTrId("name---message")
notificationTitle: "Vitalik Buterin"
@ -218,7 +232,7 @@ ScrollView {
}
}
StyledText {
StatusBaseText {
//% "No preview or Advanced? Go to Notification Center"
text: qsTrId("no-preview-or-advanced--go-to-notification-center")
font.pixelSize: 15
@ -253,6 +267,7 @@ ScrollView {
anchors.right: parent.right
width: parent.width
// TODO: replace with StatusListItem
StatusSettingsLineButton {
//% "Notify on new requests"
text: qsTrId("notify-on-new-requests")
@ -263,11 +278,12 @@ ScrollView {
}
}
// TODO: replace with StatusListItem
StatusSettingsLineButton {
//% "Muted users"
text: qsTrId("muted-users")
//% "None"
currentValue: profileModel.mutedChats.contacts.rowCount() > 0 ? profileModel.mutedChats.contacts.rowCount() : qsTrId("none")
currentValue: root.store.mutedChatsContacts.rowCount() > 0 ? root.store.mutedChatsContacts.rowCount() : qsTrId("none")
isSwitch: false
onClicked: {
const mutedChatsModal = notificationsContainer.mutedChatsModalComponent.createObject(notificationsContainer, {
@ -281,11 +297,12 @@ ScrollView {
}
}
// TODO: replace with StatusListItem
StatusSettingsLineButton {
//% "Muted chats"
text: qsTrId("muted-chats")
//% "None"
currentValue: profileModel.mutedChats.chats.rowCount() > 0 ? profileModel.mutedChats.chats.rowCount() : qsTrId("none")
currentValue: root.store.mutedChats.rowCount() > 0 ? root.store.mutedChats.rowCount() : qsTrId("none")
isSwitch: false
onClicked: {
const mutedChatsModal = notificationsContainer.mutedChatsModalComponent.createObject(notificationsContainer, {
@ -298,10 +315,10 @@ ScrollView {
mutedChatsModal.open();
}
StyledText {
StatusBaseText {
//% "You can limit what gets shown in notifications"
text: qsTrId("you-can-limit-what-gets-shown-in-notifications")
color: Style.current.secondaryText
color: Theme.palette.baseColor1
width: parent.width
font.pixelSize: 12
wrapMode: Text.WordWrap
@ -332,11 +349,11 @@ ScrollView {
anchors.right: parent.right
width: parent.width
StyledText {
StatusBaseText {
//% "Reset notification settings"
text: qsTrId("reset-notification-settings")
font.pixelSize: 15
color: Style.current.danger
color: Theme.palette.dangerColor1
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
@ -356,11 +373,11 @@ ScrollView {
}
}
StyledText {
StatusBaseText {
//% "Restore default notification settings and unmute all chats and users"
text: qsTrId("restore-default-notification-settings-and-unmute-all-chats-and-users")
font.pixelSize: 15
color: Style.current.secondaryText
color: Theme.palette.baseColor1
}
}
}

View File

@ -0,0 +1,294 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import QtGraphicalEffects 1.13
import utils 1.0
import "../../../../shared"
import "../../../../shared/status"
import "../../Onboarding/shared" as OnboardingComponents
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Components 0.1
import "../popups"
Item {
id: root
Layout.fillHeight: true
Layout.fillWidth: true
clip: true
property var store
Column {
id: containerColumn
anchors.top: parent.top
anchors.topMargin: 64
width: profileContainer.profileContentWidth
anchors.horizontalCenter: parent.horizontalCenter
StatusSectionHeadline {
id: labelSecurity
//% "Security"
text: qsTrId("security")
bottomPadding: Style.current.halfPadding
}
StatusListItem {
id: backupSeedPhrase
anchors.left: parent.left
anchors.leftMargin: -Style.current.padding
anchors.right: parent.right
anchors.rightMargin: -Style.current.padding
//% "Backup Seed Phrase"
title: qsTrId("backup-seed-phrase")
enabled: !root.store.profileModelInst.mnemonic.isBackedUp
implicitHeight: 52
components: [
StatusBadge {
visible: !root.store.mnemonicBackedUp
anchors.verticalCenter: parent.verticalCenter
},
StatusIcon {
icon: "chevron-down"
rotation: 270
color: Theme.palette.baseColor1
}
]
sensor.onClicked: backupSeedModal.open()
}
StatusListItem {
anchors.left: parent.left
anchors.leftMargin: -Style.current.padding
anchors.right: parent.right
anchors.rightMargin: -Style.current.padding
title: qsTr("Change password")
implicitHeight: 52
components: [
StatusIcon {
icon: "chevron-down"
rotation: 270
color: Theme.palette.baseColor1
}
]
sensor.onClicked: changePasswordModal.open()
}
StatusListItem {
anchors.left: parent.left
anchors.leftMargin: -Style.current.padding
anchors.right: parent.right
anchors.rightMargin: -Style.current.padding
title: qsTr("Store pass to Keychain")
implicitHeight: 52
visible: Qt.platform.os == "osx" // For now, this is available only on MacOS
label: {
let value = accountSettings.storeToKeychain
if(value == Constants.storeToKeychainValueStore)
return qsTr("Store")
if(value == Constants.storeToKeychainValueNever)
return qsTr("Never")
return qsTr("Not now")
}
components: [
StatusIcon {
icon: "chevron-down"
rotation: 270
color: Theme.palette.baseColor1
}
]
sensor.onClicked: openPopup(storeToKeychainSelectionModal)
Component {
id: storePasswordModal
OnboardingComponents.CreatePasswordModal {
storingPasswordModal: true
height: 350
}
}
Component {
id: storeToKeychainSelectionModal
StoreToKeychainSelectionModal {}
}
}
BackupSeedModal {
id: backupSeedModal
}
ChangePasswordModal {
id: changePasswordModal
anchors.centerIn: parent
successPopup: successPopup
}
ChangePasswordSuccessModal {
id: successPopup
anchors.centerIn: parent
}
Item {
id: spacer1
height: Style.current.bigPadding
width: parent.width
}
Separator {
id: separator
}
StatusSectionHeadline {
id: labelPrivacy
//% "Privacy"
text: qsTrId("privacy")
topPadding: Style.current.padding
bottomPadding: Style.current.halfPadding
}
StatusListItem {
anchors.left: parent.left
anchors.leftMargin: -Style.current.padding
anchors.right: parent.right
anchors.rightMargin: -Style.current.padding
//% "Display all profile pictures (not only contacts)"
title: qsTrId("display-all-profile-pictures--not-only-contacts-")
implicitHeight: 52
components: [
StatusSwitch {
id: switch1
checked: !appSettings.onlyShowContactsProfilePics
},
StatusIcon {
icon: "chevron-down"
rotation: 270
color: Theme.palette.baseColor1
anchors.verticalCenter: parent.verticalCenter
}
]
sensor.onClicked: {
switch1.checked = appSettings.onlyShowContactsProfilePics = !switch1.checked
}
}
StatusListItem {
anchors.left: parent.left
anchors.leftMargin: -Style.current.padding
anchors.right: parent.right
anchors.rightMargin: -Style.current.padding
//% "Display images in chat automatically"
title: qsTrId("display-images-in-chat-automatically")
implicitHeight: 52
components: [
StatusSwitch {
id: switch2
checked: appSettings.displayChatImages
},
StatusIcon {
icon: "chevron-down"
rotation: 270
color: Theme.palette.baseColor1
anchors.verticalCenter: parent.verticalCenter
}
]
sensor.onClicked: {
switch2.checked = appSettings.onlyShowContactsProfilePics = !switch2.checked
}
}
StatusBaseText {
width: parent.width
//% "All images (links that contain an image extension) will be downloaded and displayed, regardless of the whitelist settings below"
text: qsTrId("all-images--links-that-contain-an-image-extension--will-be-downloaded-and-displayed--regardless-of-the-whitelist-settings-below")
font.pixelSize: 15
font.weight: Font.Thin
color: Theme.palette.baseColor1
wrapMode: Text.WordWrap
bottomPadding: Style.current.smallPadding
}
StatusListItem {
anchors.left: parent.left
anchors.leftMargin: -Style.current.padding
anchors.right: parent.right
anchors.rightMargin: -Style.current.padding
//% "Chat link previews"
title: qsTrId("chat-link-previews")
implicitHeight: 52
components: [
StatusIcon {
icon: "chevron-down"
rotation: 270
color: Theme.palette.baseColor1
}
]
sensor.onClicked: openPopup(chatLinksPreviewModal)
}
Component {
id: chatLinksPreviewModal
ChatLinksPreviewModal {}
}
Component {
id: openLinksWithModal
OpenLinksWithModal {}
}
StatusListItem {
anchors.left: parent.left
anchors.leftMargin: -Style.current.padding
anchors.right: parent.right
anchors.rightMargin: -Style.current.padding
//% "Open links with..."
title: qsTrId("open-links-with---")
implicitHeight: 52
//% "My default browser"
label: appSettings.openLinksInStatus ? "Status" : qsTrId("my-default-browser")
components: [
StatusIcon {
icon: "chevron-down"
rotation: 270
color: Theme.palette.baseColor1
}
]
sensor.onClicked: openPopup(openLinksWithModal)
}
StatusListItem {
anchors.left: parent.left
anchors.leftMargin: -Style.current.padding
anchors.right: parent.right
anchors.rightMargin: -Style.current.padding
//% "Allow new contact requests"
title: qsTrId("allow-new-contact-requests")
implicitHeight: 52
components: [
StatusSwitch {
id: switch3
checked: !root.store.messagesFromContactsOnly },
StatusIcon {
icon: "chevron-down"
rotation: 270
color: Theme.palette.baseColor1
anchors.verticalCenter: parent.verticalCenter
}
]
sensor.onClicked: {
switch3.checked = root.store.setMessagesFromContactsOnly(!switch3.checked)
}
}
}
}
/*##^##
Designer {
D{i:0;autoSize:true;formeditorColor:"#ffffff";height:480;width:640}
}
##^##*/

View File

@ -3,9 +3,10 @@ import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import utils 1.0
import "../../../../shared"
import "../../../../shared/status"
import StatusQ.Core 0.1
Item {
id: soundsContainer
Layout.fillHeight: true
@ -17,7 +18,7 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
StyledText {
StatusBaseText {
id: labelVolume
anchors.top: parent.top
anchors.topMargin: 24

View File

@ -2,20 +2,25 @@ import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
import utils 1.0
import "../../../../shared"
import "../../../../shared/status"
Item {
id: syncContainer
id: root
Layout.fillHeight: true
Layout.fillWidth: true
property var store
property string activeMailserver: ""
Connections {
target: profileModel.mailservers
target: root.store.mailservers
onActiveMailserverChanged: (activeMailserver) => {
syncContainer.activeMailserver = profileModel.mailservers.list.getMailserverName(activeMailserver)
root.activeMailserver = root.store.getMailserverName(activeMailserver)
}
}
@ -27,13 +32,14 @@ Item {
Component {
id: mailserversList
// TODO: Replace with StatusQ component
StatusRadioButton {
id: rbSetMailsever
text: name
checked: name === activeMailserver
onClicked: {
if (checked) {
profileModel.mailservers.setMailserver(name);
root.store.setMailserver(name)
}
}
}
@ -48,6 +54,7 @@ Item {
anchors.left: parent.left
anchors.leftMargin: 24
// TODO: Replace with StatusQ component
StatusRoundButton {
id: addButton
icon.name: "plusSign"
@ -57,11 +64,11 @@ Item {
}
StyledText {
StatusBaseText {
id: usernameText
//% "Add mailserver"
text: qsTrId("add-mailserver")
color: Style.current.blue
color: Theme.palette.primaryColor1
anchors.left: addButton.right
anchors.leftMargin: Style.current.padding
anchors.verticalCenter: addButton.verticalCenter
@ -74,6 +81,7 @@ Item {
onClicked: addMailserverPopup.open()
}
// TODO: replace with StatusModal
ModalPopup {
id: addMailserverPopup
//% "Add mailserver"
@ -106,6 +114,7 @@ Item {
enodeValidationError = "";
}
// TODO: Replace with StatusQ component
footer: StatusButton {
anchors.right: parent.right
anchors.rightMargin: Style.current.smallPadding
@ -117,7 +126,7 @@ Item {
if (!addMailserverPopup.validate()) {
return;
}
profileModel.mailservers.save(nameInput.text, enodeInput.text)
root.store.saveMailserver(nameInput.text, enodeInput.text)
addMailserverPopup.close()
}
}
@ -145,7 +154,7 @@ Item {
}
}
StyledText {
StatusBaseText {
id: switchLbl
//% "Automatic mailserver selection"
text: qsTrId("automatic-mailserver-selection")
@ -155,10 +164,11 @@ Item {
anchors.topMargin: 24
}
// TODO: Replace with StatusQ component
StatusSwitch {
id: automaticSelectionSwitch
checked: profileModel.mailservers.automaticSelection
onCheckedChanged: profileModel.mailservers.enableAutomaticSelection(checked)
checked: root.store.automaticMailserverSelection
onCheckedChanged: root.store.enableAutomaticMailserverSelection(checked)
anchors.top: addMailserver.bottom
anchors.topMargin: Style.current.padding
anchors.left: switchLbl.right
@ -166,7 +176,7 @@ Item {
}
StyledText {
StatusBaseText {
//% "..."
text: qsTr("Active mailserver: %1").arg(activeMailserver) || qsTrId("---")
anchors.left: parent.left
@ -181,7 +191,7 @@ Item {
anchors.topMargin: 20
anchors.top: automaticSelectionSwitch.bottom
anchors.bottom: parent.bottom
model: profileModel.mailservers.list
model: root.store.mailserversList
delegate: mailserversList
visible: !automaticSelectionSwitch.checked
}

View File

@ -5,7 +5,7 @@ import QtGraphicalEffects 1.13
import utils 1.0
import "../../../../shared"
import "../../Profile/Sections"
import "../../Profile/popups"
import "../stores"
Rectangle {

View File

@ -5,7 +5,7 @@ import QtGraphicalEffects 1.13
import utils 1.0
import "../../../../shared"
import "../../Profile/Sections"
import "../../Profile/popups"
import "."
Rectangle {

View File

@ -13,7 +13,6 @@ import "./AppLayouts/Wallet"
import "./AppLayouts/WalletV2"
import "./AppLayouts/Chat/components"
import "./AppLayouts/Chat/CommunityComponents"
import "./AppLayouts/Profile/Sections"
import Qt.labs.platform 1.1
import Qt.labs.settings 1.0