2023-02-07 14:21:32 +00:00
import QtQuick 2.15
2023-06-14 08:42:52 +00:00
import QtQuick . Layouts 1.15
import QtQuick . Dialogs 1.3
import QtQml . Models 2.15
import QtQml 2.15
import StatusQ . Core 0.1
import StatusQ . Controls 0.1
import StatusQ . Components 0.1
import StatusQ . Popups 0.1
2024-08-20 15:51:18 +00:00
import StatusQ . Popups . Dialog 0.1
2023-06-27 19:56:44 +00:00
import StatusQ . Core . Theme 0.1
2023-10-23 11:32:50 +00:00
import StatusQ . Core . Utils 0.1 as SQUtils
2022-10-21 13:37:39 +00:00
import AppLayouts . Chat . popups 1.0
2023-02-07 14:21:32 +00:00
import AppLayouts . Profile . popups 1.0
2023-06-23 06:17:04 +00:00
import AppLayouts . Communities . popups 1.0
2023-10-23 11:32:50 +00:00
import AppLayouts . Communities . helpers 1.0
2024-05-13 17:23:01 +00:00
import AppLayouts . Wallet . popups . swap 1.0
2024-08-06 16:04:22 +00:00
import AppLayouts . Wallet . popups . buy 1.0
2024-05-27 16:55:43 +00:00
import AppLayouts . Wallet . popups 1.0
2023-02-07 14:21:32 +00:00
2023-08-02 17:39:42 +00:00
import AppLayouts . Wallet . stores 1.0 as WalletStore
import AppLayouts . Chat . stores 1.0 as ChatStore
2022-10-21 13:37:39 +00:00
import shared . popups 1.0
2023-02-07 14:21:32 +00:00
import shared . status 1.0
2024-01-24 16:35:53 +00:00
import shared . stores 1.0
2024-07-26 14:47:18 +00:00
import shared . views 1.0
2022-10-21 13:37:39 +00:00
import utils 1.0
QtObject {
id: root
2023-02-07 14:21:32 +00:00
required property var popupParent
required property var rootStore
2023-10-23 11:32:50 +00:00
required property var communityTokensStore
2023-04-28 10:35:18 +00:00
property var communitiesStore
2023-09-12 09:26:57 +00:00
property var devicesStore
2024-01-24 16:35:53 +00:00
property CurrenciesStore currencyStore
property WalletStore . WalletAssetsStore walletAssetsStore
2024-01-29 15:37:17 +00:00
property WalletStore . CollectiblesStore walletCollectiblesStore
2024-02-02 09:55:56 +00:00
property var networkConnectionStore
2023-06-26 11:44:56 +00:00
property bool isDevBuild
2023-02-07 14:21:32 +00:00
2023-10-10 14:23:48 +00:00
signal openExternalLink ( string link )
signal saveDomainToUnfurledWhitelist ( string domain )
2024-04-17 13:01:55 +00:00
signal ownershipDeclined ( string communityId , string communityName )
2023-10-10 14:23:48 +00:00
2023-02-07 14:21:32 +00:00
property var activePopupComponents: [ ]
Component.onCompleted: {
Global . openSendIDRequestPopup . connect ( openSendIDRequestPopup )
2024-02-26 09:39:08 +00:00
Global . openMarkAsIDVerifiedPopup . connect ( openMarkAsIDVerifiedPopup )
Global . openRemoveIDVerificationDialog . connect ( openRemoveIDVerificationDialog )
2023-02-07 14:21:32 +00:00
Global . openOutgoingIDRequestPopup . connect ( openOutgoingIDRequestPopup )
Global . openIncomingIDRequestPopup . connect ( openIncomingIDRequestPopup )
Global . openInviteFriendsToCommunityPopup . connect ( openInviteFriendsToCommunityPopup )
2024-02-27 17:11:03 +00:00
Global . openInviteFriendsToCommunityByIdPopup . connect ( openInviteFriendsToCommunityByIdPopup )
2023-02-07 14:21:32 +00:00
Global . openContactRequestPopup . connect ( openContactRequestPopup )
2024-02-29 21:01:33 +00:00
Global . openReviewContactRequestPopup . connect ( openReviewContactRequestPopup )
2023-02-07 14:21:32 +00:00
Global . openDownloadModalRequested . connect ( openDownloadModal )
Global . openImagePopup . connect ( openImagePopup )
2024-05-15 09:36:56 +00:00
Global . openVideoPopup . connect ( openVideoPopup )
2023-02-07 14:21:32 +00:00
Global . openProfilePopupRequested . connect ( openProfilePopup )
Global . openNicknamePopupRequested . connect ( openNicknamePopup )
2024-02-16 17:34:09 +00:00
Global . markAsUntrustedRequested . connect ( openMarkAsUntrustedPopup )
2023-02-07 14:21:32 +00:00
Global . blockContactRequested . connect ( openBlockContactPopup )
Global . unblockContactRequested . connect ( openUnblockContactPopup )
Global . openChangeProfilePicPopup . connect ( openChangeProfilePicPopup )
Global . openBackUpSeedPopup . connect ( openBackUpSeedPopup )
Global . openPinnedMessagesPopupRequested . connect ( openPinnedMessagesPopup )
Global . openCommunityProfilePopupRequested . connect ( openCommunityProfilePopup )
2023-04-28 10:35:18 +00:00
Global . createCommunityPopupRequested . connect ( openCreateCommunityPopup )
Global . importCommunityPopupRequested . connect ( openImportCommunityPopup )
2023-11-28 13:41:11 +00:00
Global . communityShareAddressesPopupRequested . connect ( openCommunityShareAddressesPopup )
2023-07-21 17:21:11 +00:00
Global . communityIntroPopupRequested . connect ( openCommunityIntroPopup )
2023-05-10 12:22:26 +00:00
Global . removeContactRequested . connect ( openRemoveContactConfirmationPopup )
2023-02-07 14:21:32 +00:00
Global . openPopupRequested . connect ( openPopup )
2023-05-23 12:46:16 +00:00
Global . closePopupRequested . connect ( closePopup )
2023-05-19 16:07:50 +00:00
Global . openDeleteMessagePopup . connect ( openDeleteMessagePopup )
Global . openDownloadImageDialog . connect ( openDownloadImageDialog )
2023-06-14 08:42:52 +00:00
Global . leaveCommunityRequested . connect ( openLeaveCommunityPopup )
2023-06-27 19:56:44 +00:00
Global . openTestnetPopup . connect ( openTestnetPopup )
2023-07-19 05:58:21 +00:00
Global . openExportControlNodePopup . connect ( openExportControlNodePopup )
2023-07-21 08:44:10 +00:00
Global . openImportControlNodePopup . connect ( openImportControlNodePopup )
2023-08-02 17:39:42 +00:00
Global . openEditSharedAddressesFlow . connect ( openEditSharedAddressesPopup )
2023-09-14 10:02:51 +00:00
Global . openTransferOwnershipPopup . connect ( openTransferOwnershipPopup )
2023-10-23 11:32:50 +00:00
Global . openFinaliseOwnershipPopup . connect ( openFinaliseOwnershipPopup )
Global . openDeclineOwnershipPopup . connect ( openDeclineOwnershipPopup )
2024-01-24 11:49:46 +00:00
Global . openFirstTokenReceivedPopup . connect ( openFirstTokenReceivedPopup )
2024-01-29 15:37:17 +00:00
Global . openConfirmHideAssetPopup . connect ( openConfirmHideAssetPopup )
Global . openConfirmHideCollectiblePopup . connect ( openConfirmHideCollectiblePopup )
2024-03-20 10:50:10 +00:00
Global . openCommunityMemberMessagesPopupRequested . connect ( openCommunityMemberMessagesPopup )
2024-05-13 17:23:01 +00:00
Global . openSwapModalRequested . connect ( openSwapModal )
2024-05-27 16:55:43 +00:00
Global . openBuyCryptoModalRequested . connect ( openBuyCryptoModal )
2024-08-20 15:51:18 +00:00
Global . privacyPolicyRequested . connect ( ( ) = > openPopup ( privacyPolicyPopupComponent ) )
2023-02-07 14:21:32 +00:00
}
2023-05-23 12:46:16 +00:00
property var currentPopup
2023-02-07 14:21:32 +00:00
function openPopup ( popupComponent , params = { } , cb = null ) {
if ( activePopupComponents . includes ( popupComponent ) ) {
return
}
2023-05-23 12:46:16 +00:00
root . currentPopup = popupComponent . createObject ( popupParent , params )
root . currentPopup . open ( ) ;
2023-02-07 14:21:32 +00:00
if ( cb )
2023-05-23 12:46:16 +00:00
cb ( root . currentPopup )
2023-02-07 14:21:32 +00:00
activePopupComponents . push ( popupComponent )
2023-05-23 12:46:16 +00:00
root . currentPopup . closed . connect ( ( ) = > {
2023-02-07 14:21:32 +00:00
const removeIndex = activePopupComponents . indexOf ( popupComponent )
if ( removeIndex !== - 1 ) {
activePopupComponents . splice ( removeIndex , 1 )
}
} )
}
2023-05-23 12:46:16 +00:00
function closePopup ( ) {
if ( ! ! root . currentPopup )
root . currentPopup . close ( ) ;
}
2023-02-07 14:21:32 +00:00
function openDownloadModal ( available: bool , version: string , url: string ) {
const popupProperties = {
newVersionAvailable: available ,
downloadURL: url ,
currentVersion: rootStore . profileSectionStore . getCurrentVersion ( ) ,
newVersion: version
}
openPopup ( downloadPageComponent , popupProperties )
}
2024-05-15 09:36:56 +00:00
function openImagePopup ( image , url , plain ) {
openPopup ( imagePopupComponent , { image: image , url: url , plain: plain } )
}
function openVideoPopup ( url ) {
openPopup ( videoPopupComponent , { url: url } )
2023-02-07 14:21:32 +00:00
}
2023-05-30 19:01:55 +00:00
function openProfilePopup ( publicKey: string , parentPopup , cb ) {
openPopup ( profilePopupComponent , { publicKey: publicKey , parentPopup: parentPopup } , cb )
2023-02-07 14:21:32 +00:00
}
2024-03-07 09:51:16 +00:00
function openNicknamePopup ( publicKey: string , contactDetails , cb ) {
openPopup ( nicknamePopupComponent , { publicKey , contactDetails } , cb )
2023-02-07 14:21:32 +00:00
}
2024-02-16 17:34:09 +00:00
function openMarkAsUntrustedPopup ( publicKey: string , contactDetails ) {
openPopup ( markAsUntrustedComponent , { publicKey , contactDetails } )
}
2024-02-20 18:52:07 +00:00
function openBlockContactPopup ( publicKey: string , contactDetails ) {
openPopup ( blockContactConfirmationComponent , { publicKey , contactDetails } )
2023-02-07 14:21:32 +00:00
}
2024-02-20 18:52:07 +00:00
function openUnblockContactPopup ( publicKey: string , contactDetails ) {
openPopup ( unblockContactConfirmationComponent , { publicKey , contactDetails } )
2023-02-07 14:21:32 +00:00
}
function openChangeProfilePicPopup ( cb ) {
var popup = changeProfilePicComponent . createObject ( popupParent , { callback: cb } ) ;
popup . chooseImageToCrop ( )
}
function openBackUpSeedPopup ( ) {
openPopup ( backupSeedModalComponent )
}
function openCommunityProfilePopup ( store , community , communitySectionModule ) {
openPopup ( communityProfilePopup , { store: store , community: community , communitySectionModule: communitySectionModule } )
}
2022-10-21 13:37:39 +00:00
2024-02-16 11:56:29 +00:00
function openSendIDRequestPopup ( publicKey , contactDetails , cb ) {
2023-02-07 14:21:32 +00:00
openPopup ( sendIDRequestPopupComponent , {
2024-02-16 11:56:29 +00:00
publicKey: publicKey ,
2023-08-01 12:32:03 +00:00
contactDetails: contactDetails ,
2024-02-16 11:56:29 +00:00
title: qsTr ( "Request ID verification" ) ,
labelText: qsTr ( "Ask a question only they can answer" ) ,
challengeText: qsTr ( "Ask your question..." ) ,
buttonText: qsTr ( "Request ID verification" )
2023-02-07 14:21:32 +00:00
} , cb )
2022-10-21 13:37:39 +00:00
}
2024-02-26 09:39:08 +00:00
function openMarkAsIDVerifiedPopup ( publicKey , contactDetails , cb ) {
openPopup ( markAsIDVerifiedPopupComponent , { publicKey , contactDetails } , cb )
}
function openRemoveIDVerificationDialog ( publicKey , contactDetails , cb ) {
openPopup ( removeIDVerificationPopupComponent , { publicKey , contactDetails } , cb )
}
2024-02-26 18:54:05 +00:00
function openOutgoingIDRequestPopup ( publicKey , contactDetails , cb ) {
let details = contactDetails ? ? Utils . getContactDetailsAsJson ( publicKey )
2022-10-21 13:37:39 +00:00
try {
2024-02-26 18:54:05 +00:00
const verificationDetails = rootStore . contactStore . getSentVerificationDetailsAsJson ( publicKey )
2022-10-21 13:37:39 +00:00
const popupProperties = {
2024-02-26 18:54:05 +00:00
publicKey: publicKey ,
contactDetails: details ,
2022-10-21 13:37:39 +00:00
verificationStatus: verificationDetails . requestStatus ,
verificationChallenge: verificationDetails . challenge ,
verificationResponse: verificationDetails . response ,
verificationResponseDisplayName: verificationDetails . displayName ,
verificationResponseIcon: verificationDetails . icon ,
verificationRequestedAt: verificationDetails . requestedAt ,
verificationRepliedAt: verificationDetails . repliedAt
}
2023-02-07 14:21:32 +00:00
openPopup ( contactOutgoingVerificationRequestPopupComponent , popupProperties , cb )
2022-10-21 13:37:39 +00:00
} catch ( e ) {
console . error ( "Error getting or parsing verification data" , e )
}
}
2024-02-26 18:54:05 +00:00
function openIncomingIDRequestPopup ( publicKey , contactDetails , cb ) {
let details = contactDetails ? ? Utils . getContactDetailsAsJson ( publicKey )
openPopup ( contactVerificationRequestPopupComponent , { publicKey , contactDetails: details } )
2022-10-21 13:37:39 +00:00
}
function openInviteFriendsToCommunityPopup ( community , communitySectionModule , cb ) {
2023-02-07 14:21:32 +00:00
openPopup ( inviteFriendsToCommunityPopup , { community: community , communitySectionModule: communitySectionModule } , cb )
2022-10-21 13:37:39 +00:00
}
2024-02-27 17:11:03 +00:00
function openInviteFriendsToCommunityByIdPopup ( communityId , cb ) {
root . rootStore . mainModuleInst . prepareCommunitySectionModuleForCommunityId ( communityId )
const communitySectionModuleData = root . rootStore . mainModuleInst . getCommunitySectionModule ( )
const communityData = root . communitiesStore . getCommunityDetails ( communityId )
openPopup ( inviteFriendsToCommunityPopup , { community: communityData , communitySectionModule: communitySectionModuleData } , cb )
}
2024-02-16 11:56:29 +00:00
function openContactRequestPopup ( publicKey , contactDetails , cb ) {
let details = contactDetails ? ? Utils . getContactDetailsAsJson ( publicKey , false )
2022-10-21 13:37:39 +00:00
const popupProperties = {
2024-02-16 11:56:29 +00:00
publicKey: publicKey ,
contactDetails: details
2022-10-21 13:37:39 +00:00
}
2023-02-07 14:21:32 +00:00
openPopup ( sendContactRequestPopupComponent , popupProperties , cb )
}
2024-02-29 21:01:33 +00:00
function openReviewContactRequestPopup ( publicKey , contactDetails , cb ) {
try {
const crDetails = rootStore . contactStore . getLatestContactRequestForContactAsJson ( publicKey )
if ( crDetails . from !== publicKey ) {
console . warn ( "Popups.openReviewContactRequestPopup: not matching publicKey:" , publicKey )
return
}
openPopup ( reviewContactRequestPopupComponent , { publicKey , contactDetails , crDetails } , cb )
} catch ( e ) {
console . error ( "Popups.openReviewContactRequestPopup: error getting or parsing contact request data" , e )
}
}
2023-03-24 09:48:05 +00:00
function openPinnedMessagesPopup ( store , messageStore , pinnedMessagesModel , messageToPin , chatId ) {
openPopup ( pinnedMessagesPopup , {
store: store ,
messageStore: messageStore ,
pinnedMessagesModel: pinnedMessagesModel ,
messageToPin: messageToPin ,
chatId: chatId
} )
2023-02-07 14:21:32 +00:00
}
function openCommunityPopup ( store , community , chatCommunitySectionModule ) {
openPopup ( communityProfilePopup , { store: store , community: community , chatCommunitySectionModule: chatCommunitySectionModule } )
2022-10-21 13:37:39 +00:00
}
2023-04-28 10:35:18 +00:00
function openCreateCommunityPopup ( isDiscordImport ) {
openPopup ( createCommunitiesPopupComponent , { isDiscordImport: isDiscordImport } )
}
function openImportCommunityPopup ( ) {
openPopup ( importCommunitiesPopupComponent )
}
2024-07-15 17:27:28 +00:00
function openCommunityIntroPopup ( communityId ,
name ,
introMessage ,
imageSrc ,
isInvitationPending
) {
2024-03-25 17:32:33 +00:00
openPopup ( communityJoinDialogPopup ,
2023-07-21 17:21:11 +00:00
{ communityId: communityId ,
2024-03-19 08:41:41 +00:00
communityName: name ,
2023-07-21 17:21:11 +00:00
introMessage: introMessage ,
2024-03-19 08:41:41 +00:00
communityIcon: imageSrc ,
2023-07-21 17:21:11 +00:00
isInvitationPending: isInvitationPending
2023-08-02 17:39:42 +00:00
} )
}
2023-11-28 13:41:11 +00:00
function openCommunityShareAddressesPopup ( communityId , name , imageSrc ) {
2024-03-25 17:32:33 +00:00
openPopup ( communityJoinDialogPopup ,
2023-11-28 13:41:11 +00:00
{ communityId: communityId ,
stackTitle: qsTr ( "Share addresses with %1's owner" ) . arg ( name ) ,
2024-03-19 08:41:41 +00:00
communityName: name ,
2023-11-28 13:41:11 +00:00
introMessage: qsTr ( "Share addresses to rejoin %1" ) . arg ( name ) ,
2024-03-19 08:41:41 +00:00
communityIcon: imageSrc ,
2023-11-28 13:41:11 +00:00
isInvitationPending: false
} )
}
2023-08-02 17:39:42 +00:00
function openEditSharedAddressesPopup ( communityId ) {
openPopup ( editSharedAddressesPopupComponent , { communityId: communityId , isEditMode: true } )
2023-07-21 17:21:11 +00:00
}
2023-09-01 07:58:48 +00:00
function openDiscordImportProgressPopup ( importingSingleChannel ) {
openPopup ( discordImportProgressDialog , { importingSingleChannel: importingSingleChannel } )
2023-04-28 10:35:18 +00:00
}
2024-02-20 17:19:36 +00:00
function openRemoveContactConfirmationPopup ( publicKey , contactDetails ) {
openPopup ( removeContactConfirmationDialog , { publicKey , contactDetails } )
2023-05-10 12:22:26 +00:00
}
2023-05-19 16:07:50 +00:00
function openDeleteMessagePopup ( messageId , messageStore ) {
openPopup ( deleteMessageConfirmationDialogComponent ,
{
messageId ,
messageStore
} )
}
function openDownloadImageDialog ( imageSource ) {
// We don't use `openPopup`, because there's no `FileDialog::closed` signal.
const popup = downloadImageDialogComponent . createObject ( popupParent , { imageSource } )
popup . open ( )
}
2023-06-14 08:42:52 +00:00
function openLeaveCommunityPopup ( community , communityId , outroMessage ) {
openPopup ( leaveCommunityPopupComponent , { community , communityId , outroMessage } )
}
2023-06-27 19:56:44 +00:00
function openTestnetPopup ( ) {
openPopup ( testnetModal )
}
2023-09-12 09:26:57 +00:00
function openExportControlNodePopup ( community ) {
openPopup ( exportControlNodePopup , { community } )
2023-07-19 05:58:21 +00:00
}
2023-09-12 09:26:57 +00:00
function openImportControlNodePopup ( community ) {
openPopup ( importControlNodePopup , { community } )
2023-07-21 08:44:10 +00:00
}
2024-07-17 14:49:42 +00:00
function openTransferOwnershipPopup ( communityId , communityName , communityLogo , token , sendModalPopup ) {
openPopup ( transferOwnershipPopup , { communityId , communityName , communityLogo , token , sendModalPopup } )
2023-09-14 10:02:51 +00:00
}
2023-10-10 14:23:48 +00:00
function openConfirmExternalLinkPopup ( link , domain ) {
openPopup ( confirmExternalLinkPopup , { link , domain } )
}
2023-10-23 11:32:50 +00:00
function openFinaliseOwnershipPopup ( communityId ) {
openPopup ( finaliseOwnershipPopup , { communityId: communityId } )
}
2023-10-23 11:36:33 +00:00
function openDeclineOwnershipPopup ( communityId , communityName ) {
openPopup ( declineOwnershipPopup , { communityName: communityName , communityId: communityId } )
2023-10-23 11:32:50 +00:00
}
2024-01-24 11:49:46 +00:00
function openFirstTokenReceivedPopup ( communityId , communityName , communityLogo , tokenSymbol , tokenName , tokenAmount , tokenType , tokenImage ) {
openPopup ( firstTokenReceivedPopup ,
{
communityId: communityId ,
communityName: communityName ,
communityLogo: communityLogo ,
tokenSymbol: tokenSymbol ,
tokenName: tokenName ,
tokenAmount: tokenAmount ,
tokenType: tokenType ,
tokenImage: tokenImage
} )
}
2024-03-19 08:41:41 +00:00
2024-01-31 18:09:44 +00:00
function openConfirmHideAssetPopup ( assetSymbol , assetName , assetImage , isCommunityToken ) {
2024-07-26 14:47:18 +00:00
openPopup ( confirmHideAssetPopup , { symbol: assetSymbol , name: assetName , icon: assetImage , isCommunityToken } )
2024-01-29 15:37:17 +00:00
}
2024-01-31 18:09:44 +00:00
function openConfirmHideCollectiblePopup ( collectibleSymbol , collectibleName , collectibleImage , isCommunityToken ) {
openPopup ( confirmHideCollectiblePopup , { collectibleSymbol , collectibleName , collectibleImage , isCommunityToken } )
2024-01-29 15:37:17 +00:00
}
2024-01-24 11:49:46 +00:00
2024-03-20 10:50:10 +00:00
function openCommunityMemberMessagesPopup ( store , chatCommunitySectionModule , memberPubKey , displayName ) {
openPopup ( communityMemberMessagesPopup , {
store: store ,
chatCommunitySectionModule: chatCommunitySectionModule ,
memberPubKey: memberPubKey ,
displayName: displayName
} )
}
2024-05-13 17:23:01 +00:00
function openSwapModal ( parameters ) {
2024-05-15 21:22:13 +00:00
openPopup ( swapModal , { swapInputParamsForm: parameters } )
2024-05-13 17:23:01 +00:00
}
2024-08-06 16:04:22 +00:00
function openBuyCryptoModal ( parameters ) {
openPopup ( buyCryptoModal , {
buyCryptoInputParamsForm: parameters
} )
2024-05-27 16:55:43 +00:00
}
2023-02-07 14:21:32 +00:00
readonly property list < Component > _components : [
2023-05-10 12:22:26 +00:00
Component {
id: removeContactConfirmationDialog
2024-02-20 17:19:36 +00:00
RemoveContactPopup {
onAccepted: {
rootStore . contactStore . removeContact ( publicKey )
if ( removeIDVerification )
2024-04-18 16:09:27 +00:00
rootStore . contactStore . removeTrustVerificationStatus ( publicKey )
2024-02-20 17:19:36 +00:00
if ( markAsUntrusted ) {
rootStore . contactStore . markUntrustworthy ( publicKey )
Global . displaySuccessToastMessage ( qsTr ( "%1 removed from contacts and marked as untrusted" ) . arg ( mainDisplayName ) )
} else {
Global . displaySuccessToastMessage ( qsTr ( "%1 removed from contacts" ) . arg ( mainDisplayName ) )
}
close ( )
2023-05-10 12:22:26 +00:00
}
2024-02-20 17:19:36 +00:00
onClosed: destroy ( )
2023-05-10 12:22:26 +00:00
}
} ,
2022-10-21 13:37:39 +00:00
Component {
id: contactVerificationRequestPopupComponent
ContactVerificationRequestPopup {
2024-02-26 18:54:05 +00:00
contactsStore: rootStore . contactStore
onResponseSent: ( senderPublicKey , response ) = > {
contactsStore . acceptVerificationRequest ( senderPublicKey , response )
Global . displaySuccessToastMessage ( qsTr ( "ID verification reply sent" ) )
2022-10-21 13:37:39 +00:00
}
2024-02-26 18:54:05 +00:00
onVerificationRefused: ( senderPublicKey ) = > {
contactsStore . declineVerificationRequest ( senderPublicKey )
Global . displaySuccessToastMessage ( qsTr ( "ID verification request declined" ) )
2022-10-21 13:37:39 +00:00
}
onClosed: destroy ( )
}
} ,
Component {
id: contactOutgoingVerificationRequestPopupComponent
OutgoingContactVerificationRequestPopup {
onVerificationRequestCanceled: {
2024-02-26 18:54:05 +00:00
rootStore . contactStore . cancelVerificationRequest ( publicKey )
2022-10-21 13:37:39 +00:00
}
onUntrustworthyVerified: {
2024-02-26 18:54:05 +00:00
rootStore . contactStore . verifiedUntrustworthy ( publicKey )
Global . displaySuccessToastMessage ( qsTr ( "%1 marked as untrusted" ) . arg ( mainDisplayName ) )
2022-10-21 13:37:39 +00:00
}
onTrustedVerified: {
2024-02-26 18:54:05 +00:00
rootStore . contactStore . verifiedTrusted ( publicKey )
Global . displaySuccessToastMessage ( qsTr ( "%1 ID verified" ) . arg ( mainDisplayName ) )
2022-10-21 13:37:39 +00:00
}
onClosed: destroy ( )
}
} ,
Component {
id: sendIDRequestPopupComponent
SendContactRequestModal {
2023-04-06 07:56:50 +00:00
rootStore: root . rootStore
2024-02-16 11:56:29 +00:00
onAccepted: rootStore . contactStore . sendVerificationRequest ( publicKey , message )
2022-10-21 13:37:39 +00:00
onClosed: destroy ( )
}
} ,
2024-02-26 09:39:08 +00:00
Component {
id: markAsIDVerifiedPopupComponent
MarkAsIDVerifiedDialog {
onAccepted: {
2024-02-26 18:54:05 +00:00
rootStore . contactStore . markAsTrusted ( publicKey )
2024-02-26 09:39:08 +00:00
Global . displaySuccessToastMessage ( qsTr ( "%1 ID verified" ) . arg ( mainDisplayName ) )
close ( )
}
onClosed: destroy ( )
}
} ,
Component {
id: removeIDVerificationPopupComponent
RemoveIDVerificationDialog {
onAccepted: {
2024-04-18 16:09:27 +00:00
rootStore . contactStore . removeTrustVerificationStatus ( publicKey )
2024-02-26 09:39:08 +00:00
if ( markAsUntrusted && removeContact ) {
rootStore . contactStore . markUntrustworthy ( publicKey )
rootStore . contactStore . removeContact ( publicKey )
Global . displaySuccessToastMessage ( qsTr ( "%1 ID verification removed, removed from contacts and marked as untrusted" ) . arg ( mainDisplayName ) )
} else if ( markAsUntrusted ) {
rootStore . contactStore . markUntrustworthy ( publicKey )
Global . displaySuccessToastMessage ( qsTr ( "%1 ID verification removed and marked as untrusted" ) . arg ( mainDisplayName ) )
} else if ( removeContact ) {
rootStore . contactStore . removeContact ( publicKey )
Global . displaySuccessToastMessage ( qsTr ( "%1 ID verification removed and removed from contacts" ) . arg ( mainDisplayName ) )
} else {
Global . displaySuccessToastMessage ( qsTr ( "%1 ID verification removed" ) . arg ( mainDisplayName ) )
}
close ( )
}
onClosed: destroy ( )
}
} ,
2022-10-21 13:37:39 +00:00
Component {
id: inviteFriendsToCommunityPopup
InviteFriendsToCommunityPopup {
rootStore: root . rootStore
contactsStore: root . rootStore . contactStore
onClosed: destroy ( )
}
} ,
Component {
id: sendContactRequestPopupComponent
SendContactRequestModal {
2023-04-06 07:56:50 +00:00
rootStore: root . rootStore
2024-02-16 11:56:29 +00:00
onAccepted: rootStore . contactStore . sendContactRequest ( publicKey , message )
2022-10-21 13:37:39 +00:00
onClosed: destroy ( )
}
2023-02-07 14:21:32 +00:00
} ,
2024-02-29 21:01:33 +00:00
Component {
id: reviewContactRequestPopupComponent
ReviewContactRequestPopup {
onAccepted: {
rootStore . contactStore . acceptContactRequest ( publicKey , contactRequestId )
Global . displaySuccessToastMessage ( qsTr ( "Contact request accepted" ) )
close ( )
}
onDiscarded: {
rootStore . contactStore . dismissContactRequest ( publicKey , contactRequestId )
Global . displaySuccessToastMessage ( qsTr ( "Contact request ignored" ) )
close ( )
}
onClosed: destroy ( )
}
} ,
2023-02-07 14:21:32 +00:00
Component {
id: backupSeedModalComponent
BackupSeedModal {
privacyStore: rootStore . profileSectionStore . privacyStore
onClosed: destroy ( )
}
} ,
Component {
id: downloadPageComponent
DownloadPage {
onClosed: destroy ( )
}
} ,
Component {
id: imagePopupComponent
StatusImageModal {
id: imagePopup
onClosed: destroy ( )
}
} ,
2024-05-15 09:36:56 +00:00
Component {
id: videoPopupComponent
StatusVideoModal {
id: videoPopup
onClosed: destroy ( )
}
} ,
2023-02-07 14:21:32 +00:00
Component {
id: profilePopupComponent
ProfileDialog {
id: profilePopup
2024-03-29 11:43:49 +00:00
property bool isCurrentUser: publicKey === rootStore . profileSectionStore . profileStore . pubkey
2023-02-07 14:21:32 +00:00
profileStore: rootStore . profileSectionStore . profileStore
contactsStore: rootStore . profileSectionStore . contactsStore
2024-03-29 11:43:49 +00:00
sendToAccountEnabled: root . networkConnectionStore . sendBuyBridgeEnabled
showcaseCommunitiesModel: isCurrentUser ? rootStore.profileSectionStore.ownShowcaseCommunitiesModel : rootStore . profileSectionStore . contactShowcaseCommunitiesModel
showcaseAccountsModel: isCurrentUser ? rootStore.profileSectionStore.ownShowcaseAccountsModel : rootStore . profileSectionStore . contactShowcaseAccountsModel
showcaseCollectiblesModel: isCurrentUser ? rootStore.profileSectionStore.ownShowcaseCollectiblesModel : rootStore . profileSectionStore . contactShowcaseCollectiblesModel
showcaseSocialLinksModel: isCurrentUser ? rootStore.profileSectionStore.ownShowcaseSocialLinksModel : rootStore . profileSectionStore . contactShowcaseSocialLinksModel
2024-02-15 09:25:40 +00:00
assetsModel: rootStore . globalAssetsModel
collectiblesModel: rootStore . globalCollectiblesModel
2024-03-29 11:43:49 +00:00
onOpened: {
isCurrentUser ? rootStore . profileSectionStore . requestOwnShowcase ( )
: rootStore . profileSectionStore . requestContactShowcase ( publicKey )
}
2023-02-07 14:21:32 +00:00
onClosed: {
if ( profilePopup . parentPopup ) {
profilePopup . parentPopup . close ( )
}
destroy ( )
}
}
} ,
Component {
id: changeProfilePicComponent
ImageCropWorkflow {
title: qsTr ( "Profile Picture" )
acceptButtonText: qsTr ( "Make this my Profile Pic" )
onImageCropped: {
if ( callback ) {
callback ( image ,
cropRect . x . toFixed ( ) ,
cropRect . y . toFixed ( ) ,
( cropRect . x + cropRect . width ) . toFixed ( ) ,
( cropRect . y + cropRect . height ) . toFixed ( ) )
return
}
rootStore . profileSectionStore . profileStore . uploadImage ( image ,
cropRect . x . toFixed ( ) ,
cropRect . y . toFixed ( ) ,
( cropRect . x + cropRect . width ) . toFixed ( ) ,
( cropRect . y + cropRect . height ) . toFixed ( ) ) ;
}
onDone: destroy ( )
}
} ,
Component {
id: communityProfilePopup
CommunityProfilePopup {
contactsStore: rootStore . contactStore
hasAddedContacts: rootStore . hasAddedContacts
onClosed: destroy ( )
}
} ,
Component {
id: pinnedMessagesPopup
PinnedMessagesPopup {
onClosed: destroy ( )
}
} ,
Component {
id: nicknamePopupComponent
NicknamePopup {
onEditDone: {
if ( nickname !== newNickname ) {
2024-02-16 17:34:09 +00:00
rootStore . contactStore . changeContactNickname ( publicKey , newNickname , optionalDisplayName , ! ! nickname )
2023-02-07 14:21:32 +00:00
}
close ( )
}
2024-02-14 12:52:54 +00:00
onRemoveNicknameRequested: {
2024-02-16 17:34:09 +00:00
rootStore . contactStore . changeContactNickname ( publicKey , "" , optionalDisplayName , true )
close ( )
}
onClosed: destroy ( )
}
} ,
Component {
id: markAsUntrustedComponent
MarkAsUntrustedPopup {
onAccepted: {
rootStore . contactStore . markUntrustworthy ( publicKey )
if ( removeContact ) {
rootStore . contactStore . removeContact ( publicKey )
Global . displaySuccessToastMessage ( qsTr ( "%1 removed from contacts and marked as untrusted" ) . arg ( mainDisplayName ) )
} else {
2024-02-20 17:19:36 +00:00
Global . displaySuccessToastMessage ( qsTr ( "%1 marked as untrusted" ) . arg ( mainDisplayName ) )
2024-02-16 17:34:09 +00:00
}
2024-02-14 12:52:54 +00:00
close ( )
}
2023-02-07 14:21:32 +00:00
onClosed: destroy ( )
}
} ,
Component {
id: unblockContactConfirmationComponent
UnblockContactConfirmationDialog {
2024-02-20 18:52:07 +00:00
onAccepted: {
rootStore . contactStore . unblockContact ( publicKey )
Global . displaySuccessToastMessage ( qsTr ( "%1 unblocked" ) . arg ( mainDisplayName ) )
2023-02-07 14:21:32 +00:00
close ( )
}
onClosed: destroy ( )
}
} ,
Component {
id: blockContactConfirmationComponent
BlockContactConfirmationDialog {
2024-02-20 18:52:07 +00:00
onAccepted: {
rootStore . contactStore . blockContact ( publicKey )
if ( removeIDVerification )
2024-04-18 16:09:27 +00:00
rootStore . contactStore . removeTrustVerificationStatus ( publicKey )
2024-02-20 18:52:07 +00:00
if ( removeContact )
rootStore . contactStore . removeContact ( publicKey )
Global . displaySuccessToastMessage ( qsTr ( "%1 blocked" ) . arg ( mainDisplayName ) )
2023-02-07 14:21:32 +00:00
close ( )
}
onClosed: destroy ( )
}
2023-04-28 10:35:18 +00:00
} ,
Component {
id: importCommunitiesPopupComponent
ImportCommunityPopup {
store: root . communitiesStore
2023-10-27 10:25:27 +00:00
onJoinCommunityRequested: {
2023-08-02 17:39:42 +00:00
close ( )
2024-07-15 17:27:28 +00:00
communitiesStore . spectateCommunity ( communityId )
2023-08-02 17:39:42 +00:00
openCommunityIntroPopup ( communityId ,
communityDetails . name ,
communityDetails . introMessage ,
communityDetails . image ,
2023-12-04 19:14:13 +00:00
root . rootStore . isMyCommunityRequestPending ( communityId ) )
2023-07-21 17:21:11 +00:00
}
2023-08-02 17:39:42 +00:00
onClosed: destroy ( )
2023-07-21 17:21:11 +00:00
}
} ,
Component {
2024-03-25 17:32:33 +00:00
id: communityJoinDialogPopup
CommunityMembershipSetupDialog {
id: dialogRoot
2023-08-22 18:04:58 +00:00
requirementsCheckPending: root . rootStore . requirementsCheckPending
2024-05-16 09:28:06 +00:00
checkingPermissionToJoinInProgress: root . rootStore . checkingPermissionToJoinInProgress
joinPermissionsCheckCompletedWithoutErrors: root . rootStore . joinPermissionsCheckCompletedWithoutErrors
2024-03-19 08:41:41 +00:00
2023-07-31 15:56:00 +00:00
walletAccountsModel: root . rootStore . walletAccountsModel
2024-03-28 23:05:59 +00:00
walletCollectiblesModel: WalletStore . RootStore . collectiblesStore . allCollectiblesModel
2024-03-19 08:41:41 +00:00
canProfileProveOwnershipOfProvidedAddressesFn: WalletStore . RootStore . canProfileProveOwnershipOfProvidedAddresses
2024-01-24 16:35:53 +00:00
walletAssetsModel: walletAssetsStore . groupedAccountAssetsModel
2023-08-21 18:54:57 +00:00
permissionsModel: {
2024-03-25 17:32:33 +00:00
root . rootStore . prepareTokenModelForCommunity ( dialogRoot . communityId )
2023-08-21 18:54:57 +00:00
return root . rootStore . permissionsModel
}
2023-07-21 17:21:11 +00:00
assetsModel: root . rootStore . assetsModel
collectiblesModel: root . rootStore . collectiblesModel
2024-01-24 16:35:53 +00:00
2024-03-27 12:48:17 +00:00
getCurrencyAmount: function ( balance , symbol ) {
2024-01-24 16:35:53 +00:00
return currencyStore . getCurrencyAmount ( balance , symbol )
}
2023-10-27 17:20:52 +00:00
onPrepareForSigning: {
2024-03-25 17:32:33 +00:00
root . rootStore . prepareKeypairsForSigning ( dialogRoot . communityId , dialogRoot . name , sharedAddresses , airdropAddress , false )
2023-10-27 17:20:52 +00:00
2024-03-25 17:32:33 +00:00
dialogRoot . keypairSigningModel = root . rootStore . communitiesModuleInst . keypairsSigningModel
2023-10-27 17:20:52 +00:00
}
2024-03-19 08:41:41 +00:00
onSignProfileKeypairAndAllNonKeycardKeypairs: {
root . rootStore . signProfileKeypairAndAllNonKeycardKeypairs ( )
2023-10-27 17:20:52 +00:00
}
onSignSharedAddressesForKeypair: {
root . rootStore . signSharedAddressesForKeypair ( keyUid )
}
onJoinCommunity: {
root . rootStore . joinCommunityOrEditSharedAddresses ( )
}
2024-03-27 12:48:17 +00:00
onCancelMembershipRequest: {
root . rootStore . cancelPendingRequest ( dialogRoot . communityId )
}
2023-07-21 17:21:11 +00:00
Connections {
target: root . communitiesStore . communitiesModuleInst
function onCommunityAccessRequested ( communityId: string ) {
2024-03-25 17:32:33 +00:00
if ( communityId !== dialogRoot . communityId )
2023-08-02 17:39:42 +00:00
return
2023-07-21 17:21:11 +00:00
root . communitiesStore . spectateCommunity ( communityId ) ;
2024-03-25 17:32:33 +00:00
dialogRoot . close ( ) ;
2023-07-21 17:21:11 +00:00
}
2023-10-27 17:20:52 +00:00
function onCommunityAccessFailed ( communityId: string , error: string ) {
2024-03-25 17:32:33 +00:00
if ( communityId !== dialogRoot . communityId )
2023-08-02 17:39:42 +00:00
return
2024-03-25 17:32:33 +00:00
dialogRoot . close ( ) ;
2023-07-21 17:21:11 +00:00
}
2023-04-28 10:35:18 +00:00
}
2024-03-27 09:06:14 +00:00
2023-08-21 18:54:57 +00:00
onSharedAddressesUpdated: {
2024-03-25 17:32:33 +00:00
root . rootStore . updatePermissionsModel ( dialogRoot . communityId , sharedAddresses )
2023-08-21 18:54:57 +00:00
}
2024-03-27 09:06:14 +00:00
2024-03-25 17:32:33 +00:00
onAboutToShow: { root . rootStore . communityKeyToImport = dialogRoot . communityId ; }
2024-03-27 09:06:14 +00:00
onClosed: {
root . rootStore . communityKeyToImport = "" ;
root . rootStore . cleanJoinEditCommunityData ( )
}
2023-10-27 17:20:52 +00:00
Connections {
target: root . rootStore . communitiesModuleInst
2024-03-19 08:41:41 +00:00
function onAllSharedAddressesSigned ( ) {
2024-03-25 17:32:33 +00:00
if ( dialogRoot . profileProvesOwnershipOfSelectedAddresses ) {
dialogRoot . joinCommunity ( )
dialogRoot . close ( )
2024-03-19 08:41:41 +00:00
return
}
2024-03-25 17:32:33 +00:00
if ( dialogRoot . allAddressesToRevealBelongToSingleNonProfileKeypair ) {
dialogRoot . joinCommunity ( )
dialogRoot . close ( )
2024-03-19 08:41:41 +00:00
return
}
2024-03-25 17:32:33 +00:00
if ( ! ! dialogRoot . replaceItem ) {
dialogRoot . replaceLoader . item . allSigned ( )
2023-10-27 17:20:52 +00:00
}
}
}
2023-04-28 10:35:18 +00:00
}
} ,
Component {
id: createCommunitiesPopupComponent
CreateCommunityPopup {
store: root . communitiesStore
2023-06-26 11:44:56 +00:00
isDevBuild: root . isDevBuild
2023-04-28 10:35:18 +00:00
onClosed: {
destroy ( )
}
}
} ,
Component {
id: discordImportProgressDialog
DiscordImportProgressDialog {
store: root . communitiesStore
}
2023-05-19 16:07:50 +00:00
} ,
Component {
id: deleteMessageConfirmationDialogComponent
DeleteMessageConfirmationPopup {
onClosed: destroy ( )
}
} ,
Component {
id: downloadImageDialogComponent
FileDialog {
property string imageSource
title: qsTr ( "Please choose a directory" )
selectFolder: true
selectExisting: true
selectMultiple: false
modality: Qt . NonModal
onAccepted: {
Utils . downloadImageByUrl ( imageSource , fileUrl )
destroy ( )
}
onRejected: {
destroy ( )
}
}
2023-06-14 08:42:52 +00:00
} ,
Component {
id: leaveCommunityPopupComponent
StatusModal {
id: leavePopup
property string community
property string communityId
property string outroMessage
headerSettings.title: qsTr ( "Are you sure want to leave '%1'?" ) . arg ( community )
padding: 16
width: 640
contentItem: ColumnLayout {
spacing: 16
StatusBaseText {
id: outroMessage
Layout.fillWidth: true
wrapMode: Text . WrapAtWordBoundaryOrAnywhere
text: leavePopup . outroMessage
visible: ! ! text
}
StatusMenuSeparator {
Layout.fillWidth: true
visible: outroMessage . visible
}
StatusBaseText {
Layout.fillWidth: true
wrapMode: Text . WrapAtWordBoundaryOrAnywhere
font.pixelSize: 13
text: qsTr ( "You will need to request to join if you want to become a member again in the future. If you joined the Community via public key ensure you have a copy of it before you go." )
}
}
rightButtons: [
StatusFlatButton {
text: qsTr ( "Cancel" )
onClicked: leavePopup . close ( )
} ,
StatusButton {
objectName: "CommunitiesListPanel_leaveCommunityButtonInPopup"
type: StatusBaseButton . Type . Danger
text: qsTr ( "Leave %1" ) . arg ( leavePopup . community )
onClicked: {
leavePopup . close ( )
2023-06-21 20:37:51 +00:00
root . rootStore . profileSectionStore . communitiesProfileModule . leaveCommunity ( leavePopup . communityId )
2023-06-14 08:42:52 +00:00
}
}
]
onClosed: destroy ( )
}
2023-06-27 19:56:44 +00:00
} ,
Component {
id: testnetModal
AlertPopup {
width: 521
readonly property string mainTitle: root . rootStore . profileSectionStore . walletStore . areTestNetworksEnabled ? qsTr ( "Turn off testnet mode" ) : qsTr ( "Turn on testnet mode" )
title: mainTitle
alertLabel.textFormat: Text . RichText
alertText: root . rootStore . profileSectionStore . walletStore . areTestNetworksEnabled ?
qsTr ( "Are you sure you want to turn off %1? All future transactions will be performed on live networks with real funds" ) . arg ( "<html><span style='font-weight: 500;'>testnet mode</span></html>" ) :
qsTr ( "Are you sure you want to turn on %1? In this mode, all blockchain data displayed will come from testnets and all blockchain interactions will be with testnets. Testnet mode switches the entire app to using testnets only. Please switch this mode on only if you know exactly why you need to use it." ) . arg ( "<html><span style='font-weight: 500;'>testnet mode</span></html>" )
acceptBtnText: mainTitle
acceptBtnType: root . rootStore . profileSectionStore . walletStore . areTestNetworksEnabled ? StatusBaseButton.Type.Normal : StatusBaseButton . Type . Warning
asset.name: "settings"
asset.color: Theme . palette . warningColor1
asset.bgColor: Theme . palette . warningColor3
onAcceptClicked: {
root . rootStore . profileSectionStore . walletStore . toggleTestNetworksEnabled ( )
Global . displayToastMessage ( root . rootStore . profileSectionStore . walletStore . areTestNetworksEnabled ? qsTr ( "Testnet mode turned on" ) : qsTr ( "Testnet mode turned off" ) , "" , "checkmark-circle" , false , Constants . ephemeralNotificationType . success , "" )
}
onCancelClicked: close ( )
}
2023-07-19 05:58:21 +00:00
} ,
Component {
id: exportControlNodePopup
ExportControlNodePopup {
2023-09-12 09:26:57 +00:00
devicesStore: root . devicesStore
2023-07-19 05:58:21 +00:00
onClosed: destroy ( )
}
2023-07-21 08:44:10 +00:00
} ,
Component {
id: importControlNodePopup
ImportControlNodePopup {
onClosed: destroy ( )
2024-02-27 20:44:47 +00:00
onImportControlNode: root . rootStore . promoteSelfToControlNode ( community . id )
2023-07-21 08:44:10 +00:00
}
2023-08-02 17:39:42 +00:00
} ,
Component {
id: editSharedAddressesPopupComponent
2024-03-25 17:32:33 +00:00
CommunityMembershipSetupDialog {
2023-08-02 17:39:42 +00:00
id: editSharedAddressesPopup
2023-07-21 08:44:10 +00:00
2023-08-02 17:39:42 +00:00
readonly property var chatStore: ChatStore . RootStore {
contactsStore: root . rootStore . contactStore
chatCommunitySectionModule: {
root . rootStore . mainModuleInst . prepareCommunitySectionModuleForCommunityId ( editSharedAddressesPopup . communityId )
return root . rootStore . mainModuleInst . getCommunitySectionModule ( )
}
}
2024-03-19 08:41:41 +00:00
isEditMode: true
currentSharedAddresses: root . rootStore . myRevealedAddressesForCurrentCommunity
currentAirdropAddress: root . rootStore . myRevealedAirdropAddressForCurrentCommunity
2023-08-02 17:39:42 +00:00
communityName: chatStore . sectionDetails . name
communityIcon: chatStore . sectionDetails . image
2024-04-25 09:47:40 +00:00
2023-08-22 18:04:58 +00:00
requirementsCheckPending: root . rootStore . requirementsCheckPending
2024-05-16 09:28:06 +00:00
checkingPermissionToJoinInProgress: root . rootStore . checkingPermissionToJoinInProgress
joinPermissionsCheckCompletedWithoutErrors: root . rootStore . joinPermissionsCheckCompletedWithoutErrors
2024-03-19 08:41:41 +00:00
2024-03-27 12:48:17 +00:00
introMessage: chatStore . sectionDetails . introMessage
2024-03-19 08:41:41 +00:00
canProfileProveOwnershipOfProvidedAddressesFn: WalletStore . RootStore . canProfileProveOwnershipOfProvidedAddresses
2023-08-29 15:28:41 +00:00
walletAccountsModel: root . rootStore . walletAccountsModel
2024-03-28 23:05:59 +00:00
2024-01-24 16:35:53 +00:00
walletAssetsModel: walletAssetsStore . groupedAccountAssetsModel
2024-03-28 23:05:59 +00:00
walletCollectiblesModel: WalletStore . RootStore . collectiblesStore . allCollectiblesModel
2023-08-21 18:54:57 +00:00
permissionsModel: {
root . rootStore . prepareTokenModelForCommunity ( editSharedAddressesPopup . communityId )
return root . rootStore . permissionsModel
}
2023-08-02 17:39:42 +00:00
assetsModel: chatStore . assetsModel
collectiblesModel: chatStore . collectiblesModel
2024-03-19 08:41:41 +00:00
getCurrencyAmount: function ( balance , symbol ) {
return root . currencyStore . getCurrencyAmount ( balance , symbol )
}
onSharedAddressesUpdated: {
root . rootStore . updatePermissionsModel ( editSharedAddressesPopup . communityId , sharedAddresses )
}
2023-10-27 17:20:52 +00:00
onPrepareForSigning: {
root . rootStore . prepareKeypairsForSigning ( editSharedAddressesPopup . communityId , "" , sharedAddresses , airdropAddress , true )
editSharedAddressesPopup . keypairSigningModel = root . rootStore . communitiesModuleInst . keypairsSigningModel
}
2024-03-19 08:41:41 +00:00
onSignProfileKeypairAndAllNonKeycardKeypairs: {
root . rootStore . signProfileKeypairAndAllNonKeycardKeypairs ( )
2023-10-27 17:20:52 +00:00
}
onSignSharedAddressesForKeypair: {
root . rootStore . signSharedAddressesForKeypair ( keyUid )
}
onEditRevealedAddresses: {
root . rootStore . joinCommunityOrEditSharedAddresses ( )
}
2024-03-27 09:06:14 +00:00
onClosed: {
root . rootStore . cleanJoinEditCommunityData ( )
}
2023-10-27 17:20:52 +00:00
Connections {
target: root . rootStore . communitiesModuleInst
2024-03-19 08:41:41 +00:00
function onAllSharedAddressesSigned ( ) {
if ( editSharedAddressesPopup . profileProvesOwnershipOfSelectedAddresses ) {
editSharedAddressesPopup . editRevealedAddresses ( )
editSharedAddressesPopup . close ( )
return
}
2024-01-24 16:35:53 +00:00
2024-03-19 08:41:41 +00:00
if ( editSharedAddressesPopup . allAddressesToRevealBelongToSingleNonProfileKeypair ) {
editSharedAddressesPopup . editRevealedAddresses ( )
editSharedAddressesPopup . close ( )
return
}
if ( ! ! editSharedAddressesPopup . replaceItem ) {
editSharedAddressesPopup . replaceLoader . item . allSigned ( )
}
}
2024-01-24 16:35:53 +00:00
}
2023-08-02 17:39:42 +00:00
}
2023-09-14 10:02:51 +00:00
} ,
Component {
id: transferOwnershipPopup
TransferOwnershipPopup {
onClosed: destroy ( )
}
2023-10-10 14:23:48 +00:00
} ,
Component {
id: confirmExternalLinkPopup
ConfirmExternalLinkPopup {
destroyOnClose: true
onOpenExternalLink: root . openExternalLink ( link )
onSaveDomainToUnfurledWhitelist: root . saveDomainToUnfurledWhitelist ( domain )
}
2023-10-23 11:32:50 +00:00
} ,
// Components related to transfer community ownership flow:
Component {
id: finaliseOwnershipPopup
FinaliseOwnershipPopup {
id: finalisePopup
property string communityId
2023-10-23 11:36:33 +00:00
readonly property var ownerTokenDetails: root . communityTokensStore . ownerTokenDetails
2023-10-23 11:32:50 +00:00
readonly property var communityData : root . communitiesStore . getCommunityDetailsAsJson ( communityId )
2023-10-23 11:36:33 +00:00
Component.onCompleted: root . communityTokensStore . asyncGetOwnerTokenDetails ( communityId )
2023-10-23 11:32:50 +00:00
communityName: communityData . name
communityLogo: communityData . image
communityColor: communityData . color
2023-10-23 11:36:33 +00:00
tokenSymbol: ownerTokenDetails . symbol
tokenChainName: ownerTokenDetails . chainName
2023-10-23 11:32:50 +00:00
feeText: feeSubscriber . feeText
feeErrorText: feeSubscriber . feeErrorText
isFeeLoading: ! feeSubscriber . feesResponse
accounts: WalletStore . RootStore . nonWatchAccounts
destroyOnClose: true
2023-10-23 11:36:33 +00:00
onRejectClicked: Global . openDeclineOwnershipPopup ( finalisePopup . communityId , communityData . name )
2023-10-23 11:32:50 +00:00
onFinaliseOwnershipClicked: signPopup . open ( )
2023-10-23 11:36:33 +00:00
onVisitCommunityClicked: communitiesStore . navigateToCommunity ( finalisePopup . communityId )
2023-10-23 11:32:50 +00:00
onOpenControlNodeDocClicked: Global . openLink ( link )
SetSignerFeesSubscriber {
id: feeSubscriber
readonly property TransactionFeesBroker feesBroker: TransactionFeesBroker {
communityTokensStore: root . communityTokensStore
}
2023-10-23 11:36:33 +00:00
chainId: finalisePopup . ownerTokenDetails . chainId
contractAddress: finalisePopup . ownerTokenDetails . contractAddress
accountAddress: finalisePopup . ownerTokenDetails . accountAddress
2023-10-23 11:32:50 +00:00
enabled: finalisePopup . visible || signPopup . visible
Component.onCompleted: feesBroker . registerSetSignerFeesSubscriber ( feeSubscriber )
}
SignTransactionsPopup {
id: signPopup
title: qsTr ( "Sign transaction - update %1 smart contract" ) . arg ( finalisePopup . communityName )
totalFeeText: finalisePopup . isFeeLoading ? "" : finalisePopup . feeText
errorText: finalisePopup . feeErrorText
2023-10-23 11:36:33 +00:00
accountName: finalisePopup . ownerTokenDetails . accountName
2023-10-23 11:32:50 +00:00
model: QtObject {
readonly property string title: finalisePopup . feeLabel
readonly property string feeText: signPopup . totalFeeText
readonly property bool error: finalisePopup . feeErrorText !== ""
}
onSignTransactionClicked: {
2023-10-23 11:36:33 +00:00
finalisePopup . close ( )
root . communityTokensStore . updateSmartContract ( finalisePopup . communityId , finalisePopup . ownerTokenDetails . chainId , finalisePopup . ownerTokenDetails . contractAddress , finalisePopup . ownerTokenDetails . accountAddress )
2023-10-23 11:32:50 +00:00
}
}
Connections {
target: root
2024-04-17 13:01:55 +00:00
function onOwnershipDeclined ( communityId: string , communityName: string ) {
2023-10-23 11:32:50 +00:00
finalisePopup . close ( )
2024-04-17 13:01:55 +00:00
root . communityTokensStore . ownershipDeclined ( communityId , communityName )
2023-10-23 11:32:50 +00:00
}
}
}
} ,
Component {
id: declineOwnershipPopup
FinaliseOwnershipDeclinePopup {
destroyOnClose: true
2024-04-17 13:01:55 +00:00
onDeclineClicked: root . ownershipDeclined ( communityId , communityName )
2023-10-23 11:32:50 +00:00
}
2024-01-24 11:49:46 +00:00
} ,
2023-10-23 11:32:50 +00:00
// End of components related to transfer community ownership flow.
2024-01-24 11:49:46 +00:00
Component {
id: firstTokenReceivedPopup
FirstTokenReceivedPopup {
2024-01-31 18:09:44 +00:00
destroyOnClose: true
2024-01-24 11:49:46 +00:00
communitiesStore: root . communitiesStore
2024-07-26 14:47:18 +00:00
onHideClicked: ( tokenSymbol , tokenName , tokenImage , isAsset ) = > isAsset ? root . openConfirmHideAssetPopup ( tokenSymbol , tokenName , tokenImage , true )
: root . openConfirmHideCollectiblePopup ( tokenSymbol , tokenName , tokenImage , true )
2024-01-24 11:49:46 +00:00
}
2024-01-29 15:37:17 +00:00
} ,
Component {
id: confirmHideAssetPopup
2024-07-26 14:47:18 +00:00
ConfirmHideAssetPopup {
destroyOnClose: true
2024-01-29 15:37:17 +00:00
2024-07-26 14:47:18 +00:00
required property bool isCommunityToken
2024-01-29 15:37:17 +00:00
onConfirmButtonClicked: {
2024-01-31 18:09:44 +00:00
if ( isCommunityToken )
2024-07-26 14:47:18 +00:00
root . walletAssetsStore . assetsController . showHideCommunityToken ( symbol , false )
2024-01-31 18:09:44 +00:00
else
2024-07-26 14:47:18 +00:00
root . walletAssetsStore . assetsController . showHideRegularToken ( symbol , false )
2024-01-29 15:37:17 +00:00
close ( )
2024-07-26 14:47:18 +00:00
Global . displayToastMessage ( qsTr ( "%1 (%2) successfully hidden. You can toggle asset visibility via %3." ) . arg ( name ) . arg ( symbol )
2024-01-31 18:09:44 +00:00
. arg ( ` < a style = "text-decoration:none" href = "#${Constants.appSection.profile}/${Constants.settingsSubsection.wallet}/${Constants.walletSettingsSubsection.manageHidden}" > ` + qsTr ( "Settings" , "Go to Settings" ) + "</a>" ) ,
2024-01-29 15:37:17 +00:00
"" ,
"checkmark-circle" ,
false ,
Constants . ephemeralNotificationType . success ,
"" )
}
}
} ,
Component {
id: confirmHideCollectiblePopup
ConfirmationDialog {
property string collectibleSymbol
property string collectibleName
property string collectibleImage
2024-01-31 18:09:44 +00:00
property bool isCommunityToken
2024-01-29 15:37:17 +00:00
width: 520
destroyOnClose: true
confirmButtonLabel: qsTr ( "Hide collectible" )
cancelBtnType: ""
showCancelButton: true
headerSettings.title: qsTr ( "Hide %1" ) . arg ( collectibleName )
headerSettings.asset.name: collectibleImage
2024-01-31 18:09:44 +00:00
headerSettings.asset.bgRadius: Style . current . radius
2024-01-29 15:37:17 +00:00
confirmationText: qsTr ( "Are you sure you want to hide %1? You will no longer see or be able to interact with this collectible anywhere inside Status." ) . arg ( collectibleName )
onCancelButtonClicked: close ( )
onConfirmButtonClicked: {
2024-01-31 18:09:44 +00:00
if ( isCommunityToken )
root . walletCollectiblesStore . collectiblesController . showHideCommunityToken ( collectibleSymbol , false )
else
root . walletCollectiblesStore . collectiblesController . showHideRegularToken ( collectibleSymbol , false )
2024-01-29 15:37:17 +00:00
close ( )
Global . displayToastMessage ( qsTr ( "%1 successfully hidden. You can toggle collectible visibility via %2." ) . arg ( collectibleName )
2024-01-31 18:09:44 +00:00
. arg ( ` < a style = "text-decoration:none" href = "#${Constants.appSection.profile}/${Constants.settingsSubsection.wallet}/${Constants.walletSettingsSubsection.manageHidden}" > ` + qsTr ( "Settings" , "Go to Settings" ) + "</a>" ) ,
2024-01-29 15:37:17 +00:00
"" ,
"checkmark-circle" ,
false ,
Constants . ephemeralNotificationType . success ,
"" )
}
}
2024-03-20 10:50:10 +00:00
} ,
Component {
id: communityMemberMessagesPopup
CommunityMemberMessagesPopup {
onClosed: destroy ( )
}
2024-05-13 17:23:01 +00:00
} ,
Component {
id: swapModal
SwapModal {
2024-05-15 21:22:13 +00:00
swapAdaptor: SwapModalAdaptor {
swapStore: WalletStore . SwapStore { }
walletAssetsStore: root . walletAssetsStore
currencyStore: root . currencyStore
swapFormData: swapInputParamsForm
2024-06-06 14:05:31 +00:00
swapOutputData: SwapOutputData { }
2024-05-15 21:22:13 +00:00
}
2024-07-10 18:35:24 +00:00
loginType: root . rootStore . loginType
2024-05-13 17:23:01 +00:00
onClosed: destroy ( )
}
2024-05-27 16:55:43 +00:00
} ,
Component {
id: buyCryptoModal
BuyCryptoModal {
2024-08-06 16:04:22 +00:00
buyCryptoAdaptor: BuyCryptoModalAdaptor {
buyCryptoStore: WalletStore . BuyCryptoStore { }
buyCryptoFormData: buyCryptoInputParamsForm
walletAccountsModel: root . rootStore . accounts
networksModel: root . rootStore . profileSectionStore . walletStore . flatNetworks
areTestNetworksEnabled: root . rootStore . profileSectionStore . walletStore . areTestNetworksEnabled
groupedAccountAssetsModel: root . walletAssetsStore . groupedAccountAssetsModel
plainTokensBySymbolModel: root . walletAssetsStore . walletTokensStore . plainTokensBySymbolModel
currentCurrency: root . currencyStore . currentCurrency
}
2024-05-27 16:55:43 +00:00
onClosed: destroy ( )
}
2024-08-20 15:51:18 +00:00
} ,
Component {
id: privacyPolicyPopupComponent
StatusDialog {
width: 600
padding: 0
title: qsTr ( "Status Software Privacy Policy" )
StatusScrollView {
id: privacyDialogScrollView
anchors.fill: parent
contentWidth: availableWidth
StatusBaseText {
width: privacyDialogScrollView . availableWidth
wrapMode: Text . Wrap
textFormat: Text . MarkdownText
text: SQUtils . StringUtils . readTextFile ( ":/imports/assets/docs/privacy.mdwn" )
onLinkActivated: Global . openLinkWithConfirmation ( link , SQUtils . StringUtils . extractDomainFromLink ( link ) )
}
}
standardButtons: Dialog . Ok
destroyOnClose: true
}
2024-01-24 11:49:46 +00:00
}
2022-10-21 13:37:39 +00:00
]
}