2021-12-06 21:10:54 +00:00
|
|
|
pragma Singleton
|
|
|
|
|
2024-07-26 14:47:18 +00:00
|
|
|
import QtQml 2.15
|
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
|
|
|
|
2023-05-23 12:46:16 +00:00
|
|
|
property bool activityPopupOpened: false
|
2021-12-07 20:33:12 +00:00
|
|
|
|
2023-02-14 09:20:53 +00:00
|
|
|
property bool appIsReady: false
|
2021-12-08 21:20:43 +00:00
|
|
|
|
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
|
|
|
|
2022-05-13 15:27:26 +00:00
|
|
|
signal openCreateChatView()
|
|
|
|
signal closeCreateChatView()
|
2021-12-09 13:28:02 +00:00
|
|
|
|
2024-11-06 20:53:41 +00:00
|
|
|
signal blockContactRequested(string publicKey)
|
|
|
|
signal unblockContactRequested(string publicKey)
|
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-11-06 20:53:41 +00:00
|
|
|
signal openNicknamePopupRequested(string publicKey, 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-11-06 20:53:41 +00:00
|
|
|
signal openMarkAsIDVerifiedPopup(string publicKey, var cb)
|
|
|
|
signal openRemoveIDVerificationDialog(string publicKey, var cb)
|
|
|
|
signal openContactRequestPopup(string publicKey, var cb)
|
|
|
|
signal openReviewContactRequestPopup(string publicKey, var cb)
|
|
|
|
signal markAsUntrustedRequested(string publicKey)
|
|
|
|
signal removeContactRequested(string publicKey)
|
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)
|
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,
|
2024-11-05 18:51:17 +00:00
|
|
|
var token)
|
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
|
|
|
|
2024-12-03 08:36:04 +00:00
|
|
|
signal paymentRequestClicked(string receiverAddress, string symbol, string amount, int chainId)
|
2023-02-28 15:00:10 +00:00
|
|
|
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-08-20 15:51:18 +00:00
|
|
|
signal privacyPolicyRequested()
|
|
|
|
|
2024-12-04 16:19:27 +00:00
|
|
|
signal openPaymentRequestModalRequested(var callback)
|
|
|
|
|
2024-05-13 17:23:01 +00:00
|
|
|
// Swap
|
|
|
|
signal openSwapModalRequested(var formDataParams)
|
|
|
|
|
2024-05-27 16:55:43 +00:00
|
|
|
// BuyCrypto
|
2024-08-06 16:04:22 +00:00
|
|
|
signal openBuyCryptoModalRequested(var formDataParams)
|
2024-05-27 16:55:43 +00:00
|
|
|
|
2024-07-19 12:15:50 +00:00
|
|
|
// Metrics
|
2024-08-08 20:53:49 +00:00
|
|
|
signal openMetricsEnablePopupRequested(string placement, var cb)
|
2024-08-19 16:52:17 +00:00
|
|
|
signal addCentralizedMetricIfEnabled(string eventName, var eventValue)
|
2024-07-19 12:15:50 +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
|
|
|
|
2024-11-05 18:51:17 +00:00
|
|
|
// Intent based launch send modal signals
|
|
|
|
signal sendToRecipientRequested(string recipientAddress)
|
|
|
|
|
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
|
|
|
}
|