2021-12-06 21:10:54 +00:00
|
|
|
pragma Singleton
|
|
|
|
|
2022-10-21 13:37:39 +00:00
|
|
|
import QtQml 2.14
|
2021-12-06 21:10:54 +00:00
|
|
|
|
2022-10-21 13:37:39 +00:00
|
|
|
QtObject {
|
2021-12-07 20:33:12 +00:00
|
|
|
id: root
|
2021-12-21 09:26:13 +00:00
|
|
|
|
2022-10-06 15:47:55 +00:00
|
|
|
property var dragArea
|
2022-12-14 14:40:50 +00:00
|
|
|
property var applicationWindow
|
2023-05-23 12:46:16 +00:00
|
|
|
property bool activityPopupOpened: false
|
2022-02-25 13:32:46 +00:00
|
|
|
property int settingsSubsection: Constants.settingsSubsection.profile
|
2023-12-06 10:54:36 +00:00
|
|
|
property int settingsSubSubsection: -1
|
2021-12-07 20:33:12 +00:00
|
|
|
|
2022-12-09 19:43:36 +00:00
|
|
|
property var userProfile
|
2023-02-14 09:20:53 +00:00
|
|
|
property bool appIsReady: false
|
2021-12-08 21:20:43 +00:00
|
|
|
|
2024-05-06 20:22:43 +00:00
|
|
|
// use the generic var as type to break the cyclic dependency
|
|
|
|
property var walletConnectService: null
|
|
|
|
|
2024-05-01 12:15:40 +00:00
|
|
|
// avoid lookup of context property in QML
|
|
|
|
readonly property var featureFlags: featureFlagsRootContextProperty
|
|
|
|
|
2023-03-24 09:48:05 +00:00
|
|
|
signal openPinnedMessagesPopupRequested(var store, var messageStore, var pinnedMessagesModel, string messageToPin, string chatId)
|
2023-02-07 14:21:32 +00:00
|
|
|
signal openCommunityProfilePopupRequested(var store, var community, var chatCommunitySectionModule)
|
2022-05-10 16:04:25 +00:00
|
|
|
|
2021-12-06 21:10:54 +00:00
|
|
|
signal openLinkInBrowser(string link)
|
|
|
|
signal openChooseBrowserPopup(string link)
|
2022-05-13 15:27:26 +00:00
|
|
|
signal openCreateChatView()
|
|
|
|
signal closeCreateChatView()
|
2021-12-09 13:28:02 +00:00
|
|
|
|
2024-02-20 18:52:07 +00:00
|
|
|
signal blockContactRequested(string publicKey, var contactDetails)
|
|
|
|
signal unblockContactRequested(string publicKey, var contactDetails)
|
2022-09-27 21:26:26 +00:00
|
|
|
|
2022-05-05 10:28:54 +00:00
|
|
|
signal displayToastMessage(string title, string subTitle, string icon, bool loading, int ephNotifType, string url)
|
2023-11-03 15:55:04 +00:00
|
|
|
signal displayToastWithActionMessage(string title, string subTitle, string icon, string iconColor, bool loading, int ephNotifType, int actionType, string data)
|
2024-01-19 11:40:41 +00:00
|
|
|
signal displayImageToastWithActionMessage(string title, string subTitle, string image, int ephNotifType, int actionType, string data)
|
2021-12-08 21:20:43 +00:00
|
|
|
|
2023-02-07 14:21:32 +00:00
|
|
|
signal openPopupRequested(var popupComponent, var params)
|
2023-05-23 12:46:16 +00:00
|
|
|
signal closePopupRequested()
|
2024-03-07 09:51:16 +00:00
|
|
|
signal openNicknamePopupRequested(string publicKey, var contactDetails, var cb)
|
2022-12-14 14:40:50 +00:00
|
|
|
signal openDownloadModalRequested(bool available, string version, string url)
|
|
|
|
signal openChangeProfilePicPopup(var cb)
|
|
|
|
signal openBackUpSeedPopup()
|
2024-05-15 09:36:56 +00:00
|
|
|
signal openImagePopup(var image, string url, bool plain)
|
|
|
|
signal openVideoPopup(string url)
|
2023-05-30 19:01:55 +00:00
|
|
|
signal openProfilePopupRequested(string publicKey, var parentPopup, var cb)
|
2022-12-14 14:40:50 +00:00
|
|
|
signal openActivityCenterPopupRequested()
|
2024-02-16 11:56:29 +00:00
|
|
|
signal openSendIDRequestPopup(string publicKey, var contactDetails, var cb)
|
2024-02-26 09:39:08 +00:00
|
|
|
signal openMarkAsIDVerifiedPopup(string publicKey, var contactDetails, var cb)
|
|
|
|
signal openRemoveIDVerificationDialog(string publicKey, var contactDetails, var cb)
|
2024-02-16 11:56:29 +00:00
|
|
|
signal openContactRequestPopup(string publicKey, var contactDetails, var cb)
|
2024-02-29 21:01:33 +00:00
|
|
|
signal openReviewContactRequestPopup(string publicKey, var contactDetails, var cb)
|
2024-02-16 17:34:09 +00:00
|
|
|
signal markAsUntrustedRequested(string publicKey, var contactDetails)
|
2024-02-20 17:19:36 +00:00
|
|
|
signal removeContactRequested(string publicKey, var contactDetails)
|
2022-10-21 13:37:39 +00:00
|
|
|
signal openInviteFriendsToCommunityPopup(var community, var communitySectionModule, var cb)
|
2024-02-27 17:11:03 +00:00
|
|
|
signal openInviteFriendsToCommunityByIdPopup(string communityId, var cb)
|
2024-02-26 18:54:05 +00:00
|
|
|
signal openIncomingIDRequestPopup(string publicKey, var contactDetails, var cb)
|
|
|
|
signal openOutgoingIDRequestPopup(string publicKey, var contactDetails, var cb)
|
2023-05-19 16:07:50 +00:00
|
|
|
signal openDeleteMessagePopup(string messageId, var messageStore)
|
|
|
|
signal openDownloadImageDialog(string imageSource)
|
2023-09-12 09:26:57 +00:00
|
|
|
signal openExportControlNodePopup(var community)
|
|
|
|
signal openImportControlNodePopup(var community)
|
2023-11-24 08:48:50 +00:00
|
|
|
signal openTransferOwnershipPopup(string communityId,
|
|
|
|
string communityName,
|
2023-09-14 10:02:51 +00:00
|
|
|
string communityLogo,
|
|
|
|
var token,
|
|
|
|
var sendModalPopup)
|
2023-10-23 11:32:50 +00:00
|
|
|
signal openFinaliseOwnershipPopup(string communityId)
|
2023-10-23 11:36:33 +00:00
|
|
|
signal openDeclineOwnershipPopup(string communityId, string communityName)
|
2024-01-24 11:49:46 +00:00
|
|
|
signal openFirstTokenReceivedPopup(string communityId,
|
|
|
|
string communityName,
|
|
|
|
string communityLogo,
|
|
|
|
string tokenSymbol,
|
|
|
|
string tokenName,
|
|
|
|
string tokenAmount,
|
|
|
|
int tokenType,
|
|
|
|
string tokenImage)
|
2024-01-31 18:09:44 +00:00
|
|
|
signal openConfirmHideAssetPopup(string assetSymbol, string assetName, string assetImage, bool isCommunityToken)
|
|
|
|
signal openConfirmHideCollectiblePopup(string collectibleSymbol, string collectibleName, string collectibleImage, bool isCommunityToken)
|
2022-09-27 21:26:26 +00:00
|
|
|
|
2022-12-14 14:40:50 +00:00
|
|
|
signal openLink(string link)
|
2023-10-10 14:23:48 +00:00
|
|
|
signal openLinkWithConfirmation(string link, string domain)
|
2023-10-25 15:20:02 +00:00
|
|
|
signal activateDeepLink(string link)
|
2022-12-14 14:40:50 +00:00
|
|
|
|
|
|
|
signal setNthEnabledSectionActive(int nthSection)
|
2024-01-16 07:50:25 +00:00
|
|
|
signal appSectionBySectionTypeChanged(int sectionType, int subsection, int subSubsection, var data)
|
2022-12-14 14:40:50 +00:00
|
|
|
|
2023-02-28 15:00:10 +00:00
|
|
|
signal openSendModal(string address)
|
|
|
|
signal switchToCommunity(string communityId)
|
2023-06-21 20:37:51 +00:00
|
|
|
signal switchToCommunitySettings(string communityId)
|
2024-03-20 10:50:10 +00:00
|
|
|
signal switchToCommunityChannelsView(string communityId)
|
2023-04-28 10:35:18 +00:00
|
|
|
signal createCommunityPopupRequested(bool isDiscordImport)
|
|
|
|
signal importCommunityPopupRequested()
|
2023-07-21 17:21:11 +00:00
|
|
|
signal communityIntroPopupRequested(string communityId, string name, string introMessage,
|
2024-03-27 12:48:17 +00:00
|
|
|
string imageSrc, bool isInvitationPending)
|
2023-11-28 13:41:11 +00:00
|
|
|
signal communityShareAddressesPopupRequested(string communityId, string name, string imageSrc)
|
2023-06-14 08:42:52 +00:00
|
|
|
signal leaveCommunityRequested(string community, string communityId, string outroMessage)
|
2023-06-21 20:37:51 +00:00
|
|
|
signal openEditSharedAddressesFlow(string communityId)
|
2023-02-28 15:00:10 +00:00
|
|
|
|
2023-02-07 14:21:32 +00:00
|
|
|
signal playSendMessageSound()
|
|
|
|
signal playNotificationSound()
|
|
|
|
signal playErrorSound()
|
|
|
|
|
2023-06-27 19:56:44 +00:00
|
|
|
signal openTestnetPopup()
|
|
|
|
|
2024-05-13 17:23:01 +00:00
|
|
|
// Swap
|
|
|
|
signal openSwapModalRequested(var formDataParams)
|
|
|
|
|
2024-05-27 16:55:43 +00:00
|
|
|
// BuyCrypto
|
|
|
|
signal openBuyCryptoModalRequested()
|
|
|
|
|
2024-07-19 12:15:50 +00:00
|
|
|
// Metrics
|
|
|
|
signal openMetricsEnablePopupRequested(bool isOnboarding, var cb)
|
|
|
|
|
2024-04-10 20:56:10 +00:00
|
|
|
/////////////////////////////////////////////////////
|
|
|
|
// WalletConnect POC - to remove
|
2023-11-15 21:26:12 +00:00
|
|
|
signal popupWalletConnect()
|
2024-04-10 20:56:10 +00:00
|
|
|
/////////////////////////////////////////////////////
|
2023-11-15 21:26:12 +00:00
|
|
|
|
2023-12-26 10:19:41 +00:00
|
|
|
signal openAddEditSavedAddressesPopup(var params)
|
|
|
|
signal openDeleteSavedAddressesPopup(var params)
|
2024-01-15 09:19:25 +00:00
|
|
|
signal openShowQRPopup(var params)
|
2024-02-19 08:40:16 +00:00
|
|
|
signal openSavedAddressActivityPopup(var params)
|
2024-03-20 10:50:10 +00:00
|
|
|
signal openCommunityMemberMessagesPopupRequested(var store, var chatCommunitySectionModule, var memberPubKey, var displayName)
|
2023-12-26 10:19:41 +00:00
|
|
|
|
2023-05-30 19:01:55 +00:00
|
|
|
function openProfilePopup(publicKey, parentPopup, cb) {
|
|
|
|
root.openProfilePopupRequested(publicKey, parentPopup, cb)
|
2021-12-09 13:28:02 +00:00
|
|
|
}
|
2021-12-07 20:33:12 +00:00
|
|
|
|
2022-07-26 14:23:45 +00:00
|
|
|
function openActivityCenterPopup() {
|
2022-12-14 14:40:50 +00:00
|
|
|
root.openActivityCenterPopupRequested();
|
2022-07-26 14:23:45 +00:00
|
|
|
}
|
|
|
|
|
2021-12-07 20:33:12 +00:00
|
|
|
function openPopup(popupComponent, params = {}) {
|
2022-12-14 14:40:50 +00:00
|
|
|
root.openPopupRequested(popupComponent, params);
|
2021-12-07 20:33:12 +00:00
|
|
|
}
|
2021-12-06 21:10:54 +00:00
|
|
|
|
2023-05-23 12:46:16 +00:00
|
|
|
function closePopup() {
|
|
|
|
root.closePopupRequested();
|
|
|
|
}
|
|
|
|
|
2022-03-03 21:00:52 +00:00
|
|
|
function openDownloadModal(available, version, url){
|
2022-12-14 14:40:50 +00:00
|
|
|
root.openDownloadModalRequested(available, version, url);
|
2021-12-21 09:26:13 +00:00
|
|
|
}
|
|
|
|
|
2024-01-16 07:50:25 +00:00
|
|
|
function changeAppSectionBySectionType(sectionType, subsection = 0, subSubsection = -1, data = {}) {
|
|
|
|
root.appSectionBySectionTypeChanged(sectionType, subsection, subSubsection, data)
|
2021-12-06 21:10:54 +00:00
|
|
|
}
|
2023-05-19 16:07:50 +00:00
|
|
|
|
|
|
|
function openMenu(menuComponent, menuParent, params = {}, point = undefined) {
|
|
|
|
const menu = menuComponent.createObject(menuParent, params)
|
|
|
|
if (point)
|
|
|
|
menu.popup(point)
|
|
|
|
else
|
|
|
|
menu.popup()
|
|
|
|
return menu
|
|
|
|
}
|
2024-02-14 12:52:54 +00:00
|
|
|
|
|
|
|
function displaySuccessToastMessage(title: string, subTitle = "") {
|
|
|
|
root.displayToastMessage(
|
|
|
|
title,
|
|
|
|
subTitle,
|
|
|
|
"checkmark-circle",
|
|
|
|
false,
|
|
|
|
Constants.ephemeralNotificationType.success,
|
|
|
|
""
|
|
|
|
)
|
|
|
|
}
|
2022-02-01 13:10:24 +00:00
|
|
|
}
|