2020-06-17 19:18:31 +00:00
|
|
|
|
import QtQuick 2.13
|
|
|
|
|
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
|
|
|
|
|
import Qt.labs.settings 1.0
|
2022-09-02 14:56:14 +00:00
|
|
|
|
import QtQml.Models 2.14
|
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
|
|
|
|
|
import AppLayouts.Chat.popups 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
|
|
|
|
|
import AppLayouts.Profile.popups 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
|
2022-03-03 22:50:53 +00:00
|
|
|
|
|
2022-11-28 11:32:29 +00:00
|
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
|
2022-07-12 08:56:47 +00:00
|
|
|
|
import "popups"
|
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 {}
|
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-10-27 10:05:10 +00:00
|
|
|
|
signal closeProfilePopup()
|
|
|
|
|
|
2022-03-17 16:24:50 +00:00
|
|
|
|
Connections {
|
|
|
|
|
target: rootStore.mainModuleInst
|
2022-09-13 10:03:25 +00:00
|
|
|
|
|
2022-03-17 16:24:50 +00:00
|
|
|
|
onDisplayUserProfile: Global.openProfilePopup(publicKey)
|
2022-09-13 10:03:25 +00:00
|
|
|
|
|
|
|
|
|
onDisplayKeycardSharedModuleFlow: {
|
|
|
|
|
keycardPopup.active = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onDestroyKeycardSharedModuleFlow: {
|
|
|
|
|
keycardPopup.active = false
|
|
|
|
|
}
|
2022-10-18 09:06:18 +00:00
|
|
|
|
|
|
|
|
|
function onMailserverNotWorking() {
|
|
|
|
|
Global.openPopup(mailserverNotWorkingPopupComponent)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onActiveSectionChanged() {
|
|
|
|
|
createChatView.opened = false
|
|
|
|
|
}
|
2022-03-17 16:24:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-10-21 13:37:39 +00:00
|
|
|
|
Popups {
|
|
|
|
|
rootStore: appMain.rootStore
|
|
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
Global.openSendIDRequestPopup.connect(openSendIDRequestPopup)
|
|
|
|
|
Global.openOutgoingIDRequestPopup.connect(openOutgoingIDRequestPopup)
|
|
|
|
|
Global.openIncomingIDRequestPopup.connect(openIncomingIDRequestPopup)
|
|
|
|
|
Global.openInviteFriendsToCommunityPopup.connect(openInviteFriendsToCommunityPopup)
|
|
|
|
|
Global.openContactRequestPopup.connect(openContactRequestPopup)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-06 21:10:54 +00:00
|
|
|
|
Connections {
|
|
|
|
|
target: Global
|
|
|
|
|
onOpenLinkInBrowser: {
|
2022-10-18 09:06:18 +00:00
|
|
|
|
if (!browserLayoutContainer.active)
|
|
|
|
|
browserLayoutContainer.active = true;
|
2021-12-06 21:10:54 +00:00
|
|
|
|
browserLayoutContainer.item.openUrlInNewTab(link);
|
|
|
|
|
}
|
|
|
|
|
onOpenChooseBrowserPopup: {
|
2021-12-07 20:33:12 +00:00
|
|
|
|
Global.openPopup(chooseBrowserPopupComponent, {link: link});
|
|
|
|
|
}
|
2021-12-09 13:28:02 +00:00
|
|
|
|
onOpenDownloadModalRequested: {
|
2022-03-17 16:15:38 +00:00
|
|
|
|
const downloadPage = downloadPageComponent.createObject(appMain,
|
|
|
|
|
{
|
2022-03-03 21:00:52 +00:00
|
|
|
|
newVersionAvailable: available,
|
|
|
|
|
downloadURL: url,
|
2022-03-17 16:15:38 +00:00
|
|
|
|
currentVersion: rootStore.profileSectionStore.getCurrentVersion(),
|
2022-03-03 21:00:52 +00:00
|
|
|
|
newVersion: version
|
2022-03-17 16:15:38 +00:00
|
|
|
|
})
|
|
|
|
|
return downloadPage
|
2021-12-09 13:28:02 +00:00
|
|
|
|
}
|
2022-09-27 21:26:26 +00:00
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
onOpenImagePopup: {
|
|
|
|
|
var popup = imagePopupComponent.createObject(appMain)
|
|
|
|
|
popup.contextMenu = contextMenu
|
|
|
|
|
popup.openPopup(image)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onOpenCreateChatView: {
|
|
|
|
|
createChatView.opened = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onCloseCreateChatView: {
|
|
|
|
|
createChatView.opened = false
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-08 21:20:43 +00:00
|
|
|
|
onOpenProfilePopupRequested: {
|
2022-10-27 10:05:10 +00:00
|
|
|
|
if (Global.profilePopupOpened) {
|
|
|
|
|
appMain.closeProfilePopup()
|
|
|
|
|
}
|
2022-09-27 21:26:26 +00:00
|
|
|
|
Global.openPopup(profilePopupComponent, {publicKey: publicKey, parentPopup: parentPopup})
|
|
|
|
|
Global.profilePopupOpened = true
|
|
|
|
|
}
|
|
|
|
|
onOpenNicknamePopupRequested: {
|
|
|
|
|
Global.openPopup(nicknamePopupComponent, {publicKey: publicKey, nickname: nickname, "header.subTitle": subtitle})
|
|
|
|
|
}
|
|
|
|
|
onBlockContactRequested: {
|
|
|
|
|
Global.openPopup(blockContactConfirmationComponent, {contactName: contactName, contactAddress: publicKey})
|
|
|
|
|
}
|
|
|
|
|
onUnblockContactRequested: {
|
|
|
|
|
Global.openPopup(unblockContactConfirmationComponent, {contactName: contactName, contactAddress: publicKey})
|
2021-12-08 21:20:43 +00:00
|
|
|
|
}
|
2022-07-26 14:23:45 +00:00
|
|
|
|
|
|
|
|
|
onOpenActivityCenterPopupRequested: {
|
|
|
|
|
Global.openPopup(activityCenterPopupComponent)
|
|
|
|
|
Global.activityCenterPopupOpened = true
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-04 08:43:55 +00:00
|
|
|
|
onOpenChangeProfilePicPopup: {
|
2022-11-08 18:30:50 +00:00
|
|
|
|
var popup = changeProfilePicComponent.createObject(appMain, {callback: cb});
|
2022-06-22 12:16:21 +00:00
|
|
|
|
popup.chooseImageToCrop();
|
2022-02-04 08:43:55 +00:00
|
|
|
|
}
|
2022-06-28 10:55:33 +00:00
|
|
|
|
onOpenBackUpSeedPopup: Global.openPopup(backupSeedModalComponent)
|
2022-05-05 10:28:54 +00:00
|
|
|
|
onDisplayToastMessage: {
|
|
|
|
|
appMain.rootStore.mainModuleInst.displayEphemeralNotification(title, subTitle, icon, loading, ephNotifType, url);
|
|
|
|
|
}
|
2022-09-27 21:26:26 +00:00
|
|
|
|
onOpenEditDisplayNamePopup: Global.openPopup(displayNamePopupComponent)
|
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
|
|
|
|
|
2022-09-27 21:26:26 +00:00
|
|
|
|
Component {
|
|
|
|
|
id: backupSeedModalComponent
|
|
|
|
|
BackupSeedModal {
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
privacyStore: appMain.rootStore.profileSectionStore.privacyStore
|
|
|
|
|
onClosed: destroy()
|
|
|
|
|
}
|
2021-12-30 12:39:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-09-27 21:26:26 +00:00
|
|
|
|
Component {
|
|
|
|
|
id: displayNamePopupComponent
|
|
|
|
|
DisplayNamePopup {
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
profileStore: appMain.rootStore.profileSectionStore.profileStore
|
|
|
|
|
onClosed: {
|
|
|
|
|
destroy()
|
|
|
|
|
}
|
2022-06-28 18:11:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-08 21:20:43 +00:00
|
|
|
|
Component {
|
2022-03-17 16:15:38 +00:00
|
|
|
|
id: downloadPageComponent
|
|
|
|
|
DownloadPage {
|
2021-12-08 21:20:43 +00:00
|
|
|
|
onClosed: {
|
|
|
|
|
destroy();
|
|
|
|
|
}
|
2021-08-05 18:06:19 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
Component {
|
|
|
|
|
id: imagePopupComponent
|
|
|
|
|
StatusImageModal {
|
|
|
|
|
id: imagePopup
|
|
|
|
|
onClicked: {
|
|
|
|
|
if (mouse.button === Qt.LeftButton) {
|
|
|
|
|
imagePopup.close()
|
|
|
|
|
} else if(mouse.button === Qt.RightButton) {
|
|
|
|
|
contextMenu.imageSource = imagePopup.imageSource
|
|
|
|
|
contextMenu.hideEmojiPicker = true
|
|
|
|
|
contextMenu.isRightClickOnImage = true
|
|
|
|
|
contextMenu.parent = imagePopup.contentItem
|
|
|
|
|
contextMenu.show()
|
|
|
|
|
}
|
2022-01-26 20:36:11 +00:00
|
|
|
|
}
|
2022-10-18 09:06:18 +00:00
|
|
|
|
onClosed: destroy()
|
2022-01-26 20:36:11 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-27 21:26:26 +00:00
|
|
|
|
Component {
|
|
|
|
|
id: profilePopupComponent
|
|
|
|
|
ProfileDialog {
|
|
|
|
|
id: profilePopup
|
|
|
|
|
profileStore: appMain.rootStore.profileSectionStore.profileStore
|
|
|
|
|
contactsStore: appMain.rootStore.profileSectionStore.contactsStore
|
2022-10-27 10:05:10 +00:00
|
|
|
|
|
2022-09-27 21:26:26 +00:00
|
|
|
|
onClosed: {
|
|
|
|
|
if (profilePopup.parentPopup) {
|
|
|
|
|
profilePopup.parentPopup.close()
|
|
|
|
|
}
|
|
|
|
|
Global.profilePopupOpened = false
|
|
|
|
|
destroy()
|
2021-08-05 18:06:19 +00:00
|
|
|
|
}
|
2022-10-27 10:05:10 +00:00
|
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
appMain.closeProfilePopup.connect(profilePopup.close)
|
|
|
|
|
}
|
2021-08-13 20:04:04 +00:00
|
|
|
|
}
|
2021-06-11 12:17:23 +00:00
|
|
|
|
}
|
2021-02-18 19:14:31 +00:00
|
|
|
|
|
2022-09-27 21:26:26 +00:00
|
|
|
|
Component {
|
|
|
|
|
id: changeProfilePicComponent
|
2022-06-22 12:16:21 +00:00
|
|
|
|
ImageCropWorkflow {
|
|
|
|
|
title: qsTr("Profile Picture")
|
|
|
|
|
acceptButtonText: qsTr("Make this my Profile Pic")
|
|
|
|
|
onImageCropped: {
|
2022-11-08 18:30:50 +00:00
|
|
|
|
if (callback) {
|
|
|
|
|
callback(image,
|
|
|
|
|
cropRect.x.toFixed(),
|
|
|
|
|
cropRect.y.toFixed(),
|
|
|
|
|
(cropRect.x + cropRect.width).toFixed(),
|
|
|
|
|
(cropRect.y + cropRect.height).toFixed())
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-22 12:16:21 +00:00
|
|
|
|
appMain.rootStore.profileSectionStore.profileStore.uploadImage(image,
|
|
|
|
|
cropRect.x.toFixed(),
|
|
|
|
|
cropRect.y.toFixed(),
|
|
|
|
|
(cropRect.x + cropRect.width).toFixed(),
|
|
|
|
|
(cropRect.y + cropRect.height).toFixed());
|
|
|
|
|
}
|
2022-02-04 08:43:55 +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"
|
2022-05-10 16:04:25 +00:00
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
Global.sendMessageSound = this;
|
|
|
|
|
}
|
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-05-10 16:04:25 +00:00
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
Global.notificationSound = this;
|
|
|
|
|
}
|
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
|
2022-05-10 16:04:25 +00:00
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
Global.errorSound = this;
|
|
|
|
|
}
|
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
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-14 20:21:00 +00:00
|
|
|
|
StatusStickersPopup {
|
|
|
|
|
id: statusStickersPopup
|
|
|
|
|
store: chatLayoutContainer.rootStore
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
|
popupMenu: StatusMenu {
|
2021-06-17 18:41:11 +00:00
|
|
|
|
id: communityContextMenu
|
|
|
|
|
|
2022-01-18 20:54:14 +00:00
|
|
|
|
property var chatCommunitySectionModule
|
|
|
|
|
|
2021-06-17 18:41:11 +00:00
|
|
|
|
openHandler: function () {
|
2022-01-18 20:54:14 +00:00
|
|
|
|
// // we cannot return QVariant if we pass another parameter in a function call
|
|
|
|
|
// // that's why we're using it this way
|
2022-10-18 09:06:18 +00:00
|
|
|
|
appMain.rootStore.mainModuleInst.prepareCommunitySectionModuleForCommunityId(model.id)
|
|
|
|
|
communityContextMenu.chatCommunitySectionModule = appMain.rootStore.mainModuleInst.getCommunitySectionModule()
|
2022-02-04 13:07:48 +00:00
|
|
|
|
|
2021-06-17 18:41:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
|
StatusAction {
|
2022-04-04 11:26:30 +00:00
|
|
|
|
text: qsTr("Invite People")
|
2021-06-17 18:41:11 +00:00
|
|
|
|
icon.name: "share-ios"
|
2022-01-18 20:54:14 +00:00
|
|
|
|
enabled: model.canManageUsers
|
2022-09-28 21:07:18 +00:00
|
|
|
|
onTriggered: {
|
|
|
|
|
Global.openInviteFriendsToCommunityPopup(model,
|
2022-10-25 17:15:44 +00:00
|
|
|
|
communityContextMenu.chatCommunitySectionModule,
|
|
|
|
|
null)
|
2022-09-28 21:07:18 +00:00
|
|
|
|
}
|
2021-06-17 18:41:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
|
StatusAction {
|
2022-04-04 11:26:30 +00:00
|
|
|
|
text: qsTr("View Community")
|
2021-06-17 18:41:11 +00:00
|
|
|
|
icon.name: "group-chat"
|
2022-01-10 16:44:54 +00:00
|
|
|
|
onTriggered: Global.openPopup(communityProfilePopup, {
|
|
|
|
|
store: appMain.rootStore,
|
2022-01-18 20:54:14 +00:00
|
|
|
|
community: model,
|
|
|
|
|
communitySectionModule: communityContextMenu.chatCommunitySectionModule
|
2022-01-10 16:44:54 +00:00
|
|
|
|
})
|
2021-06-17 18:41:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
StatusMenuSeparator {}
|
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
|
StatusAction {
|
2022-04-04 11:26:30 +00:00
|
|
|
|
text: qsTr("Leave Community")
|
2022-08-02 13:48:07 +00:00
|
|
|
|
icon.name: "arrow-left"
|
2022-12-01 16:58:37 +00:00
|
|
|
|
type: StatusAction.Type.Danger
|
2022-01-18 20:54:14 +00:00
|
|
|
|
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,
|
|
|
|
|
appMain.rootStore.userProfileInst.ensName)
|
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
|
|
|
|
|
tooltip.text: model.name
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
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()
|
2022-03-17 16:15:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-09-02 14:56:14 +00:00
|
|
|
|
Connections {
|
|
|
|
|
target: rootStore.aboutModuleInst
|
|
|
|
|
onAppVersionFetched: {
|
|
|
|
|
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")
|
|
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
Global.openBackUpSeedPopup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
onLinkActivated: Global.openPopup(communitiesPortalLayoutContainer.discordImportProgressPopup)
|
|
|
|
|
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
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
onHideStarted: {
|
|
|
|
|
bannersLayout.connectedBanner = null
|
|
|
|
|
}
|
|
|
|
|
onHideFinished: {
|
|
|
|
|
destroy()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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()
|
|
|
|
|
}
|
|
|
|
|
onHideStarted: {
|
|
|
|
|
bannersLayout.updateBanner = null
|
|
|
|
|
}
|
|
|
|
|
onHideFinished: {
|
|
|
|
|
destroy()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
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) {
|
2021-12-17 17:42:12 +00:00
|
|
|
|
|
2022-05-13 15:27:26 +00:00
|
|
|
|
for(let i = this.children.length - 1; i >=0; i--)
|
2021-12-17 17:42:12 +00:00
|
|
|
|
{
|
2022-10-18 09:06:18 +00:00
|
|
|
|
var obj = this.children[i]
|
|
|
|
|
if (obj && obj.sectionId && obj.sectionId === appMain.rootStore.mainModuleInst.activeSection.id)
|
2022-05-13 15:27:26 +00:00
|
|
|
|
{
|
2022-10-18 09:06:18 +00:00
|
|
|
|
obj.active = true
|
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
|
2022-10-18 09:06:18 +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
|
|
|
|
onCurrentIndexChanged: {
|
2022-10-18 09:06:18 +00:00
|
|
|
|
var obj = this.children[currentIndex]
|
|
|
|
|
if (!obj)
|
2022-05-13 15:27:26 +00:00
|
|
|
|
return
|
2021-10-19 10:27:41 +00:00
|
|
|
|
|
2022-11-21 15:46:41 +00:00
|
|
|
|
createChatView.opened = false
|
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
if (obj === browserLayoutContainer && browserLayoutContainer.active == false) {
|
|
|
|
|
browserLayoutContainer.active = true;
|
2022-05-13 15:27:26 +00:00
|
|
|
|
}
|
2021-10-19 10:27:41 +00:00
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
if (obj === walletLayoutContainer && !walletLayoutContainer.active) {
|
|
|
|
|
walletLayoutContainer.active = true
|
|
|
|
|
walletLayoutContainer.item.showSigningPhrasePopup()
|
2022-05-13 15:27:26 +00:00
|
|
|
|
}
|
2021-08-18 14:43:59 +00:00
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
if (obj === profileLayoutContainer && !profileLayoutContainer.active) {
|
|
|
|
|
profileLayoutContainer.active = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (obj === nodeLayoutContainer && !nodeLayoutContainer.active) {
|
|
|
|
|
nodeLayoutContainer.active = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (obj.onActivated && typeof obj.onActivated === "function") {
|
|
|
|
|
this.children[currentIndex].onActivated()
|
2022-05-13 15:27:26 +00:00
|
|
|
|
}
|
2021-12-17 17:42:12 +00:00
|
|
|
|
}
|
2021-03-05 18:45:39 +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
|
|
|
|
|
|
|
|
|
|
ChatLayout {
|
|
|
|
|
id: chatLayoutContainer
|
2021-06-17 18:41:11 +00:00
|
|
|
|
|
2022-05-13 15:27:26 +00:00
|
|
|
|
chatView.emojiPopup: statusEmojiPopup
|
2022-11-14 20:21:00 +00:00
|
|
|
|
chatView.stickersPopup: statusStickersPopup
|
2021-12-17 17:42:12 +00:00
|
|
|
|
|
2022-05-13 15:27:26 +00:00
|
|
|
|
contactsStore: appMain.rootStore.contactStore
|
|
|
|
|
rootStore.emojiReactionsModel: appMain.rootStore.emojiReactionsModel
|
2022-07-22 11:24:28 +00:00
|
|
|
|
rootStore.openCreateChat: createChatView.opened
|
2021-12-21 09:26:13 +00:00
|
|
|
|
|
2022-05-13 15:27:26 +00:00
|
|
|
|
chatView.onProfileButtonClicked: {
|
|
|
|
|
Global.changeAppSectionBySectionType(Constants.appSection.profile);
|
|
|
|
|
}
|
2021-12-21 09:26:13 +00:00
|
|
|
|
|
2022-05-13 15:27:26 +00:00
|
|
|
|
chatView.onOpenAppSearch: {
|
|
|
|
|
appSearch.openSearchPopup()
|
|
|
|
|
}
|
2022-01-04 12:06:05 +00:00
|
|
|
|
|
2022-05-10 16:04:25 +00:00
|
|
|
|
onImportCommunityClicked: {
|
|
|
|
|
Global.openPopup(communitiesPortalLayoutContainer.importCommunitiesPopup);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onCreateCommunityClicked: {
|
|
|
|
|
Global.openPopup(communitiesPortalLayoutContainer.createCommunitiesPopup);
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-13 15:27:26 +00:00
|
|
|
|
Component.onCompleted: {
|
2022-10-18 09:06:18 +00:00
|
|
|
|
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 {
|
2022-05-13 15:27:26 +00:00
|
|
|
|
id: walletLayoutContainer
|
2022-10-18 09:06:18 +00:00
|
|
|
|
active: false
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
}
|
2022-05-23 13:11:30 +00:00
|
|
|
|
|
2022-05-13 15:27:26 +00:00
|
|
|
|
Loader {
|
|
|
|
|
id: browserLayoutContainer
|
|
|
|
|
active: false
|
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 {
|
2022-05-13 15:27:26 +00:00
|
|
|
|
id: profileLayoutContainer
|
2022-10-18 09:06:18 +00:00
|
|
|
|
active: false
|
|
|
|
|
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 {
|
2022-05-13 15:27:26 +00:00
|
|
|
|
id: nodeLayoutContainer
|
2022-10-18 09:06:18 +00:00
|
|
|
|
active: false
|
|
|
|
|
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 {
|
2022-05-13 15:27:26 +00:00
|
|
|
|
property string sectionId: model.id
|
2022-10-18 09:06:18 +00:00
|
|
|
|
active: false
|
|
|
|
|
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 {
|
|
|
|
|
chatView.emojiPopup: statusEmojiPopup
|
2022-11-14 20:21:00 +00:00
|
|
|
|
chatView.stickersPopup: statusStickersPopup
|
2022-05-13 15:27:26 +00:00
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
contactsStore: appMain.rootStore.contactStore
|
|
|
|
|
rootStore.emojiReactionsModel: appMain.rootStore.emojiReactionsModel
|
|
|
|
|
rootStore.openCreateChat: createChatView.opened
|
2022-05-13 15:27:26 +00:00
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
chatView.onProfileButtonClicked: {
|
|
|
|
|
Global.changeAppSectionBySectionType(Constants.appSection.profile);
|
|
|
|
|
}
|
2022-05-13 15:27:26 +00:00
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
chatView.onOpenAppSearch: {
|
|
|
|
|
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
|
2022-10-18 09:06:18 +00:00
|
|
|
|
active: 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
|
2022-08-02 12:52:13 +00:00
|
|
|
|
width: parent.width - chatLayoutContainer.chatView.leftPanel.width - anchors.rightMargin - anchors.leftMargin
|
2022-07-12 08:56:47 +00:00
|
|
|
|
|
2022-10-18 09:06:18 +00:00
|
|
|
|
sourceComponent: CreateChatView {
|
|
|
|
|
rootStore: chatLayoutContainer.rootStore
|
|
|
|
|
emojiPopup: statusEmojiPopup
|
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-05-17 14:09:22 +00:00
|
|
|
|
Component {
|
|
|
|
|
id: mailserverNotWorkingPopupComponent
|
2022-07-12 08:56:47 +00:00
|
|
|
|
MailserverConnectionDialog {
|
2022-05-17 14:09:22 +00:00
|
|
|
|
onClosed: {
|
|
|
|
|
destroy()
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-07-12 08:56:47 +00:00
|
|
|
|
}
|
2022-05-17 14:09:22 +00:00
|
|
|
|
|
2021-06-17 18:41:11 +00:00
|
|
|
|
Component {
|
|
|
|
|
id: chooseBrowserPopupComponent
|
|
|
|
|
ChooseBrowserPopup {
|
|
|
|
|
onClosed: {
|
|
|
|
|
destroy()
|
|
|
|
|
}
|
2020-12-29 20:33:54 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2020-12-21 12:08:44 +00:00
|
|
|
|
|
2021-06-17 18:41:11 +00:00
|
|
|
|
Component {
|
2021-07-16 12:36:27 +00:00
|
|
|
|
id: communityProfilePopup
|
|
|
|
|
|
2021-06-17 18:41:11 +00:00
|
|
|
|
CommunityProfilePopup {
|
|
|
|
|
anchors.centerIn: parent
|
2022-01-19 20:07:02 +00:00
|
|
|
|
contactsStore: appMain.rootStore.contactStore
|
|
|
|
|
hasAddedContacts: appMain.rootStore.hasAddedContacts
|
2021-06-17 18:41:11 +00:00
|
|
|
|
|
|
|
|
|
onClosed: {
|
|
|
|
|
destroy()
|
|
|
|
|
}
|
2021-03-29 19:31:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-21 09:26:13 +00:00
|
|
|
|
Component {
|
|
|
|
|
id: pinnedMessagesPopupComponent
|
|
|
|
|
PinnedMessagesPopup {
|
|
|
|
|
id: pinnedMessagesPopup
|
2022-01-05 15:50:03 +00:00
|
|
|
|
emojiReactionsModel: appMain.rootStore.emojiReactionsModel
|
2021-12-21 09:26:13 +00:00
|
|
|
|
onClosed: destroy()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-17 18:41:11 +00:00
|
|
|
|
Component {
|
|
|
|
|
id: genericConfirmationDialog
|
|
|
|
|
ConfirmationDialog {
|
|
|
|
|
onClosed: {
|
|
|
|
|
destroy()
|
|
|
|
|
}
|
2021-07-26 18:44:25 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-26 14:23:45 +00:00
|
|
|
|
Component {
|
|
|
|
|
id: activityCenterPopupComponent
|
|
|
|
|
ActivityCenterPopup {
|
|
|
|
|
id: activityCenter
|
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
|
2022-07-26 14:23:45 +00:00
|
|
|
|
store: chatLayoutContainer.rootStore
|
2022-10-26 16:00:20 +00:00
|
|
|
|
activityCenterStore: appMain.activityCenterStore
|
2022-07-26 14:23:45 +00:00
|
|
|
|
onClosed: {
|
|
|
|
|
Global.activityCenterPopupOpened = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-27 21:26:26 +00:00
|
|
|
|
Component {
|
|
|
|
|
id: nicknamePopupComponent
|
|
|
|
|
NicknamePopup {
|
|
|
|
|
onEditDone: {
|
|
|
|
|
if (nickname !== newNickname) {
|
|
|
|
|
appMain.rootStore.contactStore.changeContactNickname(publicKey, newNickname)
|
|
|
|
|
Global.nickNameChanged(publicKey, newNickname)
|
|
|
|
|
}
|
|
|
|
|
close()
|
|
|
|
|
}
|
|
|
|
|
onClosed: destroy()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: unblockContactConfirmationComponent
|
|
|
|
|
UnblockContactConfirmationDialog {
|
|
|
|
|
onUnblockButtonClicked: {
|
|
|
|
|
appMain.rootStore.contactStore.unblockContact(contactAddress)
|
|
|
|
|
Global.contactUnblocked(contactAddress)
|
|
|
|
|
close()
|
|
|
|
|
}
|
|
|
|
|
onClosed: destroy()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: blockContactConfirmationComponent
|
|
|
|
|
BlockContactConfirmationDialog {
|
|
|
|
|
onBlockButtonClicked: {
|
|
|
|
|
appMain.rootStore.contactStore.blockContact(contactAddress)
|
|
|
|
|
Global.contactBlocked(contactAddress)
|
|
|
|
|
close()
|
|
|
|
|
}
|
|
|
|
|
onClosed: destroy()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
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-02-28 20:14:04 +00:00
|
|
|
|
Global.appMain = this;
|
2022-05-10 16:04:25 +00:00
|
|
|
|
Global.pinnedMessagesPopup = pinnedMessagesPopupComponent;
|
|
|
|
|
Global.communityProfilePopup = communityProfilePopup;
|
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-09-27 21:26:26 +00:00
|
|
|
|
Global.privacyModuleInst = appMain.rootStore.profileSectionStore.privacyStore.privacyModule
|
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-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 {
|
|
|
|
|
width: appMain.width
|
|
|
|
|
height: appMain.height
|
|
|
|
|
activeChatType: chatCommunitySectionModule && chatCommunitySectionModule.activeItem.type
|
|
|
|
|
enabled: !drag.source && (
|
|
|
|
|
// in chat view
|
2022-10-18 09:06:18 +00:00
|
|
|
|
(appMain.rootStore.mainModuleInst.activeSection.sectionType === Constants.appSection.chat &&
|
2022-10-06 15:47:55 +00:00
|
|
|
|
(
|
|
|
|
|
// in a one-to-one chat
|
|
|
|
|
activeChatType === Constants.chatType.oneToOne ||
|
|
|
|
|
// in a private group chat
|
|
|
|
|
activeChatType === Constants.chatType.privateGroupChat
|
|
|
|
|
)
|
|
|
|
|
) ||
|
|
|
|
|
// In community section
|
2022-10-18 09:06:18 +00:00
|
|
|
|
appMain.rootStore.mainModuleInst.activeSection.sectionType === Constants.appSection.community)
|
2022-10-06 15:47:55 +00:00
|
|
|
|
}
|
2020-05-11 21:24:08 +00:00
|
|
|
|
}
|