status-desktop/ui/imports/utils/Global.qml

161 lines
7.1 KiB
QML
Raw Normal View History

pragma Singleton
import QtQml 2.15
QtObject {
id: root
property var dragArea
property var applicationWindow
property bool activityPopupOpened: false
property int settingsSubsection: Constants.settingsSubsection.profile
property int settingsSubSubsection: -1
property var userProfile
property bool appIsReady: false
// use the generic var as type to break the cyclic dependency
property var walletConnectService: null
signal openPinnedMessagesPopupRequested(var store, var messageStore, var pinnedMessagesModel, string messageToPin, string chatId)
signal openCommunityProfilePopupRequested(var store, var community, var chatCommunitySectionModule)
signal openCreateChatView()
signal closeCreateChatView()
signal blockContactRequested(string publicKey, var contactDetails)
signal unblockContactRequested(string publicKey, var contactDetails)
2022-09-27 21:26:26 +00:00
signal displayToastMessage(string title, string subTitle, string icon, bool loading, int ephNotifType, string url)
signal displayToastWithActionMessage(string title, string subTitle, string icon, string iconColor, bool loading, int ephNotifType, int actionType, string data)
signal displayImageToastWithActionMessage(string title, string subTitle, string image, int ephNotifType, int actionType, string data)
signal openPopupRequested(var popupComponent, var params)
signal closePopupRequested()
signal openNicknamePopupRequested(string publicKey, var contactDetails, var cb)
signal openDownloadModalRequested(bool available, string version, string url)
signal openChangeProfilePicPopup(var cb)
signal openBackUpSeedPopup()
signal openImagePopup(var image, string url, bool plain)
signal openVideoPopup(string url)
signal openProfilePopupRequested(string publicKey, var parentPopup, var cb)
signal openActivityCenterPopupRequested()
signal openSendIDRequestPopup(string publicKey, var contactDetails, var cb)
signal openMarkAsIDVerifiedPopup(string publicKey, var contactDetails, var cb)
signal openRemoveIDVerificationDialog(string publicKey, var contactDetails, var cb)
signal openContactRequestPopup(string publicKey, var contactDetails, var cb)
signal openReviewContactRequestPopup(string publicKey, var contactDetails, var cb)
signal markAsUntrustedRequested(string publicKey, var contactDetails)
signal removeContactRequested(string publicKey, var contactDetails)
signal openInviteFriendsToCommunityPopup(var community, var communitySectionModule, var cb)
signal openInviteFriendsToCommunityByIdPopup(string communityId, var cb)
signal openIncomingIDRequestPopup(string publicKey, var contactDetails, var cb)
signal openOutgoingIDRequestPopup(string publicKey, var contactDetails, var cb)
signal openDeleteMessagePopup(string messageId, var messageStore)
signal openDownloadImageDialog(string imageSource)
signal openExportControlNodePopup(var community)
signal openImportControlNodePopup(var community)
signal openTransferOwnershipPopup(string communityId,
string communityName,
string communityLogo,
var token,
var sendModalPopup)
signal openFinaliseOwnershipPopup(string communityId)
signal openDeclineOwnershipPopup(string communityId, string communityName)
signal openFirstTokenReceivedPopup(string communityId,
string communityName,
string communityLogo,
string tokenSymbol,
string tokenName,
string tokenAmount,
int tokenType,
string tokenImage)
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
signal openLink(string link)
signal openLinkWithConfirmation(string link, string domain)
feat(LinkPreviews): Integrate Link previews with the backend (#12523) * feat(StatusQ): Adding numberToLocaleStringInCompactForm function to LocaleUtils This function will format the number in a compact form E.g: 1000 -> 1K; 1000000 -> 1M; 1100000 -> 1.1M + adding tests fix(statusQ): Update numberToLocaleStringInCompactForm to return the locale number when greter than 999T fix(StatusQ): extend the test_numberToLocaleStringInCompactForm with new data * feat(LinkPreviews): Update the link preview area in StatusChatInput to use the new model Changes: 1. Create a new component `LinkPreviewMiniCardDelegate.qml` that filters the model data to properly fill the link preview card with the needed data based on the preview type 2. Update storybook pages 3. Small updates to LinkPreviewMiniCard * feat(LinkPreviews): Update the link previews in message history to use the new backend Changes: 1. Create delegate items for LinkPreviewCard and gif link preview to clean the LinksMessageView component and filter the model data based on the preview type 2. Remove UserProfileCard and reuse the LinkPreviewCard to display contacts link previews 3. Update LinkPreviewCard so that it can accommodate status link previews (communities, channels, contacts). The generic properties (title, description, footer) have been dropped and replaced with specialised properties for each preview type. 4. Fix LinkPreviewCard layout to better accommodate different content variants (missing properties, long/short title, missing description, missing icon) 5. Fixing the link preview context menu and click actions fix: Move inline components to separate files Fixing the linux builds using Qt 5.15.2 affected by this bug: https://bugreports.qt.io/browse/QTBUG-89180 * fix: Align LinkPreviewMiniCard implementation with LinkPreviewCard and remove state based model filtering
2023-10-25 15:20:02 +00:00
signal activateDeepLink(string link)
signal setNthEnabledSectionActive(int nthSection)
signal appSectionBySectionTypeChanged(int sectionType, int subsection, int subSubsection, var data)
signal openSendModal(string address)
signal switchToCommunity(string communityId)
signal switchToCommunitySettings(string communityId)
signal switchToCommunityChannelsView(string communityId)
signal createCommunityPopupRequested(bool isDiscordImport)
signal importCommunityPopupRequested()
signal communityIntroPopupRequested(string communityId, string name, string introMessage,
string imageSrc, bool isInvitationPending)
signal communityShareAddressesPopupRequested(string communityId, string name, string imageSrc)
signal leaveCommunityRequested(string community, string communityId, string outroMessage)
signal openEditSharedAddressesFlow(string communityId)
signal playSendMessageSound()
signal playNotificationSound()
signal playErrorSound()
signal openTestnetPopup()
// Swap
signal openSwapModalRequested(var formDataParams)
// BuyCrypto
signal openBuyCryptoModalRequested(var formDataParams)
// Metrics
signal openMetricsEnablePopupRequested(string placement, var cb)
signal addCentralizedMetricIfEnabled(string eventName, var eventValue)
signal openAddEditSavedAddressesPopup(var params)
signal openDeleteSavedAddressesPopup(var params)
signal openShowQRPopup(var params)
signal openSavedAddressActivityPopup(var params)
signal openCommunityMemberMessagesPopupRequested(var store, var chatCommunitySectionModule, var memberPubKey, var displayName)
function openProfilePopup(publicKey, parentPopup, cb) {
root.openProfilePopupRequested(publicKey, parentPopup, cb)
}
function openActivityCenterPopup() {
root.openActivityCenterPopupRequested();
}
function openPopup(popupComponent, params = {}) {
root.openPopupRequested(popupComponent, params);
}
function closePopup() {
root.closePopupRequested();
}
function openDownloadModal(available, version, url){
root.openDownloadModalRequested(available, version, url);
}
function changeAppSectionBySectionType(sectionType, subsection = 0, subSubsection = -1, data = {}) {
root.appSectionBySectionTypeChanged(sectionType, subsection, subSubsection, data)
}
function openMenu(menuComponent, menuParent, params = {}, point = undefined) {
const menu = menuComponent.createObject(menuParent, params)
if (point)
menu.popup(point)
else
menu.popup()
return menu
}
function displaySuccessToastMessage(title: string, subTitle = "") {
root.displayToastMessage(
title,
subTitle,
"checkmark-circle",
false,
Constants.ephemeralNotificationType.success,
""
)
}
}