2023-02-15 08:27:18 +00:00
|
|
|
|
import QtQuick 2.15
|
2020-06-17 19:18:31 +00:00
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-02-18 19:14:31 +00:00
|
|
|
|
import QtMultimedia 5.13
|
2021-11-01 20:10:50 +00:00
|
|
|
|
import Qt.labs.qmlmodels 1.0
|
2022-03-03 22:50:53 +00:00
|
|
|
|
import Qt.labs.platform 1.1
|
2022-09-02 14:56:14 +00:00
|
|
|
|
import QtQml.Models 2.14
|
2023-02-27 12:11:51 +00:00
|
|
|
|
import QtQml 2.15
|
2022-03-03 22:50:53 +00:00
|
|
|
|
|
2022-03-08 18:49:33 +00:00
|
|
|
|
import AppLayouts.Wallet 1.0
|
|
|
|
|
import AppLayouts.Node 1.0
|
|
|
|
|
import AppLayouts.Browser 1.0
|
|
|
|
|
import AppLayouts.Chat 1.0
|
2022-05-13 15:27:26 +00:00
|
|
|
|
import AppLayouts.Chat.views 1.0
|
2022-03-08 18:49:33 +00:00
|
|
|
|
import AppLayouts.Profile 1.0
|
2022-05-23 13:11:30 +00:00
|
|
|
|
import AppLayouts.CommunitiesPortal 1.0
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
|
import shared 1.0
|
2022-03-17 16:15:38 +00:00
|
|
|
|
import shared.controls 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
|
import shared.panels 1.0
|
|
|
|
|
import shared.popups 1.0
|
2022-09-13 10:03:25 +00:00
|
|
|
|
import shared.popups.keycard 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
|
import shared.status 1.0
|
2020-05-11 21:24:08 +00:00
|
|
|
|
|
2021-06-11 12:17:23 +00:00
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2021-10-21 23:34:35 +00:00
|
|
|
|
import StatusQ.Components 0.1
|
2021-06-11 12:17:23 +00:00
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
import StatusQ.Layout 0.1
|
|
|
|
|
import StatusQ.Popups 0.1
|
2022-09-02 14:56:14 +00:00
|
|
|
|
import StatusQ.Popups.Dialog 0.1
|
2021-10-21 23:34:35 +00:00
|
|
|
|
import StatusQ.Core 0.1
|
2021-06-11 12:17:23 +00:00
|
|
|
|
|
2022-05-16 15:02:03 +00:00
|
|
|
|
import AppLayouts.Browser.stores 1.0 as BrowserStores
|
2022-03-08 18:49:33 +00:00
|
|
|
|
import AppLayouts.stores 1.0
|
2023-02-09 21:49:36 +00:00
|
|
|
|
import AppLayouts.Chat.stores 1.0 as ChatStores
|
2022-03-03 22:50:53 +00:00
|
|
|
|
|
2022-11-28 11:32:29 +00:00
|
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
|
2022-10-06 15:47:55 +00:00
|
|
|
|
import "panels"
|
2022-09-13 14:20:10 +00:00
|
|
|
|
import "activitycenter/popups"
|
2022-10-26 16:00:20 +00:00
|
|
|
|
import "activitycenter/stores"
|
2022-07-12 08:56:47 +00:00
|
|
|
|
|
2021-06-17 18:41:11 +00:00
|
|
|
|
Item {
|
2020-09-15 19:47:13 +00:00
|
|
|
|
id: appMain
|
2020-05-11 21:24:08 +00:00
|
|
|
|
|
2021-09-15 11:40:07 +00:00
|
|
|
|
property alias appLayout: appLayout
|
2022-09-23 15:02:54 +00:00
|
|
|
|
property RootStore rootStore: RootStore {}
|
2023-02-09 21:49:36 +00:00
|
|
|
|
property var rootChatStore: ChatStores.RootStore {
|
|
|
|
|
contactsStore: appMain.rootStore.contactStore
|
|
|
|
|
emojiReactionsModel: appMain.rootStore.emojiReactionsModel
|
|
|
|
|
openCreateChat: createChatView.opened
|
|
|
|
|
}
|
2022-10-26 16:00:20 +00:00
|
|
|
|
property ActivityCenterStore activityCenterStore: ActivityCenterStore {}
|
2021-12-09 13:28:02 +00:00
|
|
|
|
// set from main.qml
|
|
|
|
|
property var sysPalette
|
2021-10-20 09:50:50 +00:00
|
|
|
|
|
2022-03-17 16:24:50 +00:00
|
|
|
|
Connections {
|
|
|
|
|
target: rootStore.mainModuleInst
|
2022-09-13 10:03:25 +00:00
|
|
|
|
|
2023-01-18 09:25:36 +00:00
|
|
|
|
function onDisplayUserProfile(publicKey: string) {
|
2023-02-07 14:21:32 +00:00
|
|
|
|
popups.openProfilePopup(publicKey)
|
2023-01-18 09:25:36 +00:00
|
|
|
|
}
|
2022-09-13 10:03:25 +00:00
|
|
|
|
|
2023-01-18 09:25:36 +00:00
|
|
|
|
function onDisplayKeycardSharedModuleFlow() {
|
2022-09-13 10:03:25 +00:00
|
|
|
|
keycardPopup.active = true
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-18 09:25:36 +00:00
|
|
|
|
function onDestroyKeycardSharedModuleFlow() {
|
2022-09-13 10:03:25 +00:00
|
|
|
|
keycardPopup.active = false
|
|
|
|
|
}
|
2022-10-18 09:06:18 +00:00
|
|
|
|
|
2023-01-18 09:25:36 +00:00
|
|
|
|
function onMailserverWorking() {
|
2023-01-18 13:55:23 +00:00
|
|
|
|
mailserverConnectionBanner.hide()
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-18 09:25:36 +00:00
|
|
|
|
function onMailserverNotWorking() {
|
2023-01-18 10:36:28 +00:00
|
|
|
|
mailserverConnectionBanner.show()
|
2022-10-18 09:06:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-01-18 09:25:36 +00:00
|
|
|
|
function onActiveSectionChanged() {
|
2022-10-18 09:06:18 +00:00
|
|
|
|
createChatView.opened = false
|
|
|
|
|
}
|
2023-01-12 19:06:18 +00:00
|
|
|
|
|
2023-01-18 09:25:36 +00:00
|
|
|
|
function onOpenActivityCenter() {
|
2023-02-07 14:21:32 +00:00
|
|
|
|
popups.openPopup(activityCenterPopupComponent)
|
2023-01-12 19:06:18 +00:00
|
|
|
|
}
|
2022-03-17 16:24:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-10-21 13:37:39 +00:00
|
|
|
|
Popups {
|
2023-02-07 14:21:32 +00:00
|
|
|
|
id: popups
|
|
|
|
|
popupParent: appMain
|
2022-10-21 13:37:39 +00:00
|
|
|
|
rootStore: appMain.rootStore
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-06 21:10:54 +00:00
|
|
|
|
Connections {
|
2023-02-07 14:21:32 +00:00
|
|
|
|
id: globalConns
|
2021-12-06 21:10:54 +00:00
|
|
|
|
target: Global
|
2023-02-07 14:21:32 +00:00
|
|
|
|
|
2023-01-18 09:25:36 +00:00
|
|
|
|
function onOpenLinkInBrowser(link: string) {
|
2023-01-10 13:19:02 +00:00
|
|
|
|
changeAppSectionBySectionId(Constants.appSection.browser)
|
|
|
|
|
Qt.callLater(() => browserLayoutContainer.item.openUrlInNewTab(link));
|
2021-12-06 21:10:54 +00:00
|
|
|
|
}
|
2022-10-18 09:06:18 +00:00
|
|
|
|
|
2023-01-18 09:25:36 +00:00
|
|
|
|
function onOpenCreateChatView() {
|
2022-10-18 09:06:18 +00:00
|
|
|
|
createChatView.opened = true
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-18 09:25:36 +00:00
|
|
|
|
function onCloseCreateChatView() {
|
2022-10-18 09:06:18 +00:00
|
|
|
|
createChatView.opened = false
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-07 14:21:32 +00:00
|
|
|
|
function onOpenActivityCenterPopupRequested() {
|
|
|
|
|
popups.openPopup(activityCenterPopupComponent)
|
2022-07-26 14:23:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-01-18 09:25:36 +00:00
|
|
|
|
function onDisplayToastMessage(title: string, subTitle: string, icon: string, loading: bool, ephNotifType: int, url: string) {
|
2023-02-07 14:21:32 +00:00
|
|
|
|
appMain.rootStore.mainModuleInst.displayEphemeralNotification(title, subTitle, icon, loading, ephNotifType, url)
|
2022-12-14 14:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-01-18 09:25:36 +00:00
|
|
|
|
function onOpenLink(link: string) {
|
2022-12-14 14:40:50 +00:00
|
|
|
|
// Qt sometimes inserts random HTML tags; and this will break on invalid URL inside QDesktopServices::openUrl(link)
|
2023-02-07 14:21:32 +00:00
|
|
|
|
link = appMain.rootStore.plainText(link)
|
2022-12-14 14:40:50 +00:00
|
|
|
|
if (appMain.rootStore.showBrowserSelector) {
|
2023-02-07 14:21:32 +00:00
|
|
|
|
popups.openChooseBrowserPopup(link)
|
2022-12-14 14:40:50 +00:00
|
|
|
|
} else {
|
|
|
|
|
if (appMain.rootStore.openLinksInStatus) {
|
2023-02-07 14:21:32 +00:00
|
|
|
|
globalConns.onAppSectionBySectionTypeChanged(Constants.appSection.browser)
|
|
|
|
|
globalConns.onOpenLinkInBrowser(link)
|
2022-12-14 14:40:50 +00:00
|
|
|
|
} else {
|
2023-02-07 14:21:32 +00:00
|
|
|
|
Qt.openUrlExternally(link)
|
2022-12-14 14:40:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-07 14:21:32 +00:00
|
|
|
|
function onPlaySendMessageSound() {
|
|
|
|
|
sendMessageSound.stop()
|
|
|
|
|
sendMessageSound.play()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onPlayNotificationSound() {
|
|
|
|
|
notificationSound.stop()
|
|
|
|
|
notificationSound.play()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onPlayErrorSound() {
|
|
|
|
|
errorSound.stop()
|
|
|
|
|
errorSound.play()
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-18 09:25:36 +00:00
|
|
|
|
function onSetNthEnabledSectionActive(nthSection: int) {
|
2022-12-14 14:40:50 +00:00
|
|
|
|
if(!appMain.rootStore.mainModuleInst)
|
|
|
|
|
return
|
|
|
|
|
appMain.rootStore.mainModuleInst.setNthEnabledSectionActive(nthSection)
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-18 09:25:36 +00:00
|
|
|
|
function onAppSectionBySectionTypeChanged(sectionType: int, subsection: int) {
|
2022-12-14 14:40:50 +00:00
|
|
|
|
if(!appMain.rootStore.mainModuleInst)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
appMain.rootStore.mainModuleInst.setActiveSectionBySectionType(sectionType)
|
|
|
|
|
if (sectionType === Constants.appSection.profile) {
|
|
|
|
|
Global.settingsSubsection = subsection;
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-10-19 10:27:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function changeAppSectionBySectionId(sectionId) {
|
2022-10-18 09:06:18 +00:00
|
|
|
|
appMain.rootStore.mainModuleInst.setActiveSectionById(sectionId)
|
2021-06-11 12:17:23 +00:00
|
|
|
|
}
|
2021-02-18 19:14:31 +00:00
|
|
|
|
|
|
|
|
|
Audio {
|
|
|
|
|
id: sendMessageSound
|
2021-12-08 21:20:43 +00:00
|
|
|
|
store: rootStore
|
2022-12-08 15:49:14 +00:00
|
|
|
|
source: "qrc:/imports/assets/audio/send_message.wav"
|
2021-02-18 19:14:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Audio {
|
|
|
|
|
id: notificationSound
|
2021-12-08 21:20:43 +00:00
|
|
|
|
store: rootStore
|
2022-12-08 15:49:14 +00:00
|
|
|
|
source: "qrc:/imports/assets/audio/notification.wav"
|
2022-01-11 23:16:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Audio {
|
|
|
|
|
id: errorSound
|
2022-12-08 15:49:14 +00:00
|
|
|
|
source: "qrc:/imports/assets/audio/error.mp3"
|
2022-01-11 23:16:17 +00:00
|
|
|
|
store: rootStore
|
2021-02-18 19:14:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
Loader {
|
2021-11-10 08:09:31 +00:00
|
|
|
|
id: appSearch
|
2022-10-18 09:06:18 +00:00
|
|
|
|
active: false
|
|
|
|
|
asynchronous: true
|
|
|
|
|
|
|
|
|
|
function openSearchPopup() {
|
|
|
|
|
if (!active)
|
|
|
|
|
active = true
|
|
|
|
|
item.openSearchPopup()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function closeSearchPopup() {
|
|
|
|
|
if (item)
|
|
|
|
|
item.closeSearchPopup()
|
2022-11-07 14:56:59 +00:00
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
active = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sourceComponent: AppSearch {
|
|
|
|
|
store: appMain.rootStore.appSearchStore
|
2022-11-07 14:56:59 +00:00
|
|
|
|
onClosed: appSearch.active = false
|
2022-10-18 09:06:18 +00:00
|
|
|
|
}
|
2021-11-10 08:09:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-03-07 14:56:05 +00:00
|
|
|
|
StatusEmojiPopup {
|
|
|
|
|
id: statusEmojiPopup
|
|
|
|
|
width: 360
|
|
|
|
|
height: 440
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-30 21:05:34 +00:00
|
|
|
|
Loader {
|
|
|
|
|
id: statusStickersPopupLoader
|
|
|
|
|
active: appMain.rootStore.mainModuleInst.chatsLoaded
|
|
|
|
|
sourceComponent: StatusStickersPopup {
|
|
|
|
|
id: statusStickersPopup
|
2023-02-09 21:49:36 +00:00
|
|
|
|
store: appMain.rootChatStore
|
2023-01-30 21:05:34 +00:00
|
|
|
|
}
|
2022-11-14 20:21:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-08-09 15:08:39 +00:00
|
|
|
|
StatusMainLayout {
|
2021-09-15 11:40:07 +00:00
|
|
|
|
id: appLayout
|
|
|
|
|
|
2022-07-26 08:24:59 +00:00
|
|
|
|
anchors.fill: parent
|
2021-06-17 18:41:11 +00:00
|
|
|
|
|
2022-08-09 15:08:39 +00:00
|
|
|
|
leftPanel: StatusAppNavBar {
|
2022-11-28 11:32:29 +00:00
|
|
|
|
chatItemsModel: SortFilterProxyModel {
|
|
|
|
|
sourceModel: appMain.rootStore.mainModuleInst.sectionsModel
|
|
|
|
|
filters: [
|
|
|
|
|
ValueFilter {
|
|
|
|
|
roleName: "sectionType"
|
|
|
|
|
value: Constants.appSection.chat
|
|
|
|
|
},
|
|
|
|
|
ValueFilter {
|
|
|
|
|
roleName: "enabled"
|
|
|
|
|
value: true
|
|
|
|
|
}
|
|
|
|
|
]
|
2021-06-17 18:41:11 +00:00
|
|
|
|
}
|
2022-11-28 11:32:29 +00:00
|
|
|
|
chatItemDelegate: navbarButton
|
|
|
|
|
|
|
|
|
|
communityItemsModel: SortFilterProxyModel {
|
|
|
|
|
sourceModel: appMain.rootStore.mainModuleInst.sectionsModel
|
|
|
|
|
filters: [
|
|
|
|
|
ValueFilter {
|
|
|
|
|
roleName: "sectionType"
|
|
|
|
|
value: Constants.appSection.community
|
|
|
|
|
},
|
|
|
|
|
ValueFilter {
|
|
|
|
|
roleName: "enabled"
|
|
|
|
|
value: true
|
|
|
|
|
}
|
|
|
|
|
]
|
2021-10-19 10:27:41 +00:00
|
|
|
|
}
|
2022-11-28 11:32:29 +00:00
|
|
|
|
communityItemDelegate: StatusNavBarTabButton {
|
2022-08-11 12:24:49 +00:00
|
|
|
|
objectName: "CommunityNavBarButton"
|
2021-06-17 18:41:11 +00:00
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2021-10-19 10:27:41 +00:00
|
|
|
|
name: model.icon.length > 0? "" : model.name
|
|
|
|
|
icon.name: model.icon
|
|
|
|
|
icon.source: model.image
|
2022-10-12 15:22:23 +00:00
|
|
|
|
identicon.asset.color: (hovered || identicon.highlighted || checked) ? model.color : icon.color
|
2021-06-17 18:41:11 +00:00
|
|
|
|
tooltip.text: model.name
|
2021-10-19 10:27:41 +00:00
|
|
|
|
checked: model.active
|
|
|
|
|
badge.value: model.notificationsCount
|
|
|
|
|
badge.visible: model.hasNotification
|
2021-06-17 18:41:11 +00:00
|
|
|
|
badge.border.color: hovered ? Theme.palette.statusBadge.hoverBorderColor : Theme.palette.statusBadge.borderColor
|
|
|
|
|
badge.border.width: 2
|
2021-10-19 10:27:41 +00:00
|
|
|
|
onClicked: {
|
|
|
|
|
changeAppSectionBySectionId(model.id)
|
|
|
|
|
}
|
2021-06-17 18:41:11 +00:00
|
|
|
|
|
2023-01-10 13:19:02 +00:00
|
|
|
|
popupMenu: Component {
|
|
|
|
|
StatusMenu {
|
|
|
|
|
id: communityContextMenu
|
2021-06-17 18:41:11 +00:00
|
|
|
|
|
2023-01-10 13:19:02 +00:00
|
|
|
|
property var chatCommunitySectionModule
|
2022-01-18 20:54:14 +00:00
|
|
|
|
|
2023-01-10 13:19:02 +00:00
|
|
|
|
openHandler: function () {
|
|
|
|
|
// we cannot return QVariant if we pass another parameter in a function call
|
|
|
|
|
// that's why we're using it this way
|
|
|
|
|
appMain.rootStore.mainModuleInst.prepareCommunitySectionModuleForCommunityId(model.id)
|
|
|
|
|
communityContextMenu.chatCommunitySectionModule = appMain.rootStore.mainModuleInst.getCommunitySectionModule()
|
|
|
|
|
}
|
2021-06-17 18:41:11 +00:00
|
|
|
|
|
2023-01-10 13:19:02 +00:00
|
|
|
|
StatusAction {
|
|
|
|
|
text: qsTr("Invite People")
|
|
|
|
|
icon.name: "share-ios"
|
|
|
|
|
enabled: model.canManageUsers
|
|
|
|
|
onTriggered: {
|
2023-02-07 14:21:32 +00:00
|
|
|
|
popups.openInviteFriendsToCommunityPopup(model,
|
2023-01-10 13:19:02 +00:00
|
|
|
|
communityContextMenu.chatCommunitySectionModule,
|
|
|
|
|
null)
|
|
|
|
|
}
|
2022-09-28 21:07:18 +00:00
|
|
|
|
}
|
2021-06-17 18:41:11 +00:00
|
|
|
|
|
2023-01-10 13:19:02 +00:00
|
|
|
|
StatusAction {
|
|
|
|
|
text: qsTr("View Community")
|
|
|
|
|
icon.name: "group-chat"
|
2023-02-07 14:21:32 +00:00
|
|
|
|
onTriggered: popups.openCommunityProfilePopup(appMain.rootStore, model, communityContextMenu.chatCommunitySectionModule)
|
2023-01-10 13:19:02 +00:00
|
|
|
|
}
|
2021-06-17 18:41:11 +00:00
|
|
|
|
|
2023-01-10 13:19:02 +00:00
|
|
|
|
StatusMenuSeparator {}
|
2021-06-17 18:41:11 +00:00
|
|
|
|
|
2023-01-10 13:19:02 +00:00
|
|
|
|
StatusAction {
|
|
|
|
|
text: qsTr("Leave Community")
|
|
|
|
|
icon.name: "arrow-left"
|
|
|
|
|
type: StatusAction.Type.Danger
|
|
|
|
|
onTriggered: communityContextMenu.chatCommunitySectionModule.leaveCommunity()
|
|
|
|
|
}
|
2021-06-17 18:41:11 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-28 11:32:29 +00:00
|
|
|
|
regularItemsModel: SortFilterProxyModel {
|
|
|
|
|
sourceModel: appMain.rootStore.mainModuleInst.sectionsModel
|
|
|
|
|
filters: [
|
|
|
|
|
RangeFilter {
|
|
|
|
|
roleName: "sectionType"
|
|
|
|
|
minimumValue: Constants.appSection.wallet
|
|
|
|
|
maximumValue: Constants.appSection.communitiesPortal
|
|
|
|
|
},
|
|
|
|
|
ValueFilter {
|
|
|
|
|
roleName: "enabled"
|
|
|
|
|
value: true
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
regularItemDelegate: navbarButton
|
|
|
|
|
|
|
|
|
|
delegateHeight: 40
|
|
|
|
|
|
|
|
|
|
profileComponent: StatusNavBarTabButton {
|
2021-06-17 18:41:11 +00:00
|
|
|
|
id: profileButton
|
2022-08-12 13:19:16 +00:00
|
|
|
|
objectName: "statusProfileNavBarTabButton"
|
2021-09-27 10:31:17 +00:00
|
|
|
|
property bool opened: false
|
2021-10-19 10:27:41 +00:00
|
|
|
|
|
2022-03-30 15:30:28 +00:00
|
|
|
|
name: appMain.rootStore.userProfileInst.name
|
2021-12-01 12:46:21 +00:00
|
|
|
|
icon.source: appMain.rootStore.userProfileInst.icon
|
2022-11-28 11:32:29 +00:00
|
|
|
|
implicitWidth: 32
|
|
|
|
|
implicitHeight: 32
|
2022-09-05 09:24:37 +00:00
|
|
|
|
identicon.asset.width: width
|
|
|
|
|
identicon.asset.height: height
|
2022-08-11 11:55:08 +00:00
|
|
|
|
identicon.asset.charactersLen: 2
|
|
|
|
|
identicon.asset.color: Utils.colorForPubkey(appMain.rootStore.userProfileInst.pubKey)
|
2022-12-01 10:24:25 +00:00
|
|
|
|
identicon.ringSettings.ringSpecModel: Utils.getColorHashAsJson(appMain.rootStore.userProfileInst.pubKey,
|
2022-12-13 09:37:27 +00:00
|
|
|
|
appMain.rootStore.userProfileInst.preferredName)
|
2022-04-01 11:46:32 +00:00
|
|
|
|
|
2021-06-17 18:41:11 +00:00
|
|
|
|
badge.visible: true
|
2022-07-26 08:24:59 +00:00
|
|
|
|
badge.anchors {
|
|
|
|
|
left: undefined
|
|
|
|
|
top: undefined
|
|
|
|
|
right: profileButton.right
|
|
|
|
|
bottom: profileButton.bottom
|
|
|
|
|
margins: 0
|
|
|
|
|
rightMargin: -badge.border.width
|
|
|
|
|
bottomMargin: -badge.border.width
|
|
|
|
|
}
|
|
|
|
|
badge.implicitHeight: 12
|
|
|
|
|
badge.implicitWidth: 12
|
|
|
|
|
badge.border.width: 2
|
2021-06-17 18:41:11 +00:00
|
|
|
|
badge.border.color: hovered ? Theme.palette.statusBadge.hoverBorderColor : Theme.palette.statusAppNavBar.backgroundColor
|
2022-06-10 09:01:31 +00:00
|
|
|
|
badge.color: {
|
|
|
|
|
switch(appMain.rootStore.userProfileInst.currentUserStatus){
|
|
|
|
|
case Constants.currentUserStatus.automatic:
|
|
|
|
|
case Constants.currentUserStatus.alwaysOnline:
|
|
|
|
|
return Style.current.green;
|
|
|
|
|
default:
|
|
|
|
|
return Style.current.midGrey;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-07-26 08:24:59 +00:00
|
|
|
|
|
|
|
|
|
onClicked: userStatusContextMenu.opened ? userStatusContextMenu.close() : userStatusContextMenu.open()
|
2021-06-17 18:41:11 +00:00
|
|
|
|
|
|
|
|
|
UserStatusContextMenu {
|
|
|
|
|
id: userStatusContextMenu
|
2022-07-04 10:47:29 +00:00
|
|
|
|
y: profileButton.y - userStatusContextMenu.height + profileButton.height
|
|
|
|
|
x: profileButton.x + profileButton.width + 5
|
2021-11-04 23:38:57 +00:00
|
|
|
|
store: appMain.rootStore
|
2021-06-17 18:41:11 +00:00
|
|
|
|
}
|
2022-11-28 11:32:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: navbarButton
|
|
|
|
|
StatusNavBarTabButton {
|
|
|
|
|
id: navbar
|
|
|
|
|
objectName: model.name + "-navbar"
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
name: model.icon.length > 0? "" : model.name
|
|
|
|
|
icon.name: model.icon
|
|
|
|
|
icon.source: model.image
|
2022-12-12 12:39:25 +00:00
|
|
|
|
tooltip.text: Utils.translatedSectionName(model.sectionType, model.name)
|
2022-11-28 11:32:29 +00:00
|
|
|
|
checked: model.active
|
|
|
|
|
badge.value: model.notificationsCount
|
|
|
|
|
badge.visible: model.hasNotification
|
|
|
|
|
badge.border.color: hovered ? Theme.palette.statusBadge.hoverBorderColor : Theme.palette.statusBadge.borderColor
|
|
|
|
|
badge.border.width: 2
|
|
|
|
|
onClicked: {
|
|
|
|
|
changeAppSectionBySectionId(model.id)
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-06-17 18:41:11 +00:00
|
|
|
|
}
|
2021-07-28 12:50:48 +00:00
|
|
|
|
}
|
2021-06-17 18:41:11 +00:00
|
|
|
|
|
2022-08-09 15:08:39 +00:00
|
|
|
|
rightPanel: ColumnLayout {
|
|
|
|
|
spacing: 0
|
2022-08-31 10:55:42 +00:00
|
|
|
|
objectName: "mainRightView"
|
|
|
|
|
|
2022-09-02 14:56:14 +00:00
|
|
|
|
ColumnLayout {
|
|
|
|
|
id: bannersLayout
|
|
|
|
|
|
2023-01-30 10:42:26 +00:00
|
|
|
|
enabled: !localAppSettings.testEnvironment
|
|
|
|
|
visible: enabled
|
|
|
|
|
|
2022-09-02 14:56:14 +00:00
|
|
|
|
property var updateBanner: null
|
|
|
|
|
property var connectedBanner: null
|
2022-10-18 09:06:18 +00:00
|
|
|
|
readonly property bool isConnected: appMain.rootStore.mainModuleInst.isOnline
|
2022-09-02 14:56:14 +00:00
|
|
|
|
|
|
|
|
|
function processUpdateAvailable() {
|
|
|
|
|
if (!updateBanner)
|
|
|
|
|
updateBanner = updateBannerComponent.createObject(this)
|
2022-03-03 21:00:52 +00:00
|
|
|
|
}
|
2022-09-02 14:56:14 +00:00
|
|
|
|
|
|
|
|
|
function processConnected() {
|
|
|
|
|
if (!connectedBanner)
|
|
|
|
|
connectedBanner = connectedBannerComponent.createObject(this)
|
2021-10-19 10:27:41 +00:00
|
|
|
|
}
|
2022-03-17 16:15:38 +00:00
|
|
|
|
|
2022-09-02 14:56:14 +00:00
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.maximumHeight: implicitHeight
|
|
|
|
|
spacing: 1
|
|
|
|
|
|
|
|
|
|
onIsConnectedChanged: {
|
|
|
|
|
processConnected()
|
2023-01-11 14:06:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
if (!isConnected)
|
|
|
|
|
processConnected()
|
2022-03-17 16:15:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-09-02 14:56:14 +00:00
|
|
|
|
Connections {
|
|
|
|
|
target: rootStore.aboutModuleInst
|
2023-01-18 09:25:36 +00:00
|
|
|
|
function onAppVersionFetched(available: bool, version: string, url: string) {
|
2022-09-02 14:56:14 +00:00
|
|
|
|
rootStore.setLatestVersionInfo(available, version, url);
|
|
|
|
|
bannersLayout.processUpdateAvailable()
|
|
|
|
|
}
|
2022-03-17 16:15:38 +00:00
|
|
|
|
}
|
2022-09-02 14:56:14 +00:00
|
|
|
|
|
|
|
|
|
ModuleWarning {
|
|
|
|
|
id: testnetBanner
|
2022-09-29 14:30:25 +00:00
|
|
|
|
objectName: "testnetBanner"
|
2022-09-02 14:56:14 +00:00
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
text: qsTr("Testnet mode is enabled. All balances, transactions and dApp interactions will be on testnets.")
|
|
|
|
|
buttonText: qsTr("Turn off")
|
|
|
|
|
type: ModuleWarning.Danger
|
|
|
|
|
active: appMain.rootStore.profileSectionStore.walletStore.areTestNetworksEnabled
|
|
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
testnetBannerDialog.open()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onCloseClicked: {
|
|
|
|
|
testnetBannerDialog.open()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
StatusDialog {
|
|
|
|
|
id: testnetBannerDialog
|
|
|
|
|
|
|
|
|
|
width: 400
|
|
|
|
|
title: qsTr("Turn off Testnet mode")
|
|
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
text: qsTr("Closing this banner will turn off Testnet mode.\nAll future transactions will be on mainnet or other active networks.")
|
|
|
|
|
font.pixelSize: 15
|
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
footer: StatusDialogFooter {
|
|
|
|
|
rightButtons: ObjectModel {
|
|
|
|
|
StatusButton {
|
|
|
|
|
type: StatusButton.Danger
|
|
|
|
|
text: qsTr("Turn off Testnet")
|
|
|
|
|
onClicked: {
|
|
|
|
|
appMain.rootStore.profileSectionStore.walletStore.toggleTestNetworksEnabled()
|
|
|
|
|
testnetBannerDialog.close()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-03-17 16:15:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-09-02 14:56:14 +00:00
|
|
|
|
ModuleWarning {
|
|
|
|
|
id: secureYourSeedPhrase
|
2022-09-29 14:30:25 +00:00
|
|
|
|
objectName: "secureYourSeedPhraseBanner"
|
2022-09-02 14:56:14 +00:00
|
|
|
|
Layout.fillWidth: true
|
2022-09-14 19:05:44 +00:00
|
|
|
|
active: !appMain.rootStore.profileSectionStore.profileStore.userDeclinedBackupBanner
|
2022-09-02 14:56:14 +00:00
|
|
|
|
&& !appMain.rootStore.profileSectionStore.profileStore.privacyStore.mnemonicBackedUp
|
|
|
|
|
type: ModuleWarning.Danger
|
|
|
|
|
text: qsTr("Secure your seed phrase")
|
|
|
|
|
buttonText: qsTr("Back up now")
|
|
|
|
|
|
2023-02-07 14:21:32 +00:00
|
|
|
|
onClicked: popups.openBackUpSeedPopup()
|
2022-09-02 14:56:14 +00:00
|
|
|
|
|
|
|
|
|
onCloseClicked: {
|
|
|
|
|
appMain.rootStore.profileSectionStore.profileStore.userDeclinedBackupBanner = true
|
|
|
|
|
}
|
2022-03-17 16:15:38 +00:00
|
|
|
|
}
|
2021-12-17 17:42:12 +00:00
|
|
|
|
|
2022-09-15 07:31:38 +00:00
|
|
|
|
|
|
|
|
|
ModuleWarning {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
readonly property int progress: communitiesPortalLayoutContainer.communitiesStore.discordImportProgress
|
2022-10-20 06:56:11 +00:00
|
|
|
|
readonly property bool inProgress: (progress > 0 && progress < 100) || communitiesPortalLayoutContainer.communitiesStore.discordImportInProgress
|
2022-09-15 07:31:38 +00:00
|
|
|
|
readonly property bool finished: progress >= 100
|
|
|
|
|
readonly property bool cancelled: communitiesPortalLayoutContainer.communitiesStore.discordImportCancelled
|
|
|
|
|
readonly property bool stopped: communitiesPortalLayoutContainer.communitiesStore.discordImportProgressStopped
|
|
|
|
|
readonly property int errors: communitiesPortalLayoutContainer.communitiesStore.discordImportErrorsCount
|
|
|
|
|
readonly property int warnings: communitiesPortalLayoutContainer.communitiesStore.discordImportWarningsCount
|
|
|
|
|
readonly property string communityId: communitiesPortalLayoutContainer.communitiesStore.discordImportCommunityId
|
|
|
|
|
readonly property string communityName: communitiesPortalLayoutContainer.communitiesStore.discordImportCommunityName
|
|
|
|
|
|
|
|
|
|
active: !cancelled && (inProgress || finished || stopped)
|
|
|
|
|
type: errors ? ModuleWarning.Type.Danger : ModuleWarning.Type.Success
|
|
|
|
|
text: {
|
|
|
|
|
if (finished || stopped) {
|
|
|
|
|
if (errors)
|
|
|
|
|
return qsTr("The import of ‘%1’ from Discord to Status was stopped: <a href='#'>Critical issues found</a>").arg(communityName)
|
|
|
|
|
|
|
|
|
|
let result = qsTr("‘%1’ was successfully imported from Discord to Status").arg(communityName) + " <a href='#'>"
|
|
|
|
|
if (warnings)
|
|
|
|
|
result += qsTr("Details (%1)").arg(qsTr("%n issue(s)", "", warnings))
|
|
|
|
|
else
|
|
|
|
|
result += qsTr("Details")
|
|
|
|
|
result += "</a>"
|
|
|
|
|
return result
|
|
|
|
|
}
|
|
|
|
|
if (inProgress) {
|
|
|
|
|
let result = qsTr("Importing ‘%1’ from Discord to Status").arg(communityName) + " <a href='#'>"
|
|
|
|
|
if (warnings)
|
|
|
|
|
result += qsTr("Check progress (%1)").arg(qsTr("%n issue(s)", "", warnings))
|
|
|
|
|
else
|
|
|
|
|
result += qsTr("Check progress")
|
|
|
|
|
result += "</a>"
|
|
|
|
|
return result
|
|
|
|
|
}
|
2022-12-09 11:35:29 +00:00
|
|
|
|
|
|
|
|
|
return ""
|
2022-09-15 07:31:38 +00:00
|
|
|
|
}
|
2023-02-07 14:21:32 +00:00
|
|
|
|
onLinkActivated: popups.openPopup(communitiesPortalLayoutContainer.discordImportProgressPopup)
|
2022-09-15 07:31:38 +00:00
|
|
|
|
progressValue: progress
|
|
|
|
|
closeBtnVisible: finished || stopped
|
|
|
|
|
buttonText: finished && !errors ? qsTr("Visit your Community") : ""
|
|
|
|
|
onClicked: function() {
|
|
|
|
|
communitiesPortalLayoutContainer.communitiesStore.setActiveCommunity(communityId)
|
|
|
|
|
}
|
|
|
|
|
onCloseClicked: {
|
|
|
|
|
hide();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-01 15:10:51 +00:00
|
|
|
|
ModuleWarning {
|
|
|
|
|
id: downloadingArchivesBanner
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
active: communitiesPortalLayoutContainer.communitiesStore.downloadingCommunityHistoryArchives
|
|
|
|
|
type: ModuleWarning.Danger
|
|
|
|
|
text: qsTr("Downloading message history archives, DO NOT CLOSE THE APP until this banner disappears.")
|
|
|
|
|
closeBtnVisible: false
|
|
|
|
|
}
|
2022-09-15 07:31:38 +00:00
|
|
|
|
|
2023-01-18 10:36:28 +00:00
|
|
|
|
ModuleWarning {
|
|
|
|
|
id: mailserverConnectionBanner
|
2023-01-18 16:37:36 +00:00
|
|
|
|
type: ModuleWarning.Warning
|
|
|
|
|
text: qsTr("Can not connect to store node. Retrying automatically")
|
2023-01-18 10:36:28 +00:00
|
|
|
|
onCloseClicked: hide()
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-02 14:56:14 +00:00
|
|
|
|
Component {
|
|
|
|
|
id: connectedBannerComponent
|
|
|
|
|
|
|
|
|
|
ModuleWarning {
|
2022-10-04 16:38:52 +00:00
|
|
|
|
id: connectedBanner
|
|
|
|
|
property bool isConnected: true
|
2022-09-02 14:56:14 +00:00
|
|
|
|
|
2022-09-29 14:30:25 +00:00
|
|
|
|
objectName: "connectionInfoBanner"
|
2022-09-02 14:56:14 +00:00
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
text: isConnected ? qsTr("Connected") : qsTr("Disconnected")
|
|
|
|
|
type: isConnected ? ModuleWarning.Success : ModuleWarning.Danger
|
|
|
|
|
|
|
|
|
|
function updateState() {
|
|
|
|
|
if (isConnected)
|
|
|
|
|
showFor()
|
|
|
|
|
else
|
|
|
|
|
show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
2022-10-04 16:38:52 +00:00
|
|
|
|
connectedBanner.isConnected = Qt.binding(() => bannersLayout.isConnected);
|
2022-09-02 14:56:14 +00:00
|
|
|
|
}
|
|
|
|
|
onIsConnectedChanged: {
|
|
|
|
|
updateState();
|
|
|
|
|
}
|
|
|
|
|
onCloseClicked: {
|
|
|
|
|
hide();
|
|
|
|
|
}
|
|
|
|
|
onHideFinished: {
|
|
|
|
|
destroy()
|
2023-01-30 10:42:26 +00:00
|
|
|
|
bannersLayout.connectedBanner = null
|
2022-09-02 14:56:14 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: updateBannerComponent
|
|
|
|
|
|
|
|
|
|
ModuleWarning {
|
|
|
|
|
readonly property string version: appMain.rootStore.latestVersion
|
|
|
|
|
readonly property bool updateAvailable: appMain.rootStore.newVersionAvailable
|
|
|
|
|
|
2022-09-29 14:35:16 +00:00
|
|
|
|
objectName: "appVersionUpdateBanner"
|
2022-09-02 14:56:14 +00:00
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
type: ModuleWarning.Success
|
|
|
|
|
text: updateAvailable ? qsTr("A new version of Status (%1) is available").arg(version)
|
|
|
|
|
: qsTr("Your version is up to date")
|
|
|
|
|
|
|
|
|
|
buttonText: updateAvailable ? qsTr("Update")
|
|
|
|
|
: qsTr("Close")
|
|
|
|
|
|
|
|
|
|
function updateState() {
|
|
|
|
|
if (updateAvailable)
|
|
|
|
|
show()
|
|
|
|
|
else
|
|
|
|
|
showFor(5000)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
updateState()
|
|
|
|
|
}
|
|
|
|
|
onUpdateAvailableChanged: {
|
|
|
|
|
updateState();
|
|
|
|
|
}
|
|
|
|
|
onClicked: {
|
|
|
|
|
if (updateAvailable)
|
|
|
|
|
Global.openDownloadModal(appMain.rootStore.newVersionAvailable,
|
|
|
|
|
appMain.rootStore.latestVersion,
|
|
|
|
|
appMain.rootStore.downloadURL)
|
|
|
|
|
else
|
|
|
|
|
close()
|
|
|
|
|
}
|
|
|
|
|
onCloseClicked: {
|
|
|
|
|
if (updateAvailable)
|
|
|
|
|
appMain.rootStore.resetLastVersion();
|
|
|
|
|
hide()
|
|
|
|
|
}
|
|
|
|
|
onHideFinished: {
|
|
|
|
|
destroy()
|
2023-01-30 10:42:26 +00:00
|
|
|
|
bannersLayout.updateBanner = null
|
2022-09-02 14:56:14 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-07-12 08:56:47 +00:00
|
|
|
|
|
2022-05-13 15:27:26 +00:00
|
|
|
|
Item {
|
2022-06-23 15:28:30 +00:00
|
|
|
|
Layout.fillWidth: true
|
2021-12-17 17:42:12 +00:00
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
|
2022-05-13 15:27:26 +00:00
|
|
|
|
StackLayout {
|
|
|
|
|
id: appView
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
|
|
currentIndex: {
|
2022-10-18 09:06:18 +00:00
|
|
|
|
const activeSectionType = appMain.rootStore.mainModuleInst.activeSection.sectionType
|
|
|
|
|
|
|
|
|
|
if (activeSectionType === Constants.appSection.chat)
|
2022-05-13 15:27:26 +00:00
|
|
|
|
return Constants.appViewStackIndex.chat
|
2022-10-18 09:06:18 +00:00
|
|
|
|
if (activeSectionType === Constants.appSection.community) {
|
2023-01-10 13:19:02 +00:00
|
|
|
|
for (let i = this.children.length - 1; i >=0; i--) {
|
2022-10-18 09:06:18 +00:00
|
|
|
|
var obj = this.children[i]
|
2023-01-10 13:19:02 +00:00
|
|
|
|
if (obj && obj.sectionId && obj.sectionId === appMain.rootStore.mainModuleInst.activeSection.id) {
|
2022-05-13 15:27:26 +00:00
|
|
|
|
return i
|
|
|
|
|
}
|
2021-12-17 17:42:12 +00:00
|
|
|
|
}
|
2022-05-13 15:27:26 +00:00
|
|
|
|
|
|
|
|
|
// Should never be here, correct index must be returned from the for loop above
|
2023-01-10 13:19:02 +00:00
|
|
|
|
console.error("Wrong section type:", appMain.rootStore.mainModuleInst.activeSection.sectionType,
|
|
|
|
|
"or section id: ", appMain.rootStore.mainModuleInst.activeSection.id)
|
2022-05-13 15:27:26 +00:00
|
|
|
|
return Constants.appViewStackIndex.community
|
|
|
|
|
}
|
2022-10-18 09:06:18 +00:00
|
|
|
|
if (activeSectionType === Constants.appSection.communitiesPortal)
|
2022-05-13 15:27:26 +00:00
|
|
|
|
return Constants.appViewStackIndex.communitiesPortal
|
2022-10-18 09:06:18 +00:00
|
|
|
|
if (activeSectionType === Constants.appSection.wallet)
|
2022-05-13 15:27:26 +00:00
|
|
|
|
return Constants.appViewStackIndex.wallet
|
2022-10-18 09:06:18 +00:00
|
|
|
|
if (activeSectionType === Constants.appSection.browser)
|
2022-05-13 15:27:26 +00:00
|
|
|
|
return Constants.appViewStackIndex.browser
|
2022-10-18 09:06:18 +00:00
|
|
|
|
if (activeSectionType === Constants.appSection.profile)
|
2022-05-13 15:27:26 +00:00
|
|
|
|
return Constants.appViewStackIndex.profile
|
2022-10-18 09:06:18 +00:00
|
|
|
|
if (activeSectionType === Constants.appSection.node)
|
2022-05-13 15:27:26 +00:00
|
|
|
|
return Constants.appViewStackIndex.node
|
2021-12-17 17:42:12 +00:00
|
|
|
|
|
2022-05-13 15:27:26 +00:00
|
|
|
|
// We should never end up here
|
2022-10-18 09:06:18 +00:00
|
|
|
|
console.error("AppMain: Unknown section type")
|
2021-11-01 20:10:50 +00:00
|
|
|
|
}
|
2021-10-19 10:27:41 +00:00
|
|
|
|
|
2022-05-13 15:27:26 +00:00
|
|
|
|
// NOTE:
|
|
|
|
|
// If we ever change stack layout component order we need to updade
|
|
|
|
|
// Constants.appViewStackIndex accordingly
|
|
|
|
|
|
2023-01-30 21:05:34 +00:00
|
|
|
|
Loader {
|
|
|
|
|
id: personalChatLayoutLoader
|
2023-02-07 14:21:32 +00:00
|
|
|
|
asynchronous: true
|
|
|
|
|
active: appView.currentIndex === Constants.appViewStackIndex.chat
|
2023-01-30 21:05:34 +00:00
|
|
|
|
sourceComponent: {
|
|
|
|
|
if (appMain.rootStore.mainModuleInst.chatsLoadingFailed) {
|
|
|
|
|
return errorStateComponent
|
|
|
|
|
}
|
|
|
|
|
if (appMain.rootStore.mainModuleInst.chatsLoaded) {
|
|
|
|
|
return personalChatLayoutComponent
|
|
|
|
|
}
|
|
|
|
|
return loadingStateComponent
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: loadingStateComponent
|
|
|
|
|
Item {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
|
|
Row {
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
spacing: 6
|
|
|
|
|
StatusBaseText {
|
2023-02-10 16:18:46 +00:00
|
|
|
|
text: qsTr("Loading chats...")
|
2023-01-30 21:05:34 +00:00
|
|
|
|
}
|
|
|
|
|
LoadingAnimation {}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: errorStateComponent
|
|
|
|
|
Item {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
StatusBaseText {
|
|
|
|
|
text: qsTr("Error loading chats, try closing the app and restarting")
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: personalChatLayoutComponent
|
2021-06-17 18:41:11 +00:00
|
|
|
|
|
2023-01-30 21:05:34 +00:00
|
|
|
|
ChatLayout {
|
|
|
|
|
id: chatLayoutContainer
|
2021-12-17 17:42:12 +00:00
|
|
|
|
|
2023-02-27 12:11:51 +00:00
|
|
|
|
Binding {
|
|
|
|
|
target: rootDropAreaPanel
|
|
|
|
|
property: "enabled"
|
|
|
|
|
value: chatLayoutContainer.currentIndex === 0 // Meaning: Chats / channels view
|
|
|
|
|
when: visible
|
|
|
|
|
restoreMode: Binding.RestoreBindingOrValue
|
|
|
|
|
}
|
2023-02-09 21:49:36 +00:00
|
|
|
|
|
2023-02-27 12:11:51 +00:00
|
|
|
|
rootStore: appMain.rootChatStore
|
2023-03-07 16:34:36 +00:00
|
|
|
|
emojiPopup: statusEmojiPopup
|
|
|
|
|
stickersPopup: statusStickersPopupLoader.item
|
2021-12-21 09:26:13 +00:00
|
|
|
|
|
2023-03-07 16:34:36 +00:00
|
|
|
|
onProfileButtonClicked: {
|
2023-01-30 21:05:34 +00:00
|
|
|
|
Global.changeAppSectionBySectionType(Constants.appSection.profile);
|
|
|
|
|
}
|
2022-01-04 12:06:05 +00:00
|
|
|
|
|
2023-03-07 16:34:36 +00:00
|
|
|
|
onOpenAppSearch: {
|
2023-01-30 21:05:34 +00:00
|
|
|
|
appSearch.openSearchPopup()
|
|
|
|
|
}
|
2022-05-10 16:04:25 +00:00
|
|
|
|
|
2023-01-30 21:05:34 +00:00
|
|
|
|
onImportCommunityClicked: {
|
2023-02-07 14:21:32 +00:00
|
|
|
|
popups.openPopup(communitiesPortalLayoutContainer.importCommunitiesPopup);
|
2023-01-30 21:05:34 +00:00
|
|
|
|
}
|
2022-05-10 16:04:25 +00:00
|
|
|
|
|
2023-01-30 21:05:34 +00:00
|
|
|
|
onCreateCommunityClicked: {
|
2023-02-07 14:21:32 +00:00
|
|
|
|
popups.openPopup(communitiesPortalLayoutContainer.createCommunitiesPopup);
|
2023-01-30 21:05:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
rootStore.chatCommunitySectionModule = appMain.rootStore.mainModuleInst.getChatSectionModule()
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-05-13 15:27:26 +00:00
|
|
|
|
}
|
2021-12-17 17:42:12 +00:00
|
|
|
|
}
|
2021-06-17 18:41:11 +00:00
|
|
|
|
|
2022-05-13 15:27:26 +00:00
|
|
|
|
CommunitiesPortalLayout {
|
|
|
|
|
id: communitiesPortalLayoutContainer
|
2021-12-17 17:42:12 +00:00
|
|
|
|
}
|
2021-11-10 12:48:22 +00:00
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
Loader {
|
2023-01-10 13:19:02 +00:00
|
|
|
|
active: appView.currentIndex === Constants.appViewStackIndex.wallet
|
2022-10-18 09:06:18 +00:00
|
|
|
|
asynchronous: true
|
|
|
|
|
sourceComponent: WalletLayout {
|
|
|
|
|
store: appMain.rootStore
|
|
|
|
|
contactsStore: appMain.rootStore.profileSectionStore.contactsStore
|
|
|
|
|
emojiPopup: statusEmojiPopup
|
2022-10-17 10:17:25 +00:00
|
|
|
|
sendModalPopup: sendModal
|
2022-05-13 15:27:26 +00:00
|
|
|
|
}
|
2023-01-10 13:19:02 +00:00
|
|
|
|
onLoaded: item.showSigningPhrasePopup()
|
2022-05-13 15:27:26 +00:00
|
|
|
|
}
|
2022-05-23 13:11:30 +00:00
|
|
|
|
|
2022-05-13 15:27:26 +00:00
|
|
|
|
Loader {
|
|
|
|
|
id: browserLayoutContainer
|
2023-01-10 13:19:02 +00:00
|
|
|
|
active: appView.currentIndex === Constants.appViewStackIndex.browser
|
2022-10-18 09:06:18 +00:00
|
|
|
|
asynchronous: true
|
|
|
|
|
sourceComponent: BrowserLayout {
|
|
|
|
|
globalStore: appMain.rootStore
|
|
|
|
|
sendTransactionModal: sendModal
|
|
|
|
|
}
|
2022-05-13 15:27:26 +00:00
|
|
|
|
// Loaders do not have access to the context, so props need to be set
|
|
|
|
|
// Adding a "_" to avoid a binding loop
|
|
|
|
|
// Not Refactored Yet
|
|
|
|
|
// property var _chatsModel: chatsModel.messageView
|
|
|
|
|
// Not Refactored Yet
|
|
|
|
|
// property var _walletModel: walletModel
|
|
|
|
|
// Not Refactored Yet
|
|
|
|
|
// property var _utilsModel: utilsModel
|
2022-10-18 09:06:18 +00:00
|
|
|
|
// property var _web3Provider: BrowserStores.Web3ProviderStore.web3ProviderInst
|
2022-05-13 15:27:26 +00:00
|
|
|
|
}
|
2021-11-10 08:09:31 +00:00
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
Loader {
|
2023-01-10 13:19:02 +00:00
|
|
|
|
active: appView.currentIndex === Constants.appViewStackIndex.profile
|
2022-10-18 09:06:18 +00:00
|
|
|
|
asynchronous: true
|
|
|
|
|
sourceComponent: ProfileLayout {
|
|
|
|
|
store: appMain.rootStore.profileSectionStore
|
|
|
|
|
globalStore: appMain.rootStore
|
|
|
|
|
systemPalette: appMain.sysPalette
|
|
|
|
|
emojiPopup: statusEmojiPopup
|
|
|
|
|
}
|
2021-12-17 17:42:12 +00:00
|
|
|
|
}
|
2022-01-31 13:29:27 +00:00
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
Loader {
|
2023-01-10 13:19:02 +00:00
|
|
|
|
active: appView.currentIndex === Constants.appViewStackIndex.node
|
2022-10-18 09:06:18 +00:00
|
|
|
|
asynchronous: true
|
|
|
|
|
sourceComponent: NodeLayout {}
|
2022-05-13 15:27:26 +00:00
|
|
|
|
}
|
2021-06-17 18:41:11 +00:00
|
|
|
|
|
2022-05-13 15:27:26 +00:00
|
|
|
|
Repeater {
|
2022-10-18 09:06:18 +00:00
|
|
|
|
model: appMain.rootStore.mainModuleInst.sectionsModel
|
2022-05-13 15:27:26 +00:00
|
|
|
|
|
|
|
|
|
delegate: DelegateChooser {
|
|
|
|
|
role: "sectionType"
|
|
|
|
|
DelegateChoice {
|
|
|
|
|
roleValue: Constants.appSection.community
|
2022-10-18 09:06:18 +00:00
|
|
|
|
|
|
|
|
|
delegate: Loader {
|
2023-01-10 13:19:02 +00:00
|
|
|
|
readonly property string sectionId: model.id
|
|
|
|
|
active: sectionId === appMain.rootStore.mainModuleInst.activeSection.id
|
2022-10-18 09:06:18 +00:00
|
|
|
|
asynchronous: true
|
2022-05-13 15:27:26 +00:00
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
|
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
sourceComponent: ChatLayout {
|
2023-02-27 12:11:51 +00:00
|
|
|
|
id: chatLayoutComponent
|
|
|
|
|
|
|
|
|
|
Binding {
|
|
|
|
|
target: rootDropAreaPanel
|
|
|
|
|
property: "enabled"
|
|
|
|
|
value: chatLayoutComponent.currentIndex === 0 // Meaning: Chats / channels view
|
|
|
|
|
when: visible
|
|
|
|
|
restoreMode: Binding.RestoreBindingOrValue
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-07 16:34:36 +00:00
|
|
|
|
emojiPopup: statusEmojiPopup
|
|
|
|
|
stickersPopup: statusStickersPopupLoader.item
|
2022-05-13 15:27:26 +00:00
|
|
|
|
|
2023-02-09 21:49:36 +00:00
|
|
|
|
rootStore: appMain.rootChatStore
|
2022-05-13 15:27:26 +00:00
|
|
|
|
|
2023-03-07 16:34:36 +00:00
|
|
|
|
onProfileButtonClicked: {
|
2022-10-18 09:06:18 +00:00
|
|
|
|
Global.changeAppSectionBySectionType(Constants.appSection.profile);
|
|
|
|
|
}
|
2022-05-13 15:27:26 +00:00
|
|
|
|
|
2023-03-07 16:34:36 +00:00
|
|
|
|
onOpenAppSearch: {
|
2022-10-18 09:06:18 +00:00
|
|
|
|
appSearch.openSearchPopup()
|
|
|
|
|
}
|
2022-05-13 15:27:26 +00:00
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
// we cannot return QVariant if we pass another parameter in a function call
|
|
|
|
|
// that's why we're using it this way
|
|
|
|
|
appMain.rootStore.mainModuleInst.prepareCommunitySectionModuleForCommunityId(model.id)
|
|
|
|
|
rootStore.chatCommunitySectionModule = appMain.rootStore.mainModuleInst.getCommunitySectionModule()
|
|
|
|
|
}
|
2022-05-13 15:27:26 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-12-17 17:42:12 +00:00
|
|
|
|
}
|
2021-06-17 18:41:11 +00:00
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
Loader {
|
2022-07-22 11:24:28 +00:00
|
|
|
|
id: createChatView
|
|
|
|
|
|
2022-05-13 15:27:26 +00:00
|
|
|
|
property bool opened: false
|
2023-01-30 21:05:34 +00:00
|
|
|
|
active: appMain.rootStore.mainModuleInst.chatsLoaded && opened
|
2021-12-30 12:39:47 +00:00
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
asynchronous: true
|
2022-05-13 15:27:26 +00:00
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.topMargin: 8
|
|
|
|
|
anchors.rightMargin: 8
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
anchors.right: parent.right
|
2023-01-30 21:05:34 +00:00
|
|
|
|
width: active ?
|
|
|
|
|
parent.width - Constants.chatSectionLeftColumnWidth -
|
|
|
|
|
anchors.rightMargin - anchors.leftMargin : 0
|
2022-07-12 08:56:47 +00:00
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
sourceComponent: CreateChatView {
|
2023-02-09 21:49:36 +00:00
|
|
|
|
rootStore: appMain.rootChatStore
|
2022-10-18 09:06:18 +00:00
|
|
|
|
emojiPopup: statusEmojiPopup
|
2023-01-30 21:05:34 +00:00
|
|
|
|
stickersPopup: statusStickersPopupLoader.item
|
2022-06-01 14:49:57 +00:00
|
|
|
|
}
|
2022-05-17 14:09:22 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2022-06-01 14:49:57 +00:00
|
|
|
|
} // ColumnLayout
|
2021-06-17 18:41:11 +00:00
|
|
|
|
|
2022-07-26 14:23:45 +00:00
|
|
|
|
Component {
|
|
|
|
|
id: activityCenterPopupComponent
|
|
|
|
|
ActivityCenterPopup {
|
2022-11-04 14:23:33 +00:00
|
|
|
|
// TODO get screen size // Taken from old code top bar height was fixed there to 56
|
|
|
|
|
property int _buttonSize: 56
|
|
|
|
|
|
|
|
|
|
x: parent.width - width - Style.current.smallPadding
|
|
|
|
|
y: parent.y + _buttonSize
|
|
|
|
|
height: appView.height - _buttonSize * 2
|
2023-02-09 21:49:36 +00:00
|
|
|
|
store: appMain.rootChatStore
|
2022-10-26 16:00:20 +00:00
|
|
|
|
activityCenterStore: appMain.activityCenterStore
|
2022-07-26 14:23:45 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-19 10:27:41 +00:00
|
|
|
|
// Add SendModal here as it is used by the Wallet as well as the Browser
|
2021-06-17 18:41:11 +00:00
|
|
|
|
Loader {
|
|
|
|
|
id: sendModal
|
|
|
|
|
active: false
|
2022-02-04 13:07:48 +00:00
|
|
|
|
|
2022-07-19 15:09:20 +00:00
|
|
|
|
function open(address = "") {
|
2021-06-17 18:41:11 +00:00
|
|
|
|
this.active = true
|
2022-07-19 15:09:20 +00:00
|
|
|
|
this.item.addressText = address;
|
2021-06-17 18:41:11 +00:00
|
|
|
|
this.item.open()
|
2020-11-03 10:29:56 +00:00
|
|
|
|
}
|
2021-06-17 18:41:11 +00:00
|
|
|
|
function closed() {
|
|
|
|
|
// this.sourceComponent = undefined // kill an opened instance
|
|
|
|
|
this.active = false
|
2020-11-03 10:29:56 +00:00
|
|
|
|
}
|
2021-12-07 23:15:17 +00:00
|
|
|
|
property var selectedAccount
|
2022-11-23 17:58:22 +00:00
|
|
|
|
property bool isBridgeTx
|
2021-06-17 18:41:11 +00:00
|
|
|
|
sourceComponent: SendModal {
|
|
|
|
|
onClosed: {
|
|
|
|
|
sendModal.closed()
|
2022-11-23 17:58:22 +00:00
|
|
|
|
sendModal.isBridgeTx = false
|
2021-06-17 18:41:11 +00:00
|
|
|
|
}
|
2020-12-28 20:03:57 +00:00
|
|
|
|
}
|
2021-12-07 23:15:17 +00:00
|
|
|
|
onLoaded: {
|
2022-04-12 09:10:55 +00:00
|
|
|
|
if (!!sendModal.selectedAccount) {
|
2022-06-27 13:41:47 +00:00
|
|
|
|
item.selectedAccount = sendModal.selectedAccount
|
2021-12-07 23:15:17 +00:00
|
|
|
|
}
|
2022-11-23 17:58:22 +00:00
|
|
|
|
if(isBridgeTx)
|
|
|
|
|
item.isBridgeTx = sendModal.isBridgeTx
|
2021-12-07 23:15:17 +00:00
|
|
|
|
}
|
2020-12-28 20:03:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2021-06-17 18:41:11 +00:00
|
|
|
|
Action {
|
|
|
|
|
shortcut: "Ctrl+1"
|
2022-09-28 10:50:15 +00:00
|
|
|
|
onTriggered: {
|
|
|
|
|
Global.setNthEnabledSectionActive(0)
|
|
|
|
|
}
|
2020-12-28 20:03:57 +00:00
|
|
|
|
}
|
2021-06-17 18:41:11 +00:00
|
|
|
|
Action {
|
|
|
|
|
shortcut: "Ctrl+2"
|
2022-09-28 10:50:15 +00:00
|
|
|
|
onTriggered: {
|
|
|
|
|
Global.setNthEnabledSectionActive(1)
|
|
|
|
|
}
|
2020-12-28 20:03:57 +00:00
|
|
|
|
}
|
2021-06-17 18:41:11 +00:00
|
|
|
|
Action {
|
|
|
|
|
shortcut: "Ctrl+3"
|
2022-09-28 10:50:15 +00:00
|
|
|
|
onTriggered: {
|
|
|
|
|
Global.setNthEnabledSectionActive(2)
|
|
|
|
|
}
|
2021-06-17 18:41:11 +00:00
|
|
|
|
}
|
|
|
|
|
Action {
|
2022-09-28 10:50:15 +00:00
|
|
|
|
shortcut: "Ctrl+4"
|
|
|
|
|
onTriggered: {
|
|
|
|
|
Global.setNthEnabledSectionActive(3)
|
|
|
|
|
}
|
2021-06-17 18:41:11 +00:00
|
|
|
|
}
|
2022-09-28 10:50:15 +00:00
|
|
|
|
Action {
|
|
|
|
|
shortcut: "Ctrl+5"
|
|
|
|
|
onTriggered: {
|
|
|
|
|
Global.setNthEnabledSectionActive(4)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Action {
|
|
|
|
|
shortcut: "Ctrl+6"
|
|
|
|
|
onTriggered: {
|
|
|
|
|
Global.setNthEnabledSectionActive(5)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Action {
|
|
|
|
|
shortcut: "Ctrl+7"
|
|
|
|
|
onTriggered: {
|
|
|
|
|
Global.setNthEnabledSectionActive(6)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Action {
|
|
|
|
|
shortcut: "Ctrl+8"
|
|
|
|
|
onTriggered: {
|
|
|
|
|
Global.setNthEnabledSectionActive(7)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Action {
|
|
|
|
|
shortcut: "Ctrl+9"
|
|
|
|
|
onTriggered: {
|
|
|
|
|
Global.setNthEnabledSectionActive(8)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-17 18:41:11 +00:00
|
|
|
|
Action {
|
|
|
|
|
shortcut: "Ctrl+K"
|
|
|
|
|
onTriggered: {
|
2022-02-16 16:13:45 +00:00
|
|
|
|
// FIXME the focus is no longer on the AppMain when the popup is opened, so this does not work to close
|
2022-10-18 09:06:18 +00:00
|
|
|
|
if (!channelPickerLoader.active)
|
|
|
|
|
channelPickerLoader.active = true
|
|
|
|
|
|
|
|
|
|
if (channelPickerLoader.item.opened) {
|
|
|
|
|
channelPickerLoader.item.close()
|
|
|
|
|
channelPickerLoader.active = false
|
2021-06-17 18:41:11 +00:00
|
|
|
|
} else {
|
2022-10-18 09:06:18 +00:00
|
|
|
|
channelPickerLoader.item.open()
|
2021-06-17 18:41:11 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-02-16 16:13:45 +00:00
|
|
|
|
Action {
|
|
|
|
|
shortcut: "Ctrl+F"
|
|
|
|
|
onTriggered: {
|
|
|
|
|
// FIXME the focus is no longer on the AppMain when the popup is opened, so this does not work to close
|
2022-10-18 09:06:18 +00:00
|
|
|
|
if (appSearch.active) {
|
2022-02-16 16:13:45 +00:00
|
|
|
|
appSearch.closeSearchPopup()
|
|
|
|
|
} else {
|
|
|
|
|
appSearch.openSearchPopup()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-06-17 18:41:11 +00:00
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
Loader {
|
|
|
|
|
id: channelPickerLoader
|
|
|
|
|
active: false
|
|
|
|
|
asynchronous: true
|
|
|
|
|
sourceComponent: StatusSearchListPopup {
|
|
|
|
|
searchBoxPlaceholder: qsTr("Where do you want to go?")
|
|
|
|
|
model: rootStore.chatSearchModel
|
|
|
|
|
delegate: StatusListItem {
|
|
|
|
|
property var modelData
|
|
|
|
|
property bool isCurrentItem: true
|
|
|
|
|
function filterAccepts(searchText) {
|
2022-12-07 15:14:48 +00:00
|
|
|
|
const lowerCaseSearchText = searchText.toLowerCase()
|
|
|
|
|
return title.toLowerCase().includes(lowerCaseSearchText) || label.toLowerCase().includes(lowerCaseSearchText)
|
2022-10-18 09:06:18 +00:00
|
|
|
|
}
|
2022-02-04 13:07:48 +00:00
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
title: modelData ? modelData.name : ""
|
|
|
|
|
label: modelData? modelData.sectionName : ""
|
|
|
|
|
highlighted: isCurrentItem
|
|
|
|
|
sensor.hoverEnabled: false
|
|
|
|
|
statusListItemIcon {
|
|
|
|
|
name: modelData ? modelData.name : ""
|
|
|
|
|
active: true
|
|
|
|
|
}
|
|
|
|
|
asset.width: 30
|
|
|
|
|
asset.height: 30
|
|
|
|
|
asset.color: modelData ? modelData.color : ""
|
|
|
|
|
asset.name: modelData ? modelData.icon : ""
|
|
|
|
|
asset.isImage: asset.name.includes("data")
|
2022-02-04 13:07:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
onAboutToShow: rootStore.rebuildChatSearchModel()
|
|
|
|
|
onSelected: {
|
|
|
|
|
rootStore.setActiveSectionChat(modelData.sectionId, modelData.chatId)
|
|
|
|
|
close()
|
2022-02-04 13:07:48 +00:00
|
|
|
|
}
|
2022-01-24 17:59:59 +00:00
|
|
|
|
}
|
2020-12-28 20:03:57 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2021-09-23 11:59:29 +00:00
|
|
|
|
|
2022-07-14 11:03:36 +00:00
|
|
|
|
StatusListView {
|
2022-05-05 10:28:54 +00:00
|
|
|
|
id: toastArea
|
2022-10-20 12:58:56 +00:00
|
|
|
|
objectName: "ephemeralNotificationList"
|
2022-05-05 10:28:54 +00:00
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.rightMargin: 8
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
anchors.bottomMargin: 60
|
2022-08-22 12:56:28 +00:00
|
|
|
|
width: 343
|
|
|
|
|
height: Math.min(parent.height - 120, toastArea.contentHeight)
|
2022-05-05 10:28:54 +00:00
|
|
|
|
spacing: 8
|
|
|
|
|
verticalLayoutDirection: ListView.BottomToTop
|
|
|
|
|
model: appMain.rootStore.mainModuleInst.ephemeralNotificationModel
|
2022-08-22 12:56:28 +00:00
|
|
|
|
|
2022-05-05 10:28:54 +00:00
|
|
|
|
delegate: StatusToastMessage {
|
|
|
|
|
primaryText: model.title
|
|
|
|
|
secondaryText: model.subTitle
|
|
|
|
|
icon.name: model.icon
|
|
|
|
|
loading: model.loading
|
|
|
|
|
type: model.ephNotifType
|
|
|
|
|
linkUrl: model.url
|
|
|
|
|
duration: model.durationInMs
|
2022-06-21 10:42:27 +00:00
|
|
|
|
onClicked: {
|
2022-09-29 13:45:34 +00:00
|
|
|
|
appMain.rootStore.mainModuleInst.ephemeralNotificationClicked(model.timestamp)
|
2022-06-21 10:42:27 +00:00
|
|
|
|
this.open = false
|
|
|
|
|
}
|
2022-05-05 10:28:54 +00:00
|
|
|
|
onLinkActivated: {
|
|
|
|
|
Qt.openUrlExternally(link);
|
|
|
|
|
}
|
2022-08-22 12:56:28 +00:00
|
|
|
|
|
2022-05-05 10:28:54 +00:00
|
|
|
|
onClose: {
|
2022-09-29 13:45:34 +00:00
|
|
|
|
appMain.rootStore.mainModuleInst.removeEphemeralNotification(model.timestamp)
|
2022-05-05 10:28:54 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-23 11:59:29 +00:00
|
|
|
|
Component.onCompleted: {
|
2022-03-07 20:34:59 +00:00
|
|
|
|
const whitelist = appMain.rootStore.messagingStore.getLinkPreviewWhitelist()
|
2022-02-10 20:02:02 +00:00
|
|
|
|
try {
|
|
|
|
|
const whiteListedSites = JSON.parse(whitelist)
|
|
|
|
|
let settingsUpdated = false
|
2021-11-18 19:34:03 +00:00
|
|
|
|
|
2022-02-10 20:02:02 +00:00
|
|
|
|
// Add Status links to whitelist
|
|
|
|
|
whiteListedSites.push({title: "Status", address: Constants.deepLinkPrefix, imageSite: false})
|
|
|
|
|
whiteListedSites.push({title: "Status", address: Constants.joinStatusLink, imageSite: false})
|
|
|
|
|
let settings = localAccountSensitiveSettings.whitelistedUnfurlingSites
|
2021-12-13 14:24:21 +00:00
|
|
|
|
|
2022-02-10 20:02:02 +00:00
|
|
|
|
if (!settings) {
|
|
|
|
|
settings = {}
|
|
|
|
|
}
|
2021-12-13 14:24:21 +00:00
|
|
|
|
|
2022-02-10 20:02:02 +00:00
|
|
|
|
// Set Status links as true. We intercept thoseURLs so it is privacy-safe
|
|
|
|
|
if (!settings[Constants.deepLinkPrefix] || !settings[Constants.joinStatusLink]) {
|
|
|
|
|
settings[Constants.deepLinkPrefix] = true
|
|
|
|
|
settings[Constants.joinStatusLink] = true
|
|
|
|
|
settingsUpdated = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const whitelistedHostnames = []
|
|
|
|
|
|
|
|
|
|
// Add whitelisted sites in to app settings that are not already there
|
|
|
|
|
whiteListedSites.forEach(site => {
|
|
|
|
|
if (!settings.hasOwnProperty(site.address)) {
|
|
|
|
|
settings[site.address] = false
|
|
|
|
|
settingsUpdated = true
|
|
|
|
|
}
|
|
|
|
|
whitelistedHostnames.push(site.address)
|
|
|
|
|
})
|
|
|
|
|
// Remove any whitelisted sites from app settings that don't exist in the
|
|
|
|
|
// whitelist from status-go
|
|
|
|
|
Object.keys(settings).forEach(settingsHostname => {
|
|
|
|
|
if (!whitelistedHostnames.includes(settingsHostname)) {
|
|
|
|
|
delete settings[settingsHostname]
|
|
|
|
|
settingsUpdated = true
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if (settingsUpdated) {
|
|
|
|
|
localAccountSensitiveSettings.whitelistedUnfurlingSites = settings
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.error('Could not parse the whitelist for sites', e)
|
|
|
|
|
}
|
2022-10-18 09:06:18 +00:00
|
|
|
|
Global.settingsLoaded()
|
2021-09-23 11:59:29 +00:00
|
|
|
|
}
|
2022-09-13 10:03:25 +00:00
|
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
|
id: keycardPopup
|
|
|
|
|
active: false
|
|
|
|
|
sourceComponent: KeycardPopup {
|
2022-12-16 09:37:08 +00:00
|
|
|
|
anchors.centerIn: parent
|
2022-10-18 09:06:18 +00:00
|
|
|
|
sharedKeycardModule: appMain.rootStore.mainModuleInst.keycardSharedModule
|
2022-09-13 10:03:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onLoaded: {
|
|
|
|
|
keycardPopup.item.open()
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-10-06 15:47:55 +00:00
|
|
|
|
|
|
|
|
|
DropAreaPanel {
|
2022-12-09 11:35:29 +00:00
|
|
|
|
id: rootDropAreaPanel
|
2023-02-27 12:11:51 +00:00
|
|
|
|
|
2022-10-06 15:47:55 +00:00
|
|
|
|
width: appMain.width
|
|
|
|
|
height: appMain.height
|
|
|
|
|
}
|
2020-05-11 21:24:08 +00:00
|
|
|
|
}
|