2021-10-01 15:58:36 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
|
2022-08-01 17:04:23 +00:00
|
|
|
import utils 1.0
|
|
|
|
|
2021-12-30 12:39:47 +00:00
|
|
|
import "../Profile/stores"
|
2021-10-15 08:00:45 +00:00
|
|
|
|
2021-10-01 15:58:36 +00:00
|
|
|
QtObject {
|
|
|
|
id: root
|
2022-07-01 11:24:32 +00:00
|
|
|
|
2021-11-22 11:08:09 +00:00
|
|
|
property var mainModuleInst: mainModule
|
2021-12-20 18:21:21 +00:00
|
|
|
property var aboutModuleInst: aboutModule
|
2022-01-05 15:11:26 +00:00
|
|
|
property var communitiesModuleInst: communitiesModule
|
2022-01-10 16:44:54 +00:00
|
|
|
property var observedCommunity: communitiesModuleInst.observedCommunity
|
2021-11-22 11:08:09 +00:00
|
|
|
|
2022-03-03 21:00:52 +00:00
|
|
|
property bool newVersionAvailable: false
|
|
|
|
property string latestVersion
|
|
|
|
property string downloadURL
|
|
|
|
|
|
|
|
function setLatestVersionInfo(newVersionAvailable, latestVersion, downloadURL) {
|
|
|
|
root.newVersionAvailable = newVersionAvailable;
|
|
|
|
root.latestVersion = latestVersion;
|
|
|
|
root.downloadURL = downloadURL;
|
|
|
|
}
|
|
|
|
|
|
|
|
function resetLastVersion(){
|
|
|
|
root.newVersionAvailable = false
|
|
|
|
}
|
|
|
|
|
2022-01-27 11:28:27 +00:00
|
|
|
property AppSearchStore appSearchStore: AppSearchStore {
|
|
|
|
appSearchModule: root.mainModuleInst.appSearchModule
|
|
|
|
}
|
|
|
|
|
2021-12-30 12:39:47 +00:00
|
|
|
property ProfileSectionStore profileSectionStore: ProfileSectionStore {
|
|
|
|
}
|
|
|
|
|
2022-01-05 15:50:03 +00:00
|
|
|
property EmojiReactions emojiReactionsModel: EmojiReactions {
|
|
|
|
}
|
|
|
|
|
2022-02-04 13:07:48 +00:00
|
|
|
property var chatSearchModel: mainModuleInst.chatSearchModel
|
|
|
|
|
|
|
|
function rebuildChatSearchModel() {
|
|
|
|
mainModuleInst.rebuildChatSearchModel()
|
|
|
|
}
|
|
|
|
|
|
|
|
function setActiveSectionChat(sectionId, chatId) {
|
|
|
|
mainModuleInst.switchTo(sectionId, chatId)
|
|
|
|
}
|
|
|
|
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// property var chatsModelInst: chatsModel
|
|
|
|
// Not Refactored Yet
|
|
|
|
// property var walletModelInst: walletModel
|
2021-11-22 11:08:09 +00:00
|
|
|
property var userProfileInst: userProfile
|
2021-11-04 18:55:21 +00:00
|
|
|
|
2023-04-20 08:41:45 +00:00
|
|
|
property var accounts: walletSectionSendInst.accounts
|
2021-12-13 14:24:21 +00:00
|
|
|
// Not Refactored Yet
|
|
|
|
// property var profileModelInst: profileModel
|
2021-11-22 11:08:09 +00:00
|
|
|
|
2022-01-10 16:44:54 +00:00
|
|
|
property var contactStore: profileSectionStore.contactsStore
|
2022-02-10 20:02:02 +00:00
|
|
|
property var privacyStore: profileSectionStore.privacyStore
|
2022-03-07 20:34:59 +00:00
|
|
|
property var messagingStore: profileSectionStore.messagingStore
|
2022-01-10 16:44:54 +00:00
|
|
|
property bool hasAddedContacts: contactStore.myContactsModel.count > 0
|
|
|
|
|
2021-12-09 12:53:40 +00:00
|
|
|
// property MessageStore messageStore: MessageStore { }
|
2021-11-02 14:11:35 +00:00
|
|
|
|
2022-12-08 15:49:14 +00:00
|
|
|
property real volume: !!appSettings ? appSettings.volume * 0.01 : 0.5
|
|
|
|
property bool notificationSoundsEnabled: !!appSettings ? appSettings.notificationSoundsEnabled : true
|
2021-11-15 15:15:21 +00:00
|
|
|
|
2023-04-20 08:41:45 +00:00
|
|
|
property var walletSectionSendInst: walletSectionSend
|
2022-02-09 00:04:49 +00:00
|
|
|
|
2022-03-18 14:47:51 +00:00
|
|
|
property var savedAddressesModel: walletSectionSavedAddresses.model
|
|
|
|
|
2022-12-14 14:40:50 +00:00
|
|
|
readonly property bool showBrowserSelector: localAccountSensitiveSettings.showBrowserSelector
|
|
|
|
readonly property bool openLinksInStatus: localAccountSensitiveSettings.openLinksInStatus
|
|
|
|
|
2022-07-01 11:24:32 +00:00
|
|
|
property var allNetworks: networksModule.all
|
|
|
|
|
2022-03-18 14:47:51 +00:00
|
|
|
function getEtherscanLink() {
|
|
|
|
return profileSectionModule.ensUsernamesModule.getEtherscanLink()
|
|
|
|
}
|
|
|
|
|
2022-06-09 14:59:54 +00:00
|
|
|
function createCommunity(communityName, communityDescription, checkedMembership, communityColor, communityTags,
|
2022-08-17 12:44:53 +00:00
|
|
|
communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY,
|
2022-10-07 16:33:23 +00:00
|
|
|
historyArchiveSupportEnabled, pinMessagesAllowedForMembers, bannerJsonStr, encrypted) {
|
2022-06-09 14:59:54 +00:00
|
|
|
communitiesModuleInst.createCommunity(communityName, communityDescription, checkedMembership, communityColor,
|
|
|
|
communityTags, communityImage, imageCropperModalaX, imageCropperModalaY,
|
2022-08-17 12:44:53 +00:00
|
|
|
imageCropperModalbX, imageCropperModalbY,
|
2022-10-07 16:33:23 +00:00
|
|
|
historyArchiveSupportEnabled, pinMessagesAllowedForMembers,
|
|
|
|
bannerJsonStr, encrypted);
|
2021-11-02 14:11:35 +00:00
|
|
|
}
|
|
|
|
|
2022-09-16 08:30:08 +00:00
|
|
|
function communityHasMember(communityId, pubKey)
|
|
|
|
{
|
|
|
|
return communitiesModuleInst.isMemberOfCommunity(communityId, pubKey)
|
|
|
|
}
|
|
|
|
|
2021-11-02 14:11:35 +00:00
|
|
|
function copyToClipboard(text) {
|
2022-01-10 16:44:54 +00:00
|
|
|
globalUtils.copyToClipboard(text)
|
2021-11-02 14:11:35 +00:00
|
|
|
}
|
2022-01-18 20:54:14 +00:00
|
|
|
|
2022-12-14 14:40:50 +00:00
|
|
|
function plainText(text) {
|
|
|
|
return globalUtils.plainText(text);
|
|
|
|
}
|
|
|
|
|
2022-01-18 20:54:14 +00:00
|
|
|
function generateAlias(pk) {
|
|
|
|
return globalUtils.generateAlias(pk);
|
|
|
|
}
|
|
|
|
|
2022-02-01 15:31:57 +00:00
|
|
|
property string currentCurrency: walletSection.currentCurrency
|
2022-01-31 16:03:45 +00:00
|
|
|
property string signingPhrase: walletSection.signingPhrase
|
2022-10-17 10:17:25 +00:00
|
|
|
function getFiatValue(balance, cryptoSymbol, fiatSymbol) {
|
|
|
|
return profileSectionStore.ensUsernamesStore.getFiatValue(balance, cryptoSymbol, fiatSymbol)
|
2022-02-01 15:31:57 +00:00
|
|
|
}
|
|
|
|
function getGasEthValue(gweiValue, gasLimit) {
|
|
|
|
return profileSectionStore.ensUsernamesStore.getGasEthValue(gweiValue, gasLimit)
|
|
|
|
}
|
2022-02-01 21:03:47 +00:00
|
|
|
|
2022-05-19 08:53:57 +00:00
|
|
|
function suggestedFees(chainId) {
|
2023-04-20 08:41:45 +00:00
|
|
|
return JSON.parse(walletSectionSendInst.suggestedFees(chainId))
|
2022-02-01 21:03:47 +00:00
|
|
|
}
|
2022-02-02 16:25:06 +00:00
|
|
|
|
2022-07-07 08:51:04 +00:00
|
|
|
function getEstimatedTime(chainId, maxFeePerGas) {
|
2023-04-20 08:41:45 +00:00
|
|
|
return walletSectionSendInst.getEstimatedTime(chainId, maxFeePerGas)
|
2022-06-02 17:47:42 +00:00
|
|
|
}
|
|
|
|
|
2022-05-19 08:53:57 +00:00
|
|
|
function getChainIdForChat() {
|
|
|
|
return walletSectionTransactions.getChainIdForChat()
|
2022-02-02 16:25:06 +00:00
|
|
|
}
|
2022-02-28 12:30:36 +00:00
|
|
|
|
2022-05-19 08:53:57 +00:00
|
|
|
function getChainIdForBrowser() {
|
|
|
|
return walletSectionTransactions.getChainIdForBrowser()
|
2022-02-28 12:30:36 +00:00
|
|
|
}
|
|
|
|
|
2022-03-18 14:47:51 +00:00
|
|
|
function hex2Eth(value) {
|
|
|
|
return globalUtils.hex2Eth(value)
|
|
|
|
}
|
2022-07-04 10:47:29 +00:00
|
|
|
|
|
|
|
function setCurrentUserStatus(newStatus) {
|
|
|
|
if (userProfileInst && userProfileInst.currentUserStatus !== newStatus) {
|
|
|
|
mainModuleInst.setCurrentUserStatus(newStatus)
|
|
|
|
}
|
|
|
|
}
|
2022-07-25 15:39:09 +00:00
|
|
|
|
|
|
|
function setActiveCommunity(communityId) {
|
2022-08-25 19:20:21 +00:00
|
|
|
mainModuleInst.setActiveSectionById(communityId);
|
2022-07-25 15:39:09 +00:00
|
|
|
}
|
2022-08-01 17:04:23 +00:00
|
|
|
|
|
|
|
function switchAccount(newIndex) {
|
|
|
|
if(Constants.isCppApp)
|
|
|
|
walletSectionAccounts.switchAccount(newIndex)
|
|
|
|
else
|
|
|
|
walletSection.switchAccount(newIndex)
|
|
|
|
}
|
2022-08-25 19:20:21 +00:00
|
|
|
|
|
|
|
function resolveENS(value) {
|
|
|
|
mainModuleInst.resolveENS(value, "")
|
|
|
|
}
|
2021-10-01 15:58:36 +00:00
|
|
|
}
|