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