Lukáš Tinkl e1c9f2f93f perf(AppMain): wrap CommunitiesPortalLayout in a Loader
- CommunitiesPortalLayout was the last piece still unconditionally loaded
on startup -> fixed
- extract the `communitiesStore` into AppMain to be able to reuse it from
other components
- move the import/create community dialogs to `Popups` (reusability)
- cleanup and remove some dead code, fix warnings

Iterates #6204
2023-04-28 21:35:29 +02:00

80 lines
2.9 KiB
QML

pragma Singleton
import QtQml 2.14
QtObject {
id: root
property var dragArea
property var applicationWindow
property bool popupOpened: false
property int settingsSubsection: Constants.settingsSubsection.profile
property var userProfile
property bool appIsReady: false
signal openPinnedMessagesPopupRequested(var store, var messageStore, var pinnedMessagesModel, string messageToPin, string chatId)
signal openCommunityProfilePopupRequested(var store, var community, var chatCommunitySectionModule)
signal openLinkInBrowser(string link)
signal openChooseBrowserPopup(string link)
signal settingsLoaded()
signal openCreateChatView()
signal closeCreateChatView()
signal blockContactRequested(string publicKey, string contactName)
signal unblockContactRequested(string publicKey, string contactName)
signal displayToastMessage(string title, string subTitle, string icon, bool loading, int ephNotifType, string url)
signal openPopupRequested(var popupComponent, var params)
signal openNicknamePopupRequested(string publicKey, string nickname, string subtitle)
signal openDownloadModalRequested(bool available, string version, string url)
signal openChangeProfilePicPopup(var cb)
signal openBackUpSeedPopup()
signal openImagePopup(var image, var contextMenu)
signal openProfilePopupRequested(string publicKey, var parentPopup)
signal openEditDisplayNamePopup()
signal openActivityCenterPopupRequested()
signal openSendIDRequestPopup(string publicKey, var cb)
signal openContactRequestPopup(string publicKey, var cb)
signal openInviteFriendsToCommunityPopup(var community, var communitySectionModule, var cb)
signal openIncomingIDRequestPopup(string publicKey, var cb)
signal openOutgoingIDRequestPopup(string publicKey, var cb)
signal contactRenamed(string publicKey)
signal openLink(string link)
signal setNthEnabledSectionActive(int nthSection)
signal appSectionBySectionTypeChanged(int sectionType, int subsection)
signal openSendModal(string address)
signal switchToCommunity(string communityId)
signal createCommunityPopupRequested(bool isDiscordImport)
signal importCommunityPopupRequested()
signal playSendMessageSound()
signal playNotificationSound()
signal playErrorSound()
function openProfilePopup(publicKey, parentPopup) {
root.openProfilePopupRequested(publicKey, parentPopup)
}
function openActivityCenterPopup() {
root.openActivityCenterPopupRequested();
}
function openPopup(popupComponent, params = {}) {
root.openPopupRequested(popupComponent, params);
}
function openDownloadModal(available, version, url){
root.openDownloadModalRequested(available, version, url);
}
function changeAppSectionBySectionType(sectionType, subsection = 0) {
root.appSectionBySectionTypeChanged(sectionType, subsection);
}
}