diff --git a/src/app/REMOVE-utilsView/view.nim b/src/app/REMOVE-utilsView/view.nim index e5c0edcdb..cdb795528 100644 --- a/src/app/REMOVE-utilsView/view.nim +++ b/src/app/REMOVE-utilsView/view.nim @@ -54,11 +54,11 @@ QtObject: proc joinPath*(self: UtilsView, start: string, ending: string): string {.slot.} = result = os.joinPath(start, ending) - proc join3Paths*(self: UtilsView, start: string, middle: string, ending: string): string {.slot.} = - result = os.joinPath(start, middle, ending) + # proc join3Paths*(self: UtilsView, start: string, middle: string, ending: string): string {.slot.} = + # result = os.joinPath(start, middle, ending) - proc getSNTAddress*(self: UtilsView): string {.slot.} = - result = status_tokens.getSNTAddress() + # proc getSNTAddress*(self: UtilsView): string {.slot.} = + # result = status_tokens.getSNTAddress() proc getSNTBalance*(self: UtilsView): string {.slot.} = let currAcct = self.status.wallet.getWalletAccounts()[0] diff --git a/ui/app/AppLayouts/Browser/stores/RootStore.qml b/ui/app/AppLayouts/Browser/stores/RootStore.qml index 7bd6c4c2c..98be944c8 100644 --- a/ui/app/AppLayouts/Browser/stores/RootStore.qml +++ b/ui/app/AppLayouts/Browser/stores/RootStore.qml @@ -7,30 +7,37 @@ import utils 1.0 QtObject { id: root - property string activeChannelName: chatsModel.channelView.activeChannel.name + // Not Refactored Yet +// property string activeChannelName: chatsModel.channelView.activeChannel.name - property var currentNetwork: profileModel.network.current + // Not Refactored Yet +// property var currentNetwork: profileModel.network.current property bool currentTabConnected: false function getUrlFromUserInput(input) { - return utilsModel.urlFromUserInput(input) + // Not Refactored Yet +// return utilsModel.urlFromUserInput(input) } function getAscii2Hex(input) { - return utilsModel.ascii2Hex(input) + // Not Refactored Yet +// return utilsModel.ascii2Hex(input) } function getHex2Ascii(input) { - return utilsModel.hex2Ascii(input) + // Not Refactored Yet +// return utilsModel.hex2Ascii(input) } function getWei2Eth(wei,decimals) { - return utilsModel.wei2Eth(wei,decimals) + // Not Refactored Yet +// return utilsModel.wei2Eth(wei,decimals) } function generateIdenticon(pk) { - return utilsModel.generateIdenticon(pk) + // Not Refactored Yet +// return utilsModel.generateIdenticon(pk) } function get0xFormedUrl(browserExplorer, url) { diff --git a/ui/app/AppLayouts/Browser/stores/WalletStore.qml b/ui/app/AppLayouts/Browser/stores/WalletStore.qml index 5cd0af6a5..0466e5cc5 100644 --- a/ui/app/AppLayouts/Browser/stores/WalletStore.qml +++ b/ui/app/AppLayouts/Browser/stores/WalletStore.qml @@ -9,14 +9,17 @@ QtObject { property var accounts: walletSectionAccounts.model property string defaultCurrency: walletSection.currentCurrency property string signingPhrase: walletSection.signingPhrase - property string etherscanString: walletModel.utilsView.etherscanLink + // Not Refactored Yet + property string etherscanString: ""// walletModel.utilsView.etherscanLink function setDappBrowserAddress() { - walletModel.setDappBrowserAddress() + // Not Refactored Yet +// walletModel.setDappBrowserAddress() } function getGasPrice(){ - walletModel.gasView.getGasPrice() + // Not Refactored Yet +// walletModel.gasView.getGasPrice() } } diff --git a/ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/ActivityCenterTopBar.qml b/ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/ActivityCenterTopBar.qml index e8ef56375..e7629d337 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/ActivityCenterTopBar.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/ActivityCenterTopBar.qml @@ -81,7 +81,8 @@ Item { width: 32 height: 32 onClicked: { - errorText.text = chatsModel.activityNotificationList.markAllActivityCenterNotificationsRead() + // Not Refactored Yet +// errorText.text = chatsModel.activityNotificationList.markAllActivityCenterNotificationsRead() } StatusToolTip { diff --git a/ui/app/AppLayouts/Chat/panels/BadgeContentPanel.qml b/ui/app/AppLayouts/Chat/panels/BadgeContentPanel.qml deleted file mode 100644 index 90c1521dc..000000000 --- a/ui/app/AppLayouts/Chat/panels/BadgeContentPanel.qml +++ /dev/null @@ -1,217 +0,0 @@ -import QtQuick 2.13 -import QtGraphicalEffects 1.13 - -import utils 1.0 -import shared.controls 1.0 -import shared 1.0 -import shared.panels 1.0 - -import StatusQ.Components 0.1 as StatusQ -import StatusQ.Core 0.1 - -Item { - id: wrapper - - property color textColor: Style.current.textColor - property string chatId: "" - property string name: "channelName" - property string identicon - property string communityId - property bool hideSecondIcon: false - property int chatType: chatsModel.channelView.chats.getChannelType(chatId) - property int realChatType: { - if (chatType === Constants.chatType.communityChat) { - // TODO add a check for private community chats once it is created - return Constants.chatType.publicChatcommunityComponent - } - return chatType - } - - property string profileImage: realChatType === Constants.chatType.oneToOne ? appMain.getProfileImage(chatId) || "" : "" - - height: 24 - width: childrenRect.width - - Loader { - active: true - height: parent.height - sourceComponent: wrapper.communityId ? communityComponent : channelComponent - } - - Component { - id: communityComponent - - Item { - property int communityIndex: chatsModel.communities.joinedCommunities.getCommunityIndex(wrapper.communityId) - - property string image: communityIndex > -1 ? chatsModel.communities.joinedCommunities.rowData(communityIndex, "thumbnailImage") : "" - property string iconColor: !image && communityIndex > -1 ? chatsModel.communities.joinedCommunities.rowData(communityIndex, "communityColor"): "" - property bool useLetterIdenticon: !image - property string communityName: communityIndex > -1 ? chatsModel.communities.joinedCommunities.rowData(communityIndex, "name") : "" - property string channelName: chatsModel.getChannelNameById(wrapper.chatId) - - id: communityBadge - width: childrenRect.width - height: parent.height - SVGImage { - id: communityIcon - visible: !hideSecondIcon - width: 16 - height: 16 - source: Style.svg("communities") - anchors.left: parent.left - anchors.verticalCenter:parent.verticalCenter - - ColorOverlay { - anchors.fill: parent - source: parent - color: wrapper.textColor - } - } - - Loader { - id: communityImageLoader - active: true - anchors.left: communityIcon.visible ? communityIcon.right : parent.left - anchors.leftMargin: 2 - anchors.verticalCenter: parent.verticalCenter - sourceComponent: communityBadge.useLetterIdenticon ? letterIdenticon :imageIcon - } - - Component { - id: imageIcon - RoundedImage { - source: communityBadge.image - noMouseArea: true - noHover: true - width: 16 - height: 16 - } - } - - Component { - id: letterIdenticon - StatusQ.StatusLetterIdenticon { - width: 16 - height: 16 - letterSize: 12 - name: communityBadge.communityName - color: communityBadge.iconColor - } - } - - StyledTextEdit { - id: communityName - text: Utils.getLinkStyle(communityBadge.communityName, hoveredLink, wrapper.textColor) - height: 18 - readOnly: true - textFormat: Text.RichText - width: implicitWidth > 300 ? 300 : implicitWidth - clip: true - anchors.left: communityImageLoader.right - anchors.leftMargin: 4 - color: wrapper.textColor - font.pixelSize: 13 - anchors.verticalCenter: parent.verticalCenter - onLinkActivated: function () { - chatsModel.communities.setActiveCommunity(wrapper.communityId) - } - } - - SVGImage { - id: caretImage - source: Style.svg("show-category") - width: 16 - height: 16 - anchors.left: communityName.right - anchors.verticalCenter: parent.verticalCenter - - ColorOverlay { - anchors.fill: parent - source: parent - color: wrapper.textColor - } - } - - StyledTextEdit { - id: channelName - text: communityBadge.getLinkStyle(communityBadge.channelName || wrapper.name, hoveredLink, wrapper.textColor) - height: 18 - readOnly: true - textFormat: Text.RichText - width: implicitWidth > 300 ? 300 : implicitWidth - clip: true - anchors.left: caretImage.right - color: wrapper.textColor - font.pixelSize: 13 - anchors.verticalCenter: parent.verticalCenter - onLinkActivated: function () { - chatsModel.communities.setActiveCommunity(wrapper.communityId) - chatsModel.setActiveChannel(model.message.chatId) - } - } - } - } - - Component { - id: channelComponent - - Item { - width: childrenRect.width - height: parent.height - - Connections { - enabled: realChatType === Constants.chatType.oneToOne - // TODO use a store once it is available - target: contactsModule.model.list - onContactChanged: { - if (pubkey === wrapper.chatId) { - wrapper.profileImage = appMain.getProfileImage(wrapper.chatId) - } - } - } - - SVGImage { - id: channelIcon - width: 16 - height: 16 - fillMode: Image.PreserveAspectFit - source: Style.svg("channel-icon-" + (wrapper.realChatType === Constants.chatType.publicChat ? "public-chat" : "group")) - anchors.left: parent.left - anchors.verticalCenter:parent.verticalCenter - } - - StatusQ.StatusSmartIdenticon { - id: contactImage - anchors.left: channelIcon.right - anchors.leftMargin: 4 - anchors.verticalCenter: parent.verticalCenter - image: StatusImageSettings { - width: 16 - height: 16 - source: wrapper.profileImage || wrapper.identicon - isIdenticon: true - } - icon: StatusIconSettings { - width: 16 - height: 16 - letterSize: 11 - } - name: wrapper.name - } - - StyledText { - id: contactInfo - text: wrapper.realChatType !== Constants.chatType.publicChat ? - Emoji.parse(Utils.removeStatusEns(Utils.filterXSS(wrapper.name))) : - "#" + Utils.filterXSS(wrapper.name) - anchors.left: contactImage.right - anchors.leftMargin: 4 - color: wrapper.textColor - font.weight: Font.Medium - font.pixelSize: 13 - anchors.verticalCenter: parent.verticalCenter - } - } - } -} diff --git a/ui/app/AppLayouts/Chat/panels/SuggestionFilterPanel.qml b/ui/app/AppLayouts/Chat/panels/SuggestionFilterPanel.qml index e0d4abcd2..c4e866473 100644 --- a/ui/app/AppLayouts/Chat/panels/SuggestionFilterPanel.qml +++ b/ui/app/AppLayouts/Chat/panels/SuggestionFilterPanel.qml @@ -62,7 +62,9 @@ Item { return } - return chatsModel.plainText(this.filter) + // Not Refactored Yet + return "" +// return chatsModel.plainText(this.filter) } function shouldShowAll(filter) { diff --git a/ui/app/AppLayouts/Chat/panels/communities/CommunityProfilePopupInviteFriendsPanel.qml b/ui/app/AppLayouts/Chat/panels/communities/CommunityProfilePopupInviteFriendsPanel.qml index e388cbf21..92ab8b643 100644 --- a/ui/app/AppLayouts/Chat/panels/communities/CommunityProfilePopupInviteFriendsPanel.qml +++ b/ui/app/AppLayouts/Chat/panels/communities/CommunityProfilePopupInviteFriendsPanel.qml @@ -21,14 +21,15 @@ Column { property alias contactListSearch: contactFieldAndList function sendInvites(pubKeys) { - const error = chatsModel.communities.inviteUsersToCommunityById(root.community.id, JSON.stringify(pubKeys)) - if (error) { - console.error('Error inviting', error) - contactFieldAndList.validationError = error - return - } - //% "Invite successfully sent" - contactFieldAndList.successMessage = qsTrId("invite-successfully-sent") + // Not Refactored Yet +// const error = chatsModel.communities.inviteUsersToCommunityById(root.community.id, JSON.stringify(pubKeys)) +// if (error) { +// console.error('Error inviting', error) +// contactFieldAndList.validationError = error +// return +// } +// //% "Invite successfully sent" +// contactFieldAndList.successMessage = qsTrId("invite-successfully-sent") } StatusDescriptionListItem { @@ -39,9 +40,10 @@ Column { tooltip.text: qsTrId("copy-to-clipboard") icon.name: "copy" iconButton.onClicked: { - let link = `${Constants.communityLinkPrefix}${root.community.id}` - chatsModel.copyToClipboard(link) - tooltip.visible = !tooltip.visible + // Not Refactored Yet +// let link = `${Constants.communityLinkPrefix}${root.community.id}` +// chatsModel.copyToClipboard(link) +// tooltip.visible = !tooltip.visible } width: parent.width } diff --git a/ui/app/AppLayouts/Chat/panels/communities/CommunityProfilePopupMembersListPanel.qml b/ui/app/AppLayouts/Chat/panels/communities/CommunityProfilePopupMembersListPanel.qml index 6cb7c92f0..2f74bb404 100644 --- a/ui/app/AppLayouts/Chat/panels/communities/CommunityProfilePopupMembersListPanel.qml +++ b/ui/app/AppLayouts/Chat/panels/communities/CommunityProfilePopupMembersListPanel.qml @@ -192,7 +192,8 @@ Item { iconRotation: 180 type: StatusMenuItem.Type.Danger enabled: root.community.admin - onTriggered: chatsModel.communities.removeUserFromCommunity(model.pubKey) + // Not Refactored Yet +// onTriggered: chatsModel.communities.removeUserFromCommunity(model.pubKey) } StatusMenuItem { @@ -201,7 +202,8 @@ Item { icon.name: "cancel" type: StatusMenuItem.Type.Danger enabled: root.community.admin - onTriggered: chatsModel.communities.banUserFromCommunity(model.pubKey, root.community.id) + // Not Refactored Yet +// onTriggered: chatsModel.communities.banUserFromCommunity(model.pubKey, root.community.id) } } } diff --git a/ui/app/AppLayouts/Chat/popups/ActivityCenterPopup.qml b/ui/app/AppLayouts/Chat/popups/ActivityCenterPopup.qml index 8aca96202..ea2ed4cec 100644 --- a/ui/app/AppLayouts/Chat/popups/ActivityCenterPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/ActivityCenterPopup.qml @@ -81,7 +81,8 @@ Popup { profileLayoutContainer.changeProfileSection(7) } onMarkAllReadClicked: { - errorText = activityCenter.store.chatsModelInst.activityNotificationList.markAllActivityCenterNotificationsRead() + // Not Refactored Yet +// errorText = activityCenter.store.chatsModelInst.activityNotificationList.markAllActivityCenterNotificationsRead() } } @@ -145,7 +146,9 @@ Popup { function(left, right) { return left.timestamp > right.timestamp } ] - model: activityCenter.store.chatsModelInst.activityNotificationList + // Not Refactored Yet + model: [] +// model: activityCenter.store.chatsModelInst.activityNotificationList delegate: Item { id: notificationDelegate @@ -183,7 +186,9 @@ Popup { } return -1; } - property string previousNotificationTimestamp: notificationDelegate.idx === 0 ? "" : chatsModel.activityNotificationList.getNotificationData(previousNotificationIndex, "timestamp") + // Not Refactored Yet + property string previousNotificationTimestamp: "" +// property string previousNotificationTimestamp: notificationDelegate.idx === 0 ? "" : chatsModel.activityNotificationList.getNotificationData(previousNotificationIndex, "timestamp") onPreviousNotificationTimestampChanged: { activityCenter.store.messageStore.prevMsgTimestamp = previousNotificationTimestamp; } @@ -222,7 +227,8 @@ Popup { } Item { - visible: activityCenter.store.chatsModelInst.activityNotificationList.hasMoreToShow + // Not Refactored Yet +// visible: activityCenter.store.chatsModelInst.activityNotificationList.hasMoreToShow width: parent.width height: visible ? showMoreBtn.height + showMoreBtn.anchors.topMargin : 0 StatusButton { @@ -232,7 +238,8 @@ Popup { anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top anchors.topMargin: Style.current.smallPadding - onClicked: activityCenter.store.chatsModelInst.activityNotificationList.loadMoreNotifications() + // Not Refactored Yet +// onClicked: activityCenter.store.chatsModelInst.activityNotificationList.loadMoreNotifications() } } } diff --git a/ui/app/AppLayouts/Chat/popups/ChatCommandModal.qml b/ui/app/AppLayouts/Chat/popups/ChatCommandModal.qml index f87bb2de5..ef19e4fa4 100644 --- a/ui/app/AppLayouts/Chat/popups/ChatCommandModal.qml +++ b/ui/app/AppLayouts/Chat/popups/ChatCommandModal.qml @@ -58,7 +58,8 @@ StatusModal { } return null } - currency: root.store.walletModelInst.balanceView.defaultCurrency + // Not Refactored Yet +// currency: root.store.walletModelInst.balanceView.defaultCurrency width: stack.width label: { return root.isRequested ? @@ -88,7 +89,8 @@ StatusModal { RecipientSelector { id: selectRecipient - accounts: root.store.walletModelInst.accountsView.accounts + // Not Refactored Yet +// accounts: root.store.walletModelInst.accountsView.accounts contacts: root.store.addedContacts label: root.isRequested ? //% "From" @@ -112,10 +114,12 @@ StatusModal { AssetAndAmountInput { id: txtAmount selectedAccount: selectFromAccount.selectedAccount - defaultCurrency: root.store.walletModelInst.balanceView.defaultCurrency + // Not Refactored Yet +// defaultCurrency: root.store.walletModelInst.balanceView.defaultCurrency currentCurrency: root.store.currentCurrency - getFiatValue: root.store.walletModelInst.balanceView.getFiatValue - getCryptoValue: root.store.walletModelInst.balanceView.getCryptoValue + // Not Refactored Yet +// getFiatValue: root.store.walletModelInst.balanceView.getFiatValue +// getCryptoValue: root.store.walletModelInst.balanceView.getCryptoValue validateBalance: !root.isRequested width: stack.width } @@ -137,7 +141,8 @@ StatusModal { asset: txtAmount.selectedAsset amount: { "value": txtAmount.selectedAmount, "fiatValue": txtAmount.selectedFiatAmount } toWarn: addressRequiredValidator.isWarn - currency: walletModel.balanceView.defaultCurrency + // Not Refactored Yet +// currency: walletModel.balanceView.defaultCurrency } AddressRequiredValidator { diff --git a/ui/app/AppLayouts/Chat/popups/GroupChatPopup.qml b/ui/app/AppLayouts/Chat/popups/GroupChatPopup.qml index 41dd1b857..50b4d5eaf 100644 --- a/ui/app/AppLayouts/Chat/popups/GroupChatPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/GroupChatPopup.qml @@ -73,7 +73,8 @@ ModalPopup { if (pubKeys.length === 0) { return; } - popup.store.chatsModelInst.groups.create(Utils.filterXSS(groupName.text), JSON.stringify(pubKeys)); + // Not Refactored Yet +// popup.store.chatsModelInst.groups.create(Utils.filterXSS(groupName.text), JSON.stringify(pubKeys)); popup.close(); } diff --git a/ui/app/AppLayouts/Chat/popups/GroupInfoPopup.qml b/ui/app/AppLayouts/Chat/popups/GroupInfoPopup.qml index 85e39b47c..791d907e9 100644 --- a/ui/app/AppLayouts/Chat/popups/GroupInfoPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/GroupInfoPopup.qml @@ -46,7 +46,8 @@ StatusModal { function doAddMembers(){ if(pubKeys.length === 0) return; if (popup.channel) { - chatsModel.groups.addMembers(popup.channel.id, JSON.stringify(pubKeys)); + // Not Refactored Yet +// chatsModel.groups.addMembers(popup.channel.id, JSON.stringify(pubKeys)); } popup.close(); } @@ -171,7 +172,8 @@ StatusModal { spacing: Style.current.padding StatusSettingsLineButton { - property int pinnedCount: popup.store.chatsModelInst.messageView.pinnedMessagesList.count + // Not Refactored Yet + property int pinnedCount: 0 // popup.store.chatsModelInst.messageView.pinnedMessagesList.count id: pinnedMessagesBtn visible: pinnedCount > 0 @@ -187,21 +189,22 @@ StatusModal { visible: pinnedMessagesBtn.visible } - Connections { - target: popup.store.chatsModelInst.channelView - onActiveChannelChanged: { - if (popup.channelType === GroupInfoPopup.ChannelType.ActiveChannel) { - popup.channel = popup.store.chatsModelInst.channelView.activeChannel - resetSelectedMembers() - } - } - onContextChannelChanged: { - if (popup.channelType === GroupInfoPopup.ChannelType.ContextChannel) { - popup.channel = popup.store.chatsModelInst.channelView.contextChannel - resetSelectedMembers() - } - } - } + // Not Refactored Yet +// Connections { +// target: popup.store.chatsModelInst.channelView +// onActiveChannelChanged: { +// if (popup.channelType === GroupInfoPopup.ChannelType.ActiveChannel) { +// popup.channel = popup.store.chatsModelInst.channelView.activeChannel +// resetSelectedMembers() +// } +// } +// onContextChannelChanged: { +// if (popup.channelType === GroupInfoPopup.ChannelType.ContextChannel) { +// popup.channel = popup.store.chatsModelInst.channelView.contextChannel +// resetSelectedMembers() +// } +// } +// } ListView { id: memberList @@ -243,7 +246,8 @@ StatusModal { icon.height: 16 //% "Make Admin" text: qsTrId("make-admin") - onTriggered: popup.store.chatsModelInst.groups.makeAdmin(popup.channel.id, model.publicKey) + // Not Refactored Yet +// onTriggered: popup.store.chatsModelInst.groups.makeAdmin(popup.channel.id, model.publicKey) } StatusMenuItem { icon.name: "remove-contact" @@ -252,7 +256,8 @@ StatusModal { type: StatusMenuItem.Type.Danger //% "Remove From Group" text: qsTrId("remove-from-group") - onTriggered: popup.store.chatsModelInst.groups.kickMember(popup.channel.id, model.publicKey) + // Not Refactored Yet +// onTriggered: popup.store.chatsModelInst.groups.kickMember(popup.channel.id, model.publicKey) } } } @@ -300,11 +305,12 @@ StatusModal { RenameGroupPopup { id: renameGroupPopup - activeChannelName: popup.store.chatsModelInst.channelView.activeChannel.name - onDoRename: { - popup.store.chatsModelInst.groups.rename(groupName) - popup.header.title = groupName - close() - } + // Not Refactored Yet +// activeChannelName: popup.store.chatsModelInst.channelView.activeChannel.name +// onDoRename: { +// popup.store.chatsModelInst.groups.rename(groupName) +// popup.header.title = groupName +// close() +// } } } diff --git a/ui/app/AppLayouts/Chat/popups/PinnedMessagesPopup.qml b/ui/app/AppLayouts/Chat/popups/PinnedMessagesPopup.qml index 0877d47e7..2f7112735 100644 --- a/ui/app/AppLayouts/Chat/popups/PinnedMessagesPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/PinnedMessagesPopup.qml @@ -21,14 +21,16 @@ ModalPopup { property var messageStore property var chatSectionModule property bool userCanPin: { - switch (popup.rootStore.chatsModelInst.channelView.activeChannel.chatType) { - case Constants.chatType.publicChat: return false - case Constants.chatType.profile: return false - case Constants.chatType.oneToOne: return true - case Constants.chatType.privateGroupChat: return popup.rootStore.chatsModelInst.channelView.activeChannel.isAdmin(userProfile.pubKey) - case Constants.chatType.communityChat: return popup.rootStore.chatsModelInst.communities.activeCommunity.admin - default: return false - } + // Not Refactored Yet + return false +// switch (popup.rootStore.chatsModelInst.channelView.activeChannel.chatType) { +// case Constants.chatType.publicChat: return false +// case Constants.chatType.profile: return false +// case Constants.chatType.oneToOne: return true +// case Constants.chatType.privateGroupChat: return popup.rootStore.chatsModelInst.channelView.activeChannel.isAdmin(userProfile.pubKey) +// case Constants.chatType.communityChat: return popup.rootStore.chatsModelInst.communities.activeCommunity.admin +// default: return false +// } } property string messageToPin property string messageToUnpin @@ -100,7 +102,8 @@ ModalPopup { ListView { id: pinnedMessageListView - model: popup.rootStore.chatsModelInst.messageView.pinnedMessagesList + // Not Refactored Yet +// model: popup.rootStore.chatsModelInst.messageView.pinnedMessagesList height: parent.height anchors.left: parent.left anchors.leftMargin: -Style.current.padding @@ -235,9 +238,10 @@ ModalPopup { type: StatusQControls.StatusBaseButton.Type.Danger anchors.right: parent.right onClicked: { - const chatId = popup.rootStore.chatsModelInst.channelView.activeChannel.id - popup.rootStore.chatsModelInst.messageView.unPinMessage(messageToUnpin, chatId) - popup.rootStore.chatsModelInst.messageView.pinMessage(messageToPin, chatId) + // Not Refactored Yet +// const chatId = popup.rootStore.chatsModelInst.channelView.activeChannel.id +// popup.rootStore.chatsModelInst.messageView.unPinMessage(messageToUnpin, chatId) +// popup.rootStore.chatsModelInst.messageView.pinMessage(messageToPin, chatId) messageToUnpin = messageToPin = "" popup.close() } diff --git a/ui/app/AppLayouts/Chat/popups/ProfilePopup.qml b/ui/app/AppLayouts/Chat/popups/ProfilePopup.qml index 6430aa361..6e6814282 100644 --- a/ui/app/AppLayouts/Chat/popups/ProfilePopup.qml +++ b/ui/app/AppLayouts/Chat/popups/ProfilePopup.qml @@ -8,8 +8,6 @@ import utils 1.0 import shared 1.0 import shared.popups 1.0 -import "../../Profile/popups" - import StatusQ.Core.Theme 0.1 import StatusQ.Components 0.1 import StatusQ.Controls 0.1 @@ -26,7 +24,6 @@ StatusModal { //TODO --------------------------------------- //use one PofilePopup instance and pass the store there property var store - property var profileStore property var identicon: "" property var userName: "" property string nickname: "" @@ -54,19 +51,21 @@ StatusModal { fromAuthor = fromAuthorParam || "" identicon = identiconParam || "" text = textParam || "" - isEnsVerified = chatsModel.ensView.isEnsVerified(this.fromAuthor) + // Not Refactored Yet +// isEnsVerified = chatsModel.ensView.isEnsVerified(this.fromAuthor) isBlocked = popup.store.contactsModuleInst.model.isContactBlocked(this.fromAuthor); - alias = chatsModel.alias(this.fromAuthor) || "" + // Not Refactored Yet +// alias = chatsModel.alias(this.fromAuthor) || "" isCurrentUser = userProfile.pubKey === this.fromAuthor showFooter = _showFooter; popup.open() } - header.title: Utils.removeStatusEns(isCurrentUser ? profileModel.ens.preferredUsername || userName : userName) + // Not Refactored Yet +// header.title: Utils.removeStatusEns(isCurrentUser ? profileModel.ens.preferredUsername || userName : userName) header.subTitle: isEnsVerified ? alias : fromAuthor header.subTitleElide: Text.ElideMiddle header.image.source: identicon - header.headerImageEditable: isCurrentUser headerActionButton: StatusFlatRoundButton { type: StatusFlatRoundButton.Type.Secondary @@ -79,27 +78,6 @@ StatusModal { onClicked: contentItem.qrCodePopup.open() } - property var popupLink: null - - onHeaderImageClicked: { - popupLink = changeProfileModalComponent.createObject(applicationWindow); - popupLink.open() - } - - Component { - id: changeProfileModalComponent - ChangeProfilePicModal { - largeImage: profileStore.profileLargeImage - hasIdentityImage: profileStore.profileHasIdentityImage - onCropFinished: { - uploadError = profileStore.uploadImage(selectedImage, aX, aY, bX, bY) - } - onRemoveImageButtonClicked: { - uploadError = profileStore.removeImage() - } - } - } - contentItem: Item { width: popup.width height: modalContent.height @@ -114,28 +92,21 @@ StatusModal { anchors.top: parent.top width: parent.width - // Blocked User Status Bar - StatusBanner { - id: blockedUsrBar - width: parent.width - visible: isBlocked - type: StatusBanner.Type.Danger - statusText: qsTr("Blocked") - } - Item { height: 16 width: parent.width } - StatusDescriptionListItem { - title: ((isCurrentUser && profileModel.ens.preferredUsername) || isEnsVerified) ? qsTr("ENS username") : qsTr("Username") - subTitle: isCurrentUser ? profileModel.ens.preferredUsername || userName : userName + StatusDescriptionListItem { + // Not Refactored Yet +// title: ((isCurrentUser && profileModel.ens.preferredUsername) || isEnsVerified) ? qsTr("ENS username") : qsTr("Username") +// subTitle: isCurrentUser ? profileModel.ens.preferredUsername || userName : userName tooltip.text: qsTr("Copy to clipboard") icon.name: "copy" iconButton.onClicked: { - chatsModel.copyToClipboard(userName) - tooltip.visible = !tooltip.visible + // Not Refactored Yet +// chatsModel.copyToClipboard(userName) +// tooltip.visible = !tooltip.visible } width: parent.width } @@ -149,18 +120,25 @@ StatusModal { tooltip.text: qsTr("Copy to clipboard") icon.name: "copy" iconButton.onClicked: { - chatsModel.copyToClipboard(fromAuthor) - tooltip.visible = !tooltip.visible + // Not Refactored Yet +// chatsModel.copyToClipboard(fromAuthor) +// tooltip.visible = !tooltip.visible } width: parent.width } + StatusModalDivider { + topPadding: 12 + bottomPadding: 16 + } + StatusDescriptionListItem { title: qsTr("Share Profile URL") subTitle: { let user = "" if (isCurrentUser) { - user = profileModel.ens.preferredUsername + // Not Refactored Yet +// user = profileModel.ens.preferredUsername } else { if (isEnsVerified) { user = userName.startsWith("@") ? userName.substring(1) : userName @@ -176,7 +154,8 @@ StatusModal { iconButton.onClicked: { let user = "" if (isCurrentUser) { - user = profileModel.ens.preferredUsername + // Not Refactored Yet +// user = profileModel.ens.preferredUsername } else { if (isEnsVerified) { user = userName.startsWith("@") ? userName.substring(1) : userName @@ -186,12 +165,19 @@ StatusModal { user = fromAuthor } - chatsModel.copyToClipboard(Constants.userLinkPrefix + user) + // Not Refactored Yet +// chatsModel.copyToClipboard(Constants.userLinkPrefix + user) tooltip.visible = !tooltip.visible } width: parent.width } + StatusModalDivider { + visible: !isCurrentUser + topPadding: 8 + bottomPadding: 12 + } + StatusDescriptionListItem { visible: !isCurrentUser title: qsTr("Chat settings") @@ -219,7 +205,8 @@ StatusModal { Image { asynchronous: true fillMode: Image.PreserveAspectFit - source: profileModel.qrCode(fromAuthor) + // Not Refactored Yet +// source: profileModel.qrCode(fromAuthor) anchors.horizontalCenter: parent.horizontalCenter height: 212 width: 212 @@ -272,9 +259,10 @@ StatusModal { popup.nickname = newNickname; popup.store.contactsModuleInst.changeContactNickname(fromAuthor, newNickname); popup.close() - if (!!chatsModel.communities.activeCommunity) { - chatsModel.communities.activeCommunity.triggerMembersUpdate(); - } + // Not Refactored Yet +// if (!!chatsModel.communities.activeCommunity) { +// chatsModel.communities.activeCommunity.triggerMembersUpdate(); +// } } } } diff --git a/ui/app/AppLayouts/Chat/popups/SignTransactionModal.qml b/ui/app/AppLayouts/Chat/popups/SignTransactionModal.qml index 2c8d9620e..f45aebb41 100644 --- a/ui/app/AppLayouts/Chat/popups/SignTransactionModal.qml +++ b/ui/app/AppLayouts/Chat/popups/SignTransactionModal.qml @@ -35,36 +35,37 @@ StatusModal { property var sendTransaction: function(selectedGasLimit, selectedGasPrice, selectedTipLimit, selectedOveralLimit, enteredPassword) { let success = false - if(root.selectedAsset.address == Constants.zeroAddress){ - success = root.store.walletModelInst.transactionsView.transferEth( - selectFromAccount.selectedAccount.address, - selectRecipient.selectedRecipient.address, - root.selectedAmount, - selectedGasLimit, - gasSelector.eip1599Enabled ? "" : gasSelector.selectedGasPrice, - gasSelector.selectedTipLimit, - gasSelector.selectedOverallLimit, - enteredPassword, - stack.uuid) - } else { - success = root.store.walletModelInst.transactionsView.transferTokens( - selectFromAccount.selectedAccount.address, - selectRecipient.selectedRecipient.address, - root.selectedAsset.address, - root.selectedAmount, - selectedGasLimit, - gasSelector.eip1599Enabled ? "" : gasSelector.selectedGasPrice, - gasSelector.selectedTipLimit, - gasSelector.selectedOverallLimit, - enteredPassword, - stack.uuid) - } + // Not Refactored Yet +// if(root.selectedAsset.address == Constants.zeroAddress){ +// success = root.store.walletModelInst.transactionsView.transferEth( +// selectFromAccount.selectedAccount.address, +// selectRecipient.selectedRecipient.address, +// root.selectedAmount, +// selectedGasLimit, +// gasSelector.eip1599Enabled ? "" : gasSelector.selectedGasPrice, +// gasSelector.selectedTipLimit, +// gasSelector.selectedOverallLimit, +// enteredPassword, +// stack.uuid) +// } else { +// success = root.store.walletModelInst.transactionsView.transferTokens( +// selectFromAccount.selectedAccount.address, +// selectRecipient.selectedRecipient.address, +// root.selectedAsset.address, +// root.selectedAmount, +// selectedGasLimit, +// gasSelector.eip1599Enabled ? "" : gasSelector.selectedGasPrice, +// gasSelector.selectedTipLimit, +// gasSelector.selectedOverallLimit, +// enteredPassword, +// stack.uuid) +// } - if(!success){ - //% "Invalid transaction parameters" - sendingError.text = qsTrId("invalid-transaction-parameters") - sendingError.open() - } +// if(!success){ +// //% "Invalid transaction parameters" +// sendingError.text = qsTrId("invalid-transaction-parameters") +// sendingError.open() +// } } property MessageDialog sendingError: MessageDialog { @@ -95,12 +96,13 @@ StatusModal { TransactionFormGroup { id: groupSelectAcct headerText: { - if(trxData.startsWith("0x095ea7b3")){ - const approveData = JSON.parse(root.store.walletModelInst.tokensView.decodeTokenApproval(selectedRecipient.address, trxData)) - if(approveData.symbol) - //% "Authorize %1 %2" - return qsTrId("authorize--1--2").arg(approveData.amount).arg(approveData.symbol) - } + // Not Refactored Yet +// if(trxData.startsWith("0x095ea7b3")){ +// const approveData = JSON.parse(root.store.walletModelInst.tokensView.decodeTokenApproval(selectedRecipient.address, trxData)) +// if(approveData.symbol) +// //% "Authorize %1 %2" +// return qsTrId("authorize--1--2").arg(approveData.amount).arg(approveData.symbol) +// } return qsTrId("command-button-send"); } //% "Continue" @@ -113,8 +115,9 @@ StatusModal { } StatusAccountSelector { id: selectFromAccount - accounts: root.store.walletModelInst.accountsView.accounts - currency: root.store.walletModelInst.balanceView.defaultCurrency + // Not Refactored Yet +// accounts: root.store.walletModelInst.accountsView.accounts +// currency: root.store.walletModelInst.balanceView.defaultCurrency width: stack.width selectedAccount: root.selectedAccount //% "Choose account" @@ -126,7 +129,8 @@ StatusModal { RecipientSelector { id: selectRecipient visible: false - accounts: root.store.walletModelInst.accountsView.accounts + // Not Refactored Yet +// accounts: root.store.walletModelInst.accountsView.accounts contacts: root.store.addedContacts selectedRecipient: root.selectedRecipient readOnly: true @@ -144,40 +148,42 @@ StatusModal { GasSelector { id: gasSelector anchors.topMargin: Style.current.padding - gasPrice: parseFloat(root.store.walletModelInst.gasView.gasPrice) - getGasEthValue: root.store.walletModelInst.gasView.getGasEthValue - getFiatValue: root.store.walletModelInst.balanceView.getFiatValue - defaultCurrency: root.store.walletModelInst.balanceView.defaultCurrency + // Not Refactored Yet +// gasPrice: parseFloat(root.store.walletModelInst.gasView.gasPrice) +// getGasEthValue: root.store.walletModelInst.gasView.getGasEthValue +// getFiatValue: root.store.walletModelInst.balanceView.getFiatValue +// defaultCurrency: root.store.walletModelInst.balanceView.defaultCurrency width: stack.width property var estimateGas: Backpressure.debounce(gasSelector, 600, function() { - if (!(selectFromAccount.selectedAccount && selectFromAccount.selectedAccount.address && - selectRecipient.selectedRecipient && selectRecipient.selectedRecipient.address && - root.selectedAsset && root.selectedAsset.address && - root.selectedAmount)) { - selectedGasLimit = 250000 - defaultGasLimit = selectedGasLimit - return - } + // Not Refactored Yet +// if (!(selectFromAccount.selectedAccount && selectFromAccount.selectedAccount.address && +// selectRecipient.selectedRecipient && selectRecipient.selectedRecipient.address && +// root.selectedAsset && root.selectedAsset.address && +// root.selectedAmount)) { +// selectedGasLimit = 250000 +// defaultGasLimit = selectedGasLimit +// return +// } - let gasEstimate = JSON.parse(root.store.walletModelInst.gasView.estimateGas( - selectFromAccount.selectedAccount.address, - selectRecipient.selectedRecipient.address, - root.selectedAsset.address, - root.selectedAmount, - trxData)) +// let gasEstimate = JSON.parse(root.store.walletModelInst.gasView.estimateGas( +// selectFromAccount.selectedAccount.address, +// selectRecipient.selectedRecipient.address, +// root.selectedAsset.address, +// root.selectedAmount, +// trxData)) - if (!gasEstimate.success) { - //% "Error estimating gas: %1" - let message = qsTrId("error-estimating-gas---1").arg(gasEstimate.error.message) +// if (!gasEstimate.success) { +// //% "Error estimating gas: %1" +// let message = qsTrId("error-estimating-gas---1").arg(gasEstimate.error.message) - //% ". The transaction will probably fail." - gasEstimateErrorPopup.confirmationText = message + qsTrId("--the-transaction-will-probably-fail-") - gasEstimateErrorPopup.open() - return - } - selectedGasLimit = gasEstimate.result - defaultGasLimit = selectedGasLimit +// //% ". The transaction will probably fail." +// gasEstimateErrorPopup.confirmationText = message + qsTrId("--the-transaction-will-probably-fail-") +// gasEstimateErrorPopup.open() +// return +// } +// selectedGasLimit = gasEstimate.result +// defaultGasLimit = selectedGasLimit }) } GasValidator { @@ -214,7 +220,8 @@ StatusModal { toAccount: selectRecipient.selectedRecipient asset: root.selectedAsset amount: { "value": root.selectedAmount, "fiatValue": root.selectedFiatAmount } - currency: root.store.walletModelInst.balanceView.defaultCurrency + // Not Refactored Yet +// currency: root.store.walletModelInst.balanceView.defaultCurrency isFromEditable: false trxData: root.trxData isGasEditable: true @@ -255,7 +262,8 @@ StatusModal { TransactionSigner { id: transactionSigner width: stack.width - signingPhrase: root.store.walletModelInst.utilsView.signingPhrase + // Not Refactored Yet +// signingPhrase: root.store.walletModelInst.utilsView.signingPhrase } } } @@ -334,43 +342,45 @@ StatusModal { } } - Connections { - target: root.store.walletModelInst.transactionsView - onTransactionWasSent: { - try { - let response = JSON.parse(txResult) - if (response.uuid !== stack.uuid) - return + // Not Refactored Yet +// Connections { +// target: root.store.walletModelInst.transactionsView +// onTransactionWasSent: { +// try { +// let response = JSON.parse(txResult) +// if (response.uuid !== stack.uuid) +// return - let transactionId = response.result +// let transactionId = response.result - if (!response.success) { - if (Utils.isInvalidPasswordMessage(transactionId)){ - //% "Wrong password" - transactionSigner.validationError = qsTrId("wrong-password") - return - } - sendingError.text = transactionId - return sendingError.open() - } +// if (!response.success) { +// if (Utils.isInvalidPasswordMessage(transactionId)){ +// //% "Wrong password" +// transactionSigner.validationError = qsTrId("wrong-password") +// return +// } +// sendingError.text = transactionId +// return sendingError.open() +// } - chatsModel.transactions.acceptRequestTransaction(transactionId, - messageId, - userProfile.pubKey + transactionId.substr(2)) +// // Not Refactored Yet +//// chatsModel.transactions.acceptRequestTransaction(transactionId, +//// messageId, +//// userProfile.pubKey + transactionId.substr(2)) - //% "Transaction pending..." - toastMessage.title = qsTrId("ens-transaction-pending") - toastMessage.source = Style.svg("loading") - toastMessage.iconColor = Style.current.primary - toastMessage.iconRotates = true - toastMessage.link = `${root.store.walletModelInst.utilsView.etherscanLink}/${transactionId}` - toastMessage.open() +// //% "Transaction pending..." +// toastMessage.title = qsTrId("ens-transaction-pending") +// toastMessage.source = Style.svg("loading") +// toastMessage.iconColor = Style.current.primary +// toastMessage.iconRotates = true +// toastMessage.link = `${root.store.walletModelInst.utilsView.etherscanLink}/${transactionId}` +// toastMessage.open() - root.close() - } catch (e) { - console.error('Error parsing the response', e) - } - } - } +// root.close() +// } catch (e) { +// console.error('Error parsing the response', e) +// } +// } +// } } diff --git a/ui/app/AppLayouts/Chat/popups/community/CommunityDetailPopup.qml b/ui/app/AppLayouts/Chat/popups/community/CommunityDetailPopup.qml index c1c2d7779..c3f433bc4 100644 --- a/ui/app/AppLayouts/Chat/popups/community/CommunityDetailPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/community/CommunityDetailPopup.qml @@ -15,7 +15,8 @@ StatusModal { id: root property var store - property QtObject community: root.store.chatsModelInst.communities.observedCommunity + // Not Refactored Yet + property QtObject community: null // root.store.chatsModelInst.communities.observedCommunity property string communityId: community.id property string name: community.name property string description: community.description @@ -158,13 +159,15 @@ StatusModal { if (access !== Constants.communityChatOnRequestAccess) { return false } - return root.store.chatsModelInst.communities.isCommunityRequestPending(root.communityId) + // Not Refactored Yet +// return root.store.chatsModelInst.communities.isCommunityRequestPending(root.communityId) } text: { - if (root.ensOnly && !root.store.profileModelInst.profile.ensVerified) { - //% "Membership requires an ENS username" - return qsTrId("membership-requires-an-ens-username") - } + // Not Refactored Yet +// if (root.ensOnly && !root.store.profileModelInst.profile.ensVerified) { +// //% "Membership requires an ENS username" +// return qsTrId("membership-requires-an-ens-username") +// } if (root.canJoin) { //% "Join ‘%1’" return qsTrId("join---1-").arg(root.name); @@ -185,9 +188,10 @@ StatusModal { } } enabled: { - if (root.ensOnly && !root.store.profileModelInst.profile.ensVerified) { - return false - } + // Not Refactored Yet +// if (root.ensOnly && !root.store.profileModelInst.profile.ensVerified) { +// return false +// } if (root.access === Constants.communityChatInvitationOnlyAccess || isPendingRequest) { return false } @@ -197,24 +201,25 @@ StatusModal { return true } onClicked: { - let error - if (access === Constants.communityChatOnRequestAccess && !root.isMember) { - error = root.store.chatsModelInst.communities.requestToJoinCommunity(root.communityId, userProfile.name) - if (!error) { - enabled = false - //% "Pending" - text = qsTrId("invite-chat-pending") - } - } else { - error = root.store.chatsModelInst.communities.joinCommunity(root.communityId, true) - } + // Not Refactored Yet +// let error +// if (access === Constants.communityChatOnRequestAccess && !root.isMember) { +// error = root.store.chatsModelInst.communities.requestToJoinCommunity(root.communityId, userProfile.name) +// if (!error) { +// enabled = false +// //% "Pending" +// text = qsTrId("invite-chat-pending") +// } +// } else { +// error = root.store.chatsModelInst.communities.joinCommunity(root.communityId, true) +// } - if (error) { - joiningError.text = error - return joiningError.open() - } +// if (error) { +// joiningError.text = error +// return joiningError.open() +// } - root.close() +// root.close() } } ] diff --git a/ui/app/AppLayouts/Chat/popups/community/CreateCategoryPopup.qml b/ui/app/AppLayouts/Chat/popups/community/CreateCategoryPopup.qml index 0189472e1..698bd57a0 100644 --- a/ui/app/AppLayouts/Chat/popups/community/CreateCategoryPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/community/CreateCategoryPopup.qml @@ -30,7 +30,8 @@ StatusModal { onOpened: { if(isEdit){ root.contentItem.categoryName.input.text = categoryName - channels = JSON.parse(root.store.chatsModelInst.communities.activeCommunity.getChatIdsByCategory(categoryId)) + // Not Refactored Yet +// channels = JSON.parse(root.store.chatsModelInst.communities.activeCommunity.getChatIdsByCategory(categoryId)) } root.contentItem.categoryName.input.forceActiveFocus(Qt.MouseFocusReason) } @@ -109,7 +110,8 @@ StatusModal { anchors.top: channelsLabel.bottom height: childrenRect.height width: parent.width - model: root.store.activeCommunityChatsModel + // Not Refactored Yet +// model: root.store.activeCommunityChatsModel interactive: false clip: true diff --git a/ui/app/AppLayouts/Chat/popups/community/CreateChannelPopup.qml b/ui/app/AppLayouts/Chat/popups/community/CreateChannelPopup.qml index 7e67973d9..537ff7884 100644 --- a/ui/app/AppLayouts/Chat/popups/community/CreateChannelPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/community/CreateChannelPopup.qml @@ -171,7 +171,8 @@ StatusModal { //% "Pinned messages" title: qsTrId("pinned-messages") icon.name: "pin" - label: popup.store.chatsModelInst.messageView.pinnedMessagesList.count + // Not Refactored Yet +// label: popup.store.chatsModelInst.messageView.pinnedMessagesList.count components: [ StatusIcon { icon: "chevron-down" diff --git a/ui/app/AppLayouts/Chat/popups/community/CreateCommunityPopup.qml b/ui/app/AppLayouts/Chat/popups/community/CreateCommunityPopup.qml index dbc496f74..74d055d83 100644 --- a/ui/app/AppLayouts/Chat/popups/community/CreateCommunityPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/community/CreateCommunityPopup.qml @@ -20,7 +20,8 @@ StatusModal { property var store property bool isEdit: false - property QtObject community: popup.store.chatsModelInst.communities.activeCommunity + // Not Refactored Yet + property QtObject community: null //popup.store.chatsModelInst.communities.activeCommunity property var onSave: () => {} readonly property int maxCommunityNameLength: 30 readonly property int maxCommunityDescLength: 140 diff --git a/ui/app/AppLayouts/Chat/popups/community/MembershipRequestsPopup.qml b/ui/app/AppLayouts/Chat/popups/community/MembershipRequestsPopup.qml index 2c49ac944..31925ac00 100644 --- a/ui/app/AppLayouts/Chat/popups/community/MembershipRequestsPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/community/MembershipRequestsPopup.qml @@ -53,7 +53,8 @@ StatusModal { ListView { id: membershipRequestList anchors.fill: parent - model: popup.store.chatsModelInst.communities.activeCommunity.communityMembershipRequests + // Not Refactored Yet +// model: popup.store.chatsModelInst.communities.activeCommunity.communityMembershipRequests clip: true delegate: StatusListItem { diff --git a/ui/app/AppLayouts/Chat/stores/RootStore.qml b/ui/app/AppLayouts/Chat/stores/RootStore.qml index fdbfb43da..b4080ddd8 100644 --- a/ui/app/AppLayouts/Chat/stores/RootStore.qml +++ b/ui/app/AppLayouts/Chat/stores/RootStore.qml @@ -8,10 +8,14 @@ QtObject { property var messageStore property EmojiReactions emojiReactionsModel: EmojiReactions { } - property var chatsModelInst: chatsModel - property var utilsModelInst: utilsModel - property var walletModelInst: walletModel - property var profileModelInst: profileModel + // Not Refactored Yet +// property var chatsModelInst: chatsModel + // Not Refactored Yet +// property var utilsModelInst: utilsModel + // Not Refactored Yet +// property var walletModelInst: walletModel + // Not Refactored Yet +// property var profileModelInst: profileModel property var profileModuleInst: profileModule property var userProfileInst: userProfile @@ -40,18 +44,21 @@ QtObject { property var contactsModuleInst: contactsModule property var stickersModuleInst: stickersModule - property var activeCommunity: chatsModelInst.communities.activeCommunity + // Not Refactored Yet +// property var activeCommunity: chatsModelInst.communities.activeCommunity property var contactRequests: contactsModuleInst.model.contactRequests property var addedContacts: contactsModuleInst.model.addedContacts property var allContacts: contactsModuleInst.model.list function copyToClipboard(text) { - chatsModelInst.copyToClipboard(text); + // Not Refactored Yet +// chatsModelInst.copyToClipboard(text); } function deleteMessage(messageId) { - chatsModelInst.messageView.deleteMessage(messageId); + // Not Refactored Yet +// chatsModelInst.messageView.deleteMessage(messageId); } function lastTwoItems(nodes) { @@ -95,89 +102,102 @@ QtObject { } function getCommunity(communityId) { - try { - const communityJson = chatsModelInst.communities.list.getCommunityByIdJson(communityId); - if (!communityJson) { - return null; - } + // Not Refactored Yet +// try { +// const communityJson = chatsModelInst.communities.list.getCommunityByIdJson(communityId); +// if (!communityJson) { +// return null; +// } - let community = JSON.parse(communityJson); - if (community) { - community.nbMembers = community.members.length; - } - return community - } catch (e) { - console.error("Error parsing community", e); - } +// let community = JSON.parse(communityJson); +// if (community) { +// community.nbMembers = community.members.length; +// } +// return community +// } catch (e) { +// console.error("Error parsing community", e); +// } return null; } - property var activeCommunityChatsModel: chatsModelInst.communities.activeCommunity.chats + // Not Refactored Yet + property var activeCommunityChatsModel: "" //chatsModelInst.communities.activeCommunity.chats function createCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY) { - chatsModelInst.communities.createCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY); + // Not Refactored Yet +// chatsModelInst.communities.createCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY); } function editCommunity(communityId, communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY) { - chatsModelInst.communities.editCommunity(communityId, communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY); + // Not Refactored Yet +// chatsModelInst.communities.editCommunity(communityId, communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY); } function createCommunityCategory(communityId, categoryName, channels) { - chatsModelInst.communities.createCommunityCategory(communityId, categoryName, channels); + // Not Refactored Yet +// chatsModelInst.communities.createCommunityCategory(communityId, categoryName, channels); } function editCommunityCategory(communityId, categoryId, categoryName, channels) { - chatsModelInst.communities.editCommunityCategory(communityId, categoryId, categoryName, channels); + // Not Refactored Yet +// chatsModelInst.communities.editCommunityCategory(communityId, categoryId, categoryName, channels); } function deleteCommunityCategory(categoryId) { - chatsModelInst.communities.deleteCommunityCategory(chatsModelInst.communities.activeCommunity.id, categoryId); + // Not Refactored Yet +// chatsModelInst.communities.deleteCommunityCategory(chatsModelInst.communities.activeCommunity.id, categoryId); } function leaveCommunity(communityId) { - chatsModelInst.communities.leaveCommunity(communityId); - if (communityId == chatsModelInst.communities.activeCommunity.id) { - localAccountSensitiveSettings.lastModeActiveCommunity = "" - } + // Not Refactored Yet +// chatsModelInst.communities.leaveCommunity(communityId); } function setCommunityMuted(communityId, checked) { - chatsModelInst.communities.setCommunityMuted(communityId, checked); + // Not Refactored Yet +// chatsModelInst.communities.setCommunityMuted(communityId, checked); } function exportCommunity() { - return chatsModelInst.communities.exportCommunity(); + // Not Refactored Yet +// return chatsModelInst.communities.exportCommunity(); } function createCommunityChannel(communityId, channelName, channelDescription, categoryId) { // TODO: pass the private value when private channels // are implemented //privateSwitch.checked) - chatsModelInst.createCommunityChannel(communityId, channelName, channelDescription, categoryId); + // Not Refactored Yet +// chatsModelInst.createCommunityChannel(communityId, channelName, channelDescription, categoryId); } function editCommunityChannel(communityId, channelId, channelName, channelDescription, channelCategoryId, popupPosition) { // TODO: pass the private value when private channels // are implemented //privateSwitch.checked) - chatsModelInst.editCommunityChannel(communityId, channelId, channelName, channelDescription, channelCategoryId, popupPosition); + // Not Refactored Yet +// chatsModelInst.editCommunityChannel(communityId, channelId, channelName, channelDescription, channelCategoryId, popupPosition); } function acceptRequestToJoinCommunity(id) { - chatsModelInst.communities.acceptRequestToJoinCommunity(id); + // Not Refactored Yet +// chatsModelInst.communities.acceptRequestToJoinCommunity(id); } function declineRequestToJoinCommunity(id) { - chatsModelInst.communities.declineRequestToJoinCommunity(id); + // Not Refactored Yet +// chatsModelInst.communities.declineRequestToJoinCommunity(id); } function userNameOrAlias(pk) { - return chatsModelInst.userNameOrAlias(pk); + // Not Refactored Yet +// return chatsModelInst.userNameOrAlias(pk); } function generateIdenticon(pk) { - return utilsModelInst.generateIdenticon(pk); + // Not Refactored Yet +// return utilsModelInst.generateIdenticon(pk); } function addContact(pubKey) { diff --git a/ui/app/AppLayouts/Chat/views/ActivityCenterGroupRequest.qml b/ui/app/AppLayouts/Chat/views/ActivityCenterGroupRequest.qml index e44268ac1..9fd26d9d7 100644 --- a/ui/app/AppLayouts/Chat/views/ActivityCenterGroupRequest.qml +++ b/ui/app/AppLayouts/Chat/views/ActivityCenterGroupRequest.qml @@ -105,32 +105,34 @@ Item { function openProfile() { const pk = model.author const userProfileImage = appMain.getProfileImage(pk) - openProfilePopup(root.store.chatsModelInst.userNameOrAlias(pk), pk, userProfileImage || utilsModel.generateIdenticon(pk)) + // Not Refactored Yet +// openProfilePopup(root.store.chatsModelInst.userNameOrAlias(pk), pk, userProfileImage || utilsModel.generateIdenticon(pk)) } StyledTextEdit { id: inviteText visible: !!model.author - text: { - if (!visible) { - return "" - } + // Not Refactored Yet +// text: { +// if (!visible) { +// return "" +// } - let name = root.store.chatsModelInst.userNameOrAlias(model.author) - if (name.length > 20) { - name = name.substring(0, 9) + "..." + name.substring(name.length - 10) - } +// let name = root.store.chatsModelInst.userNameOrAlias(model.author) +// if (name.length > 20) { +// name = name.substring(0, 9) + "..." + name.substring(name.length - 10) +// } - //% "%1 invited you to join the group" - return qsTrId("-1-invited-you-to-join-the-group") - .arg(``+ - `${name}`) - } +// //% "%1 invited you to join the group" +// return qsTrId("-1-invited-you-to-join-the-group") +// .arg(``+ +// `${name}`) +// } anchors.bottom: parent.bottom anchors.bottomMargin: Style.current.halfPadding anchors.left: nameItem.left @@ -153,22 +155,26 @@ Item { anchors.right: parent.right anchors.rightMargin: Style.current.halfPadding anchors.verticalCenter: parent.verticalCenter - onAcceptClicked: root.store.chatsModelInst.activityNotificationList.acceptActivityCenterNotification(model.id) - onDeclineClicked: root.store.chatsModelInst.activityNotificationList.dismissActivityCenterNotification(model.id) + // Not Refactored Yet +// onAcceptClicked: root.store.chatsModelInst.activityNotificationList.acceptActivityCenterNotification(model.id) + // Not Refactored Yet +// onDeclineClicked: root.store.chatsModelInst.activityNotificationList.dismissActivityCenterNotification(model.id) onProfileClicked: groupRequestContent.openProfile() onBlockClicked: { - const pk = model.author - blockContactConfirmationDialog.contactName = root.store.chatsModelInst.userNameOrAlias(pk) - blockContactConfirmationDialog.contactAddress = pk - blockContactConfirmationDialog.open() + // Not Refactored Yet +// const pk = model.author +// blockContactConfirmationDialog.contactName = root.store.chatsModelInst.userNameOrAlias(pk) +// blockContactConfirmationDialog.contactAddress = pk +// blockContactConfirmationDialog.open() } BlockContactConfirmationDialog { id: blockContactConfirmationDialog onBlockButtonClicked: { - root.store.profileModuleInst.blockContact(blockContactConfirmationDialog.contactAddress) - root.store.chatsModelInst.activityNotificationList.dismissActivityCenterNotification(model.id) - blockContactConfirmationDialog.close() + // Not Refactored Yet +// root.store.profileModuleInst.blockContact(blockContactConfirmationDialog.contactAddress) +// root.store.chatsModelInst.activityNotificationList.dismissActivityCenterNotification(model.id) +// blockContactConfirmationDialog.close() } } } diff --git a/ui/app/AppLayouts/Chat/views/ActivityCenterMessageComponentView.qml b/ui/app/AppLayouts/Chat/views/ActivityCenterMessageComponentView.qml index 15950593f..5d14e8ae3 100644 --- a/ui/app/AppLayouts/Chat/views/ActivityCenterMessageComponentView.qml +++ b/ui/app/AppLayouts/Chat/views/ActivityCenterMessageComponentView.qml @@ -31,11 +31,13 @@ Item { } property var store - property int communityIndex: root.store.chatsModelInst.communities.joinedCommunities.getCommunityIndex(model.message.communityId) + // Not Refactored Yet + property int communityIndex: -1 //root.store.chatsModelInst.communities.joinedCommunities.getCommunityIndex(model.message.communityId) function openProfile() { const pk = model.author const userProfileImage = appMain.getProfileImage(pk) - openProfilePopup(root.store.chatsModelInst.userNameOrAlias(pk), pk, userProfileImage || utilsModel.generateIdenticon(pk)) + // Not Refactored Yet +// openProfilePopup(root.store.chatsModelInst.userNameOrAlias(pk), pk, userProfileImage || utilsModel.generateIdenticon(pk)) } Component { @@ -56,10 +58,11 @@ Item { tooltip.x: -tooltip.width - Style.current.padding tooltip.y: markReadBtn.height / 2 - height / 2 + 4 onClicked: { - if (!model.read) { - return root.store.chatsModelInst.activityNotificationList.markActivityCenterNotificationRead(model.id, model.message.communityId, model.message.chatId, model.notificationType) - } - return root.store.chatsModelInst.activityNotificationList.markActivityCenterNotificationUnread(model.id, model.message.communityId, model.message.chatId, model.notificationType) + // Not Refactored Yet +// if (!model.read) { +// return root.store.chatsModelInst.activityNotificationList.markActivityCenterNotificationRead(model.id, model.message.communityId, model.message.chatId, model.notificationType) +// } +// return root.store.chatsModelInst.activityNotificationList.markActivityCenterNotificationUnread(model.id, model.message.communityId, model.message.chatId, model.notificationType) } } } @@ -70,29 +73,33 @@ Item { AcceptRejectOptionsButtonsPanel { id: buttons onAcceptClicked: { - const setActiveChannel = root.store.chatsModelInst.channelView.setActiveChannel - const chatId = model.message.chatId - const messageId = model.message.messageId - root.store.profileModuleInst.addContact(model.author) - root.store.chatsModelInst.activityNotificationList.acceptActivityCenterNotification(model.id) - setActiveChannel(chatId) - positionAtMessage(messageId) + // Not Refactored Yet +// const setActiveChannel = root.store.chatsModelInst.channelView.setActiveChannel +// const chatId = model.message.chatId +// const messageId = model.message.messageId +// root.store.profileModuleInst.addContact(model.author) +// root.store.chatsModelInst.activityNotificationList.acceptActivityCenterNotification(model.id) +// setActiveChannel(chatId) +// positionAtMessage(messageId) } - onDeclineClicked: root.store.chatsModelInst.activityNotificationList.dismissActivityCenterNotification(model.id) + // Not Refactored Yet +// onDeclineClicked: root.store.chatsModelInst.activityNotificationList.dismissActivityCenterNotification(model.id) onProfileClicked: root.openProfile() onBlockClicked: { - const pk = model.author - blockContactConfirmationDialog.contactName = chatsModel.userNameOrAlias(pk) - blockContactConfirmationDialog.contactAddress = pk - blockContactConfirmationDialog.open() + // Not Refactored Yet +// const pk = model.author +// blockContactConfirmationDialog.contactName = chatsModel.userNameOrAlias(pk) +// blockContactConfirmationDialog.contactAddress = pk +// blockContactConfirmationDialog.open() } BlockContactConfirmationDialog { id: blockContactConfirmationDialog onBlockButtonClicked: { - root.store.profileModuleInst.blockContact(blockContactConfirmationDialog.contactAddress) - root.store.chatsModelInst.activityNotificationList.dismissActivityCenterNotification(model.id) - blockContactConfirmationDialog.close() + // Not Refactored Yet +// root.store.profileModuleInst.blockContact(blockContactConfirmationDialog.contactAddress) +// root.store.chatsModelInst.activityNotificationList.dismissActivityCenterNotification(model.id) +// blockContactConfirmationDialog.close() } } } @@ -235,28 +242,37 @@ Item { chatId: model.chatId notificationType: model.notificationType communityId: model.message.communityId - replyMessageIndex: root.store.chatsModelInst.messageView.getMessageIndex(model.chatId, model.responseTo) - repliedMessageContent: replyMessageIndex > -1 ? root.store.chatsModelInst.messageView.getMessageData(chatId, replyMessageIndex, "message") : "" + // Not Refactored Yet +// replyMessageIndex: root.store.chatsModelInst.messageView.getMessageIndex(model.chatId, model.responseTo) + // Not Refactored Yet +// repliedMessageContent: replyMessageIndex > -1 ? root.store.chatsModelInst.messageView.getMessageData(chatId, replyMessageIndex, "message") : "" realChatType: { - var chatType = root.store.chatsModelInst.channelView.chats.getChannelType(model.chatId) - if (chatType === Constants.chatType.communityChat) { - // TODO add a check for private community chats once it is created - return Constants.chatType.publicChat - } - return chatType + // Not Refactored Yet +// var chatType = root.store.chatsModelInst.channelView.chats.getChannelType(model.chatId) +// if (chatType === Constants.chatType.communityChat) { +// // TODO add a check for private community chats once it is created +// return Constants.chatType.publicChat +// } +// return chatType } profileImage: realChatType === Constants.chatType.oneToOne ? appMain.getProfileImage(chatId) || "" : "" - channelName: root.store.chatsModelInst.getChannelNameById(badge.chatId) - communityName: root.communityIndex > -1 ? root.store.chatsModelInst.communities.joinedCommunities.rowData(root.communityIndex, "name") : "" - communityThumbnailImage: root.communityIndex > -1 ? root.store.chatsModelInst.communities.joinedCommunities.rowData(root.communityIndex, "thumbnailImage") : "" - communityColor: !model.image && root.communityIndex > -1 ? root.store.chatsModelInst.communities.joinedCommunities.rowData(root.communityIndex, "communityColor"): "" + // Not Refactored Yet +// channelName: root.store.chatsModelInst.getChannelNameById(badge.chatId) + // Not Refactored Yet +// communityName: root.communityIndex > -1 ? root.store.chatsModelInst.communities.joinedCommunities.rowData(root.communityIndex, "name") : "" + // Not Refactored Yet +// communityThumbnailImage: root.communityIndex > -1 ? root.store.chatsModelInst.communities.joinedCommunities.rowData(root.communityIndex, "thumbnailImage") : "" + // Not Refactored Yet +// communityColor: !model.image && root.communityIndex > -1 ? root.store.chatsModelInst.communities.joinedCommunities.rowData(root.communityIndex, "communityColor"): "" onCommunityNameClicked: { - root.store.chatsModelInst.communities.setActiveCommunity(badge.communityId) + // Not Refactored Yet +// root.store.chatsModelInst.communities.setActiveCommunity(badge.communityId) } onChannelNameClicked: { - root.store.chatsModelInst.communities.setActiveCommunity(badge.communityId) - root.store.chatsModelInst.setActiveChannel(badge.chatId) + // Not Refactored Yet +// root.store.chatsModelInst.communities.setActiveCommunity(badge.communityId) +// root.store.chatsModelInst.setActiveChannel(badge.chatId) } Connections { diff --git a/ui/app/AppLayouts/Chat/views/ChatColumnView.qml b/ui/app/AppLayouts/Chat/views/ChatColumnView.qml index dda9063cf..8fff1835e 100644 --- a/ui/app/AppLayouts/Chat/views/ChatColumnView.qml +++ b/ui/app/AppLayouts/Chat/views/ChatColumnView.qml @@ -39,7 +39,8 @@ Item { property bool isExtendedInput: isReply || isImage property bool isConnected: false property string contactToRemove: "" - property string activeChatId: root.rootStore.chatsModelInst.channelView.activeChannel.id + // Not Refactored Yet +// property string activeChatId: "" //root.rootStore.chatsModelInst.channelView.activeChannel.id property bool isBlocked: root.rootStore.contactsModuleInst.model.isContactBlocked(activeChatId) property bool isContact: root.rootStore.isContactAdded(activeChatId) // property bool contactRequestReceived: root.rootStore.contactsModuleInst.model.contactRequestReceived(activeChatId) @@ -61,14 +62,15 @@ Item { function showReplyArea() { isReply = true; isImage = false; - let replyMessageIndex = root.rootStore.chatsModelInst.messageView.messageList.getMessageIndex(SelectedMessage.messageId); - if (replyMessageIndex === -1) return; - let userName = root.rootStore.chatsModelInst.messageView.messageList.getMessageData(replyMessageIndex, "userName") - let message = root.rootStore.chatsModelInst.messageView.messageList.getMessageData(replyMessageIndex, "message") - let identicon = root.rootStore.chatsModelInst.messageView.messageList.getMessageData(replyMessageIndex, "identicon") - let image = root.rootStore.chatsModelInst.messageView.messageList.getMessageData(replyMessageIndex, "image") - let sticker = root.rootStore.chatsModelInst.messageView.messageList.getMessageData(replyMessageIndex, "sticker") - let contentType = root.rootStore.chatsModelInst.messageView.messageList.getMessageData(replyMessageIndex, "contentType") + // Not Refactored Yet +// let replyMessageIndex = root.rootStore.chatsModelInst.messageView.messageList.getMessageIndex(SelectedMessage.messageId); +// if (replyMessageIndex === -1) return; +// let userName = root.rootStore.chatsModelInst.messageView.messageList.getMessageData(replyMessageIndex, "userName") +// let message = root.rootStore.chatsModelInst.messageView.messageList.getMessageData(replyMessageIndex, "message") +// let identicon = root.rootStore.chatsModelInst.messageView.messageList.getMessageData(replyMessageIndex, "identicon") +// let image = root.rootStore.chatsModelInst.messageView.messageList.getMessageData(replyMessageIndex, "image") +// let sticker = root.rootStore.chatsModelInst.messageView.messageList.getMessageData(replyMessageIndex, "sticker") +// let contentType = root.rootStore.chatsModelInst.messageView.messageList.getMessageData(replyMessageIndex, "contentType") // Not Refactored Yet // if(stackLayoutChatMessages.currentIndex >= 0 && stackLayoutChatMessages.currentIndex < stackLayoutChatMessages.children.length) @@ -76,19 +78,21 @@ Item { } function requestAddressForTransaction(address, amount, tokenAddress, tokenDecimals = 18) { - amount = root.rootStore.utilsModelInst.eth2Wei(amount.toString(), tokenDecimals) - root.rootStore.chatsModelInst.transactions.requestAddress(activeChatId, - address, - amount, - tokenAddress) + // Not Refactored Yet +// amount = root.rootStore.utilsModelInst.eth2Wei(amount.toString(), tokenDecimals) +// root.rootStore.chatsModelInst.transactions.requestAddress(activeChatId, +// address, +// amount, +// tokenAddress) txModalLoader.close() } function requestTransaction(address, amount, tokenAddress, tokenDecimals = 18) { - amount = root.rootStore.utilsModelInst.eth2Wei(amount.toString(), tokenDecimals) - root.rootStore.chatsModelInst.transactions.request(activeChatId, - address, - amount, - tokenAddress) + // Not Refactored Yet +// amount = root.rootStore.utilsModelInst.eth2Wei(amount.toString(), tokenDecimals) +// root.rootStore.chatsModelInst.transactions.request(activeChatId, +// address, +// amount, +// tokenAddress) txModalLoader.close() } @@ -206,8 +210,9 @@ Item { Layout.fillWidth: true Layout.bottomMargin: Style.current.bigPadding isContact: root.isContact - visible: root.rootStore.chatsModelInst.channelView.activeChannel.chatType === Constants.chatType.oneToOne - && (!root.isContact /*|| !contactRequestReceived*/) + // Not Refactored Yet +// visible: root.rootStore.chatsModelInst.channelView.activeChannel.chatType === Constants.chatType.oneToOne +// && (!root.isContact /*|| !contactRequestReceived*/) onAddContactClicked: { root.rootStore.addContact(activeChatId); } @@ -245,9 +250,10 @@ Item { selectRecipient.selectedRecipient: { return { address: Constants.zeroAddress, // Setting as zero address since we don't have the address yet - alias: root.rootStore.chatsModelInst.channelView.activeChannel.alias, - identicon: root.rootStore.chatsModelInst.channelView.activeChannel.identicon, - name: root.rootStore.chatsModelInst.channelView.activeChannel.name, + // Not Refactored Yet +// alias: root.rootStore.chatsModelInst.channelView.activeChannel.alias, +// identicon: root.rootStore.chatsModelInst.channelView.activeChannel.identicon, +// name: root.rootStore.chatsModelInst.channelView.activeChannel.name, type: RecipientSelector.Type.Contact } } @@ -274,9 +280,10 @@ Item { selectRecipient.selectedRecipient: { return { address: Constants.zeroAddress, // Setting as zero address since we don't have the address yet - alias: root.rootStore.chatsModelInst.channelView.activeChannel.alias, - identicon: root.rootStore.chatsModelInst.channelView.activeChannel.identicon, - name: root.rootStore.chatsModelInst.channelView.activeChannel.name, + // Not Refactored Yet +// alias: root.rootStore.chatsModelInst.channelView.activeChannel.alias, +// identicon: root.rootStore.chatsModelInst.channelView.activeChannel.identicon, +// name: root.rootStore.chatsModelInst.channelView.activeChannel.name, type: RecipientSelector.Type.Contact } } @@ -290,7 +297,8 @@ Item { SendModal { id: sendTransactionWithEns onOpened: { - root.rootStore.walletModelInst.gasView.getGasPrice() + // Not Refactored Yet +// root.rootStore.walletModelInst.gasView.getGasPrice() } onClosed: { txModalLoader.closed() @@ -299,9 +307,10 @@ Item { selectRecipient.selectedRecipient: { return { address: "", - alias: root.rootStore.chatsModelInst.channelView.activeChannel.alias, - identicon: root.rootStore.chatsModelInst.channelView.activeChannel.identicon, - name: root.rootStore.chatsModelInst.channelView.activeChannel.name, + // Not Refactored Yet +// alias: root.rootStore.chatsModelInst.channelView.activeChannel.alias, +// identicon: root.rootStore.chatsModelInst.channelView.activeChannel.identicon, +// name: root.rootStore.chatsModelInst.channelView.activeChannel.name, type: RecipientSelector.Type.Contact, ensVerified: true } @@ -325,14 +334,15 @@ Item { } } - Connections { - target: root.rootStore.chatsModelInst.channelView - onActiveChannelChanged: { - root.rootStore.chatsModelInst.messageView.hideLoadingIndicator() - SelectedMessage.reset(); - chatColumn.isReply = false; - } - } + // Not Refactored Yet +// Connections { +// target: root.rootStore.chatsModelInst.channelView +// onActiveChannelChanged: { +// root.rootStore.chatsModelInst.messageView.hideLoadingIndicator() +// SelectedMessage.reset(); +// chatColumn.isReply = false; +// } +// } Connections { target: systemTray @@ -352,96 +362,98 @@ Item { } } - Connections { - target: root.rootStore.chatsModelInst.messageView + // Not Refactored Yet +// Connections { +// target: root.rootStore.chatsModelInst.messageView - onSearchedMessageLoaded: { - positionAtMessage(messageId, true); - } +// onSearchedMessageLoaded: { +// positionAtMessage(messageId, true); +// } - onMessageNotificationPushed: function(messageId, communityId, chatId, msg, contentType, chatType, timestamp, identicon, username, hasMention, isAddedContact, channelName) { - if (localAccountSensitiveSettings.notificationSetting == Constants.notifyAllMessages || - (localAccountSensitiveSettings.notificationSetting == Constants.notifyJustMentions && hasMention)) { - if (chatId === root.rootStore.chatsModelInst.channelView.activeChannel.id && applicationWindow.active === true) { - // Do not show the notif if we are in the channel already and the window is active and focused - return - } +// onMessageNotificationPushed: function(messageId, communityId, chatId, msg, contentType, chatType, timestamp, identicon, username, hasMention, isAddedContact, channelName) { +// if (localAccountSensitiveSettings.notificationSetting == Constants.notifyAllMessages || +// (localAccountSensitiveSettings.notificationSetting == Constants.notifyJustMentions && hasMention)) { +// if (chatId === root.rootStore.chatsModelInst.channelView.activeChannel.id && applicationWindow.active === true) { +// // Do not show the notif if we are in the channel already and the window is active and focused +// return +// } - root.currentNotificationChatId = chatId - root.currentNotificationCommunityId = null +// root.currentNotificationChatId = chatId +// root.currentNotificationCommunityId = null - let name; - if (localAccountSensitiveSettings.notificationMessagePreviewSetting === Constants.notificationPreviewAnonymous) { - name = "Status" - } else if (chatType === Constants.chatType.publicChat) { - name = chatId - } else { - name = chatType === Constants.chatType.privateGroupChat ? Utils.filterXSS(channelName) : Utils.removeStatusEns(username) - } +// let name; +// if (localAccountSensitiveSettings.notificationMessagePreviewSetting === Constants.notificationPreviewAnonymous) { +// name = "Status" +// } else if (chatType === Constants.chatType.publicChat) { +// name = chatId +// } else { +// name = chatType === Constants.chatType.privateGroupChat ? Utils.filterXSS(channelName) : Utils.removeStatusEns(username) +// } - let message; - if (localAccountSensitiveSettings.notificationMessagePreviewSetting > Constants.notificationPreviewNameOnly) { - switch(contentType){ - //% "Image" - case Constants.messageContentType.imageType: message = qsTrId("image"); break - //% "Sticker" - case Constants.messageContentType.stickerType: message = qsTrId("sticker"); break - default: message = msg // don't parse emojis here as it emits HTML - } - } else { - //% "You have a new message" - message = qsTrId("you-have-a-new-message") - } +// let message; +// if (localAccountSensitiveSettings.notificationMessagePreviewSetting > Constants.notificationPreviewNameOnly) { +// switch(contentType){ +// //% "Image" +// case Constants.messageContentType.imageType: message = qsTrId("image"); break +// //% "Sticker" +// case Constants.messageContentType.stickerType: message = qsTrId("sticker"); break +// default: message = msg // don't parse emojis here as it emits HTML +// } +// } else { +// //% "You have a new message" +// message = qsTrId("you-have-a-new-message") +// } - currentlyHasANotification = true +// currentlyHasANotification = true - if (Qt.platform.os === "linux") { - // Linux Notifications are not implemented in Nim/C++ yet - return systemTray.showMessage(name, message, systemTray.icon.source, 4000) - } +// if (Qt.platform.os === "linux") { +// // Linux Notifications are not implemented in Nim/C++ yet +// return systemTray.showMessage(name, message, systemTray.icon.source, 4000) +// } - // Note: - // Show notification should be moved to the nim side. - // Left here only cause we don't have a way to deal with translations on the nim side. - root.rootStore.chatsModelInst.showOSNotification(name, - message, - Constants.osNotificationType.newMessage, - communityId, - chatId, - messageId, - localAccountSensitiveSettings.useOSNotifications) - } - } - } +// // Note: +// // Show notification should be moved to the nim side. +// // Left here only cause we don't have a way to deal with translations on the nim side. +// root.rootStore.chatsModelInst.showOSNotification(name, +// message, +// Constants.osNotificationType.newMessage, +// communityId, +// chatId, +// messageId, +// localAccountSensitiveSettings.useOSNotifications) +// } +// } +// } - Connections { - target: root.rootStore.chatsModelInst.stickers - onTransactionWasSent: { - //% "Transaction pending..." - toastMessage.title = qsTr("Transaction pending...") - toastMessage.source = Style.svg("loading") - toastMessage.iconColor = Style.current.primary - toastMessage.iconRotates = true - toastMessage.link = `${walletModel.utilsView.etherscanLink}/${txResult}` - toastMessage.open() - } - onTransactionCompleted: { - toastMessage.title = !success ? - //% "Could not buy Stickerpack" - qsTrId("could-not-buy-stickerpack") - : - //% "Stickerpack bought successfully" - qsTrId("stickerpack-bought-successfully"); - if (success) { - toastMessage.source = Style.svg("check-circle") - toastMessage.iconColor = Style.current.success - } else { - toastMessage.source = Style.svg("block-icon") - toastMessage.iconColor = Style.current.danger - } + // Not Refactored Yet +// Connections { +// target: root.rootStore.chatsModelInst.stickers +// onTransactionWasSent: { +// //% "Transaction pending..." +// toastMessage.title = qsTr("Transaction pending...") +// toastMessage.source = Style.svg("loading") +// toastMessage.iconColor = Style.current.primary +// toastMessage.iconRotates = true +// toastMessage.link = `${walletModel.utilsView.etherscanLink}/${txResult}` +// toastMessage.open() +// } +// onTransactionCompleted: { +// toastMessage.title = !success ? +// //% "Could not buy Stickerpack" +// qsTrId("could-not-buy-stickerpack") +// : +// //% "Stickerpack bought successfully" +// qsTrId("stickerpack-bought-successfully"); +// if (success) { +// toastMessage.source = Style.svg("check-circle") +// toastMessage.iconColor = Style.current.success +// } else { +// toastMessage.source = Style.svg("block-icon") +// toastMessage.iconColor = Style.current.danger +// } - toastMessage.link = `${walletModel.utilsView.etherscanLink}/${txHash}` - toastMessage.open() - } - } +// toastMessage.link = `${walletModel.utilsView.etherscanLink}/${txHash}` +// toastMessage.open() +// } +// } } diff --git a/ui/app/AppLayouts/Chat/views/ChatContentView.qml b/ui/app/AppLayouts/Chat/views/ChatContentView.qml index 1733811fc..bc30350ce 100644 --- a/ui/app/AppLayouts/Chat/views/ChatContentView.qml +++ b/ui/app/AppLayouts/Chat/views/ChatContentView.qml @@ -257,7 +257,7 @@ ColumnLayout { anchors.bottom: parent.bottom recentStickers: root.rootStore.stickersModuleInst.recent stickerPackList: root.rootStore.stickersModuleInst.stickerPacks - chatType: root.rootStore.chatsModelInst.channelView.activeChannel.chatType +// chatType: root.rootStore.chatsModelInst.channelView.activeChannel.chatType onSendTransactionCommandButtonClicked: { // Not Refactored Yet // if (root.rootStore.chatsModelInst.channelView.activeChannel.ensVerified) { diff --git a/ui/app/AppLayouts/Chat/views/ChatContextMenuView.qml b/ui/app/AppLayouts/Chat/views/ChatContextMenuView.qml index 4661ed1c9..083f3de81 100644 --- a/ui/app/AppLayouts/Chat/views/ChatContextMenuView.qml +++ b/ui/app/AppLayouts/Chat/views/ChatContextMenuView.qml @@ -135,8 +135,9 @@ StatusPopupMenu { //% "Edit Channel" text: qsTrId("edit-channel") icon.name: "edit" - enabled: communityActive && - root.store.chatsModelInst.communities.activeCommunity.admin + // Not Refactored Yet +// enabled: communityActive && +// root.store.chatsModelInst.communities.activeCommunity.admin // Not Refactored Yet // onTriggered: Global.openPopup(editChannelPopup, { // store: root.store, diff --git a/ui/app/AppLayouts/Chat/views/ChatTextView.qml b/ui/app/AppLayouts/Chat/views/ChatTextView.qml index 8a967641a..d2e6260e9 100644 --- a/ui/app/AppLayouts/Chat/views/ChatTextView.qml +++ b/ui/app/AppLayouts/Chat/views/ChatTextView.qml @@ -12,8 +12,9 @@ Item { property var store property var messageStore property bool longChatText: true - property bool veryLongChatText: !!root.store ? root.store.chatsModelInst.plainText(message).length > - Constants.limitLongChatTextCompactMode : false + // Not Refactored Yet + property bool veryLongChatText: false // !!root.store ? root.store.chatsModelInst.plainText(message).length > + //Constants.limitLongChatTextCompactMode : false property bool readMore: false property alias textField: chatText @@ -53,59 +54,60 @@ Item { clip: height < implicitHeight onLinkActivated: { - root.linkActivated(link) - if(link.startsWith("#")) { - const channelName = link.substring(1); - const foundChannelObj = root.store.chatsModelInst.getChannel(channelName); + // Not Refactored Yet +// root.linkActivated(link) +// if(link.startsWith("#")) { +// const channelName = link.substring(1); +// const foundChannelObj = root.store.chatsModelInst.getChannel(channelName); - if (!foundChannelObj) - { - // Not Refactored Yet -// root.store.chatsModelInst.channelView.joinPublicChat(channelName) -// if(root.store.chatsModelInst.communities.activeCommunity.active) -// { -// root.store.chatsModelInst.channelView.joinPublicChat(channelName) -// Global.changeAppSectionBySectionType(Constants.appSection.chat) -// } - return - } +// if (!foundChannelObj) +// { +// // Not Refactored Yet +//// root.store.chatsModelInst.channelView.joinPublicChat(channelName) +//// if(root.store.chatsModelInst.communities.activeCommunity.active) +//// { +//// root.store.chatsModelInst.channelView.joinPublicChat(channelName) +//// Global.changeAppSectionBySectionType(Constants.appSection.chat) +//// } +// return +// } - let obj = JSON.parse(foundChannelObj) +// let obj = JSON.parse(foundChannelObj) - if(obj.chatType === -1 || obj.chatType === Constants.chatType.publicChat) - { - // Not Refactored Yet -// if(root.store.chatsModelInst.communities.activeCommunity.active) { -// root.store.chatsModelInst.channelView.joinPublicChat(channelName) -// Global.changeAppSectionBySectionType(Constants.appSection.chat) -// } +// if(obj.chatType === -1 || obj.chatType === Constants.chatType.publicChat) +// { +// // Not Refactored Yet +//// if(root.store.chatsModelInst.communities.activeCommunity.active) { +//// root.store.chatsModelInst.channelView.joinPublicChat(channelName) +//// Global.changeAppSectionBySectionType(Constants.appSection.chat) +//// } +//// root.store.chatsModelInst.channelView.setActiveChannel(channelName); +// } +// else if(obj.communityId === root.store.chatsModelInst.communities.activeCommunity.id && +// obj.chatType === Constants.chatType.communityChat && +// root.store.chatsModelInst.channelView.activeChannel.id !== obj.id +// ) +// { // root.store.chatsModelInst.channelView.setActiveChannel(channelName); - } - else if(obj.communityId === root.store.chatsModelInst.communities.activeCommunity.id && - obj.chatType === Constants.chatType.communityChat && - root.store.chatsModelInst.channelView.activeChannel.id !== obj.id - ) - { - root.store.chatsModelInst.channelView.setActiveChannel(channelName); - } +// } - return - } +// return +// } - if (link.startsWith('//')) { - let pk = link.replace("//", ""); - const userProfileImage = appMain.getProfileImage(pk) - openProfilePopup(root.store.userNameOrAlias(pk), pk, userProfileImage || root.store.generateIdenticon(pk)) - return; - } +// if (link.startsWith('//')) { +// let pk = link.replace("//", ""); +// const userProfileImage = appMain.getProfileImage(pk) +// openProfilePopup(root.store.userNameOrAlias(pk), pk, userProfileImage || root.store.generateIdenticon(pk)) +// return; +// } - const data = Utils.getLinkDataForStatusLinks(link) - if (data && data.callback) { - return data.callback() - } +// const data = Utils.getLinkDataForStatusLinks(link) +// if (data && data.callback) { +// return data.callback() +// } - Global.openLink(link) +// Global.openLink(link) } onLinkHovered: { diff --git a/ui/app/AppLayouts/Chat/views/CommunityColumnView.qml b/ui/app/AppLayouts/Chat/views/CommunityColumnView.qml index 2b613fbfa..fcd861144 100644 --- a/ui/app/AppLayouts/Chat/views/CommunityColumnView.qml +++ b/ui/app/AppLayouts/Chat/views/CommunityColumnView.qml @@ -56,16 +56,18 @@ Item { //% "Create channel" text: qsTrId("create-channel") icon.name: "channel" + // Not Refactored Yet //enabled: root.store.chatsModelInst.communities.activeCommunity.admin - onTriggered: Global.openPopup(createChannelPopup, {communityId: chatsModel.communities.activeCommunity.id}) +// onTriggered: Global.openPopup(createChannelPopup, {communityId: chatsModel.communities.activeCommunity.id}) } StatusMenuItem { //% "Create category" text: qsTrId("create-category") icon.name: "channel-category" + // Not Refactored Yet //enabled: root.store.chatsModelInst.communities.activeCommunity.admin - onTriggered: Global.openPopup(createCategoryPopup, {communityId: chatsModel.communities.activeCommunity.id}) +// onTriggered: Global.openPopup(createCategoryPopup, {communityId: chatsModel.communities.activeCommunity.id}) } StatusMenuSeparator {} @@ -74,10 +76,11 @@ Item { //% "Invite people" text: qsTrId("invite-people") icon.name: "share-ios" + // Not Refactored Yet //enabled: root.store.chatsModelInst.communities.activeCommunity.canManageUsers - onTriggered: Global.openPopup(inviteFriendsToCommunityPopup, { - community: root.store.chatsModelInst.communities.activeCommunity - }) +// onTriggered: Global.openPopup(inviteFriendsToCommunityPopup, { +// community: root.store.chatsModelInst.communities.activeCommunity +// }) } } } @@ -174,8 +177,9 @@ Item { //% "Create channel" text: qsTrId("create-channel") icon.name: "channel" - enabled: chatsModel.communities.activeCommunity.admin - onTriggered: Global.openPopup(createChannelPopup, {communityId: root.store.chatsModelInst.communities.activeCommunity.id}) + // Not Refactored Yet +// enabled: chatsModel.communities.activeCommunity.admin +// onTriggered: Global.openPopup(createChannelPopup, {communityId: root.store.chatsModelInst.communities.activeCommunity.id}) } StatusMenuItem { @@ -185,7 +189,7 @@ Item { // Not Refactored Yet enabled: false //enabled: root.store.chatsModelInst.communities.activeCommunity.admin - onTriggered: Global.openPopup(createCategoryPopup, {communityId: root.store.chatsModelInst.communities.activeCommunity.id}) +// onTriggered: Global.openPopup(createCategoryPopup, {communityId: root.store.chatsModelInst.communities.activeCommunity.id}) } StatusMenuSeparator {} @@ -197,9 +201,9 @@ Item { // Not Refactored Yet enabled: false //enabled: root.store.chatsModelInst.communities.activeCommunity.canManageUsers - onTriggered: Global.openPopup(inviteFriendsToCommunityPopup, { - community: root.store.chatsModelInst.communities.activeCommunity - }) +// onTriggered: Global.openPopup(inviteFriendsToCommunityPopup, { +// community: root.store.chatsModelInst.communities.activeCommunity +// }) } } @@ -208,7 +212,8 @@ Item { property var categoryItem openHandler: function (id) { - categoryItem = root.store.chatsModelInst.communities.activeCommunity.getCommunityCategoryItemById(id) + // Not Refactored Yet +// categoryItem = root.store.chatsModelInst.communities.activeCommunity.getCommunityCategoryItemById(id) } StatusMenuItem { @@ -219,12 +224,13 @@ Item { text: qsTrId("edit-category") icon.name: "edit" onTriggered: { - Global.openPopup(createCategoryPopup, { - communityId: root.store.chatsModelInst.communities.activeCommunity.id, - isEdit: true, - categoryId: categoryItem.id, - categoryName: categoryItem.name - }) + // Not Refactored Yet +// Global.openPopup(createCategoryPopup, { +// communityId: root.store.chatsModelInst.communities.activeCommunity.id, +// isEdit: true, +// categoryId: categoryItem.id, +// categoryName: categoryItem.name +// }) } } @@ -297,9 +303,10 @@ Item { Loader { id: emptyViewAndSuggestionsLoader - active: root.store.chatsModelInst.communities.activeCommunity.admin && - (!localAccountSensitiveSettings.hiddenCommunityWelcomeBanners || - !localAccountSensitiveSettings.hiddenCommunityWelcomeBanners.includes(root.store.chatsModelInst.communities.activeCommunity.id)) + // Not Refactored Yet +// active: root.store.chatsModelInst.communities.activeCommunity.admin && +// (!localAccountSensitiveSettings.hiddenCommunityWelcomeBanners || +// !localAccountSensitiveSettings.hiddenCommunityWelcomeBanners.includes(root.store.chatsModelInst.communities.activeCommunity.id)) width: parent.width height: active ? item.height : 0 anchors.top: communityChatListAndCategories.bottom @@ -314,9 +321,10 @@ Item { Loader { id: backUpBannerLoader - active: root.store.chatsModelInst.communities.activeCommunity.admin && - (!localAccountSensitiveSettings.hiddenCommunityBackUpBanners || - !localAccountSensitiveSettings.hiddenCommunityBackUpBanners.includes(root.store.chatsModelInst.communities.activeCommunity.id)) + // Not Refactored Yet +// active: root.store.chatsModelInst.communities.activeCommunity.admin && +// (!localAccountSensitiveSettings.hiddenCommunityBackUpBanners || +// !localAccountSensitiveSettings.hiddenCommunityBackUpBanners.includes(root.store.chatsModelInst.communities.activeCommunity.id)) width: parent.width height: active ? item.height : 0 anchors.top: emptyViewAndSuggestionsLoader.bottom @@ -386,12 +394,13 @@ Item { close(); } onConfirmButtonClicked: function(){ - const error = root.store.chatsModelInst.communities.deleteCommunityCategory(root.store.chatsModelInst.communities.activeCommunity.id, categoryId) - if (error) { - creatingError.text = error - return creatingError.open() - } - close(); + // Not Refactored Yet +// const error = root.store.chatsModelInst.communities.deleteCommunityCategory(root.store.chatsModelInst.communities.activeCommunity.id, categoryId) +// if (error) { +// creatingError.text = error +// return creatingError.open() +// } +// close(); } } } diff --git a/ui/app/AppLayouts/Chat/views/ContactsColumnView.qml b/ui/app/AppLayouts/Chat/views/ContactsColumnView.qml index dd8214ee9..adb9a8918 100644 --- a/ui/app/AppLayouts/Chat/views/ContactsColumnView.qml +++ b/ui/app/AppLayouts/Chat/views/ContactsColumnView.qml @@ -350,13 +350,14 @@ Item { id: communitiesPopupComponent CommunitiesPopup { anchors.centerIn: parent - communitiesList: root.store.chatsModelInst.communities.list - onSetActiveCommunity: { - root.store.chatsModelInst.communities.setActiveCommunity(id) - } - onSetObservedCommunity: { - root.store.chatsModelInst.communities.setObservedCommunity(id) - } + // Not Refactored Yet +// communitiesList: root.store.chatsModelInst.communities.list +// onSetActiveCommunity: { +// root.store.chatsModelInst.communities.setActiveCommunity(id) +// } +// onSetObservedCommunity: { +// root.store.chatsModelInst.communities.setObservedCommunity(id) +// } onClosed: { destroy() } @@ -378,7 +379,8 @@ Item { id: importCommunitiesPopupComponent AccessExistingCommunityPopup { anchors.centerIn: parent - store: root.store + // Not Refactored Yet +// error: root.store.chatsModelInst.communities.importCommunity(communityKey, Utils.uuid()) onClosed: { destroy() } @@ -406,51 +408,52 @@ Item { } } - Connections { - target: root.store.chatsModelInst.communities - onImportingCommunityStateChanged: { - if (state !== Constants.communityImported && - state !== Constants.communityImportingInProgress && - state !== Constants.communityImportingError) - { - return - } + // Not Refactored Yet +// Connections { +// target: root.store.chatsModelInst.communities +// onImportingCommunityStateChanged: { +// if (state !== Constants.communityImported && +// state !== Constants.communityImportingInProgress && +// state !== Constants.communityImportingError) +// { +// return +// } - if (state === Constants.communityImported) - { - if (toastMessage.uuid !== communityImportingProcessId) - return +// if (state === Constants.communityImported) +// { +// if (toastMessage.uuid !== communityImportingProcessId) +// return - toastMessage.close() +// toastMessage.close() - //% "Community imported" - toastMessage.title = qsTrId("community-imported") - toastMessage.source = "" - toastMessage.iconRotates = false - toastMessage.dissapearInMs = 4000 - } - else if (state === Constants.communityImportingInProgress) - { - toastMessage.uuid = communityImportingProcessId - //% "Importing community is in progress" - toastMessage.title = qsTrId("importing-community-is-in-progress") - toastMessage.source = Style.svg("loading") - toastMessage.iconRotates = true - toastMessage.dissapearInMs = -1 - } - else if (state === Constants.communityImportingError) - { - if (toastMessage.uuid !== communityImportingProcessId) - return +// //% "Community imported" +// toastMessage.title = qsTrId("community-imported") +// toastMessage.source = "" +// toastMessage.iconRotates = false +// toastMessage.dissapearInMs = 4000 +// } +// else if (state === Constants.communityImportingInProgress) +// { +// toastMessage.uuid = communityImportingProcessId +// //% "Importing community is in progress" +// toastMessage.title = qsTrId("importing-community-is-in-progress") +// toastMessage.source = Style.svg("loading") +// toastMessage.iconRotates = true +// toastMessage.dissapearInMs = -1 +// } +// else if (state === Constants.communityImportingError) +// { +// if (toastMessage.uuid !== communityImportingProcessId) +// return - toastMessage.close() - return - } +// toastMessage.close() +// return +// } - toastMessage.displayCloseButton = false - toastMessage.displayLink = false - toastMessage.iconColor = Style.current.primary - toastMessage.open() - } - } +// toastMessage.displayCloseButton = false +// toastMessage.displayLink = false +// toastMessage.iconColor = Style.current.primary +// toastMessage.open() +// } +// } } diff --git a/ui/app/AppLayouts/Node/NodeLayout.qml b/ui/app/AppLayouts/Node/NodeLayout.qml index aade9a247..379badfe5 100644 --- a/ui/app/AppLayouts/Node/NodeLayout.qml +++ b/ui/app/AppLayouts/Node/NodeLayout.qml @@ -43,7 +43,8 @@ Item { StatusBaseText { id: peerNumber color: Theme.palette.primaryColor1 - text: root.store.nodeModelInst.peerSize + // Not Refactored Yet +// text: root.store.nodeModelInst.peerSize Layout.rightMargin: Style.current.padding Layout.leftMargin: Style.current.padding Layout.fillWidth: true @@ -67,7 +68,8 @@ Item { StatusBaseText { id: bloomPerc color: Theme.palette.primaryColor1 - text: ((root.store.nodeModelInst.bloomBits / 512) * 100).toFixed(2) + "%" + // Not Refactored Yet +// text: ((root.store.nodeModelInst.bloomBits / 512) * 100).toFixed(2) + "%" Layout.rightMargin: Style.current.padding Layout.leftMargin: Style.current.padding Layout.fillWidth: true @@ -119,27 +121,28 @@ Item { } } - Connections { - target: root.store.nodeModelInst - function onLog(logContent) { - // TODO: this is ugly, but there's not even a design for this section - if(logContent.indexOf("mailserver") > 0){ - let lines = mailserverLogTxt.text.split("\n"); - if (lines.length > 10){ - lines.shift(); - } - lines.push(logContent.trim()) - mailserverLogTxt.text = lines.join("\n") - } else { - let lines = logsTxt.text.split("\n"); - if (lines.length > 5){ - lines.shift(); - } - lines.push(logContent.trim()) - logsTxt.text = lines.join("\n") - } - } - } + // Not Refactored Yet +// Connections { +// target: root.store.nodeModelInst +// function onLog(logContent) { +// // TODO: this is ugly, but there's not even a design for this section +// if(logContent.indexOf("mailserver") > 0){ +// let lines = mailserverLogTxt.text.split("\n"); +// if (lines.length > 10){ +// lines.shift(); +// } +// lines.push(logContent.trim()) +// mailserverLogTxt.text = lines.join("\n") +// } else { +// let lines = logsTxt.text.split("\n"); +// if (lines.length > 5){ +// lines.shift(); +// } +// lines.push(logContent.trim()) +// logsTxt.text = lines.join("\n") +// } +// } +// } ColumnLayout { id: messageContainer @@ -157,7 +160,8 @@ Item { StatusBaseText { id: test color: Theme.palette.primaryColor1 - text: root.store.nodeModelInst.lastMessage + // Not Refactored Yet +// text: root.store.nodeModelInst.lastMessage Layout.rightMargin: Style.current.padding Layout.leftMargin: Style.current.padding Layout.fillWidth: true @@ -172,7 +176,8 @@ Item { Layout.rightMargin: Style.current.padding Layout.leftMargin: Style.current.padding // TODO: replace with StatusTextArea once it lives in StatusQ. - TextArea { id: callResult; Layout.fillWidth: true; text: nodeModel.callResult; readOnly: true } + // Not Refactored Yet +// TextArea { id: callResult; Layout.fillWidth: true; text: nodeModel.callResult; readOnly: true } } RowLayout { @@ -208,7 +213,8 @@ Item { anchors.right: parent.right anchors.rightMargin: 16 onClicked: { - nodeModel.onSend(txtData.text) + // Not Refactored Yet +// nodeModel.onSend(txtData.text) txtData.text = "" } enabled: txtData.text !== "" diff --git a/ui/app/AppLayouts/Node/stores/RootStore.qml b/ui/app/AppLayouts/Node/stores/RootStore.qml index cf8c5e30b..5505868c0 100644 --- a/ui/app/AppLayouts/Node/stores/RootStore.qml +++ b/ui/app/AppLayouts/Node/stores/RootStore.qml @@ -5,15 +5,18 @@ import utils 1.0 QtObject { id: root - property var nodeModelInst: nodeModel - property var profileModelInst: profileModel +// property var nodeModelInst: nodeModel +// property var profileModelInst: profileModel function getMailserverName(activeMailServer) { - return profileModelInst.mailservers.list.getMailserverName(activeMailServer) + // Not Refactored Yet + return "" +// return profileModelInst.mailservers.list.getMailserverName(activeMailServer) } function onSend(text) { - nodeModelInst.onSend(text) + // Not Refactored Yet +// nodeModelInst.onSend(text) } } diff --git a/ui/app/AppLayouts/Node/views/RateView.qml b/ui/app/AppLayouts/Node/views/RateView.qml index 6d0f9b9d7..94c337636 100644 --- a/ui/app/AppLayouts/Node/views/RateView.qml +++ b/ui/app/AppLayouts/Node/views/RateView.qml @@ -33,7 +33,8 @@ Column { // TODO: replace with StatusInput from StatusQ at some point Input { id: uploadRate - text: Math.round(parseInt(nodeModel.uploadRate, 10) / 1024 * 100) / 100 + // Not Refactored Yet +// text: Math.round(parseInt(nodeModel.uploadRate, 10) / 1024 * 100) / 100 width: parent.width readOnly: true customHeight: 44 @@ -63,7 +64,8 @@ Column { // TODO: replace with StatusInput from StatusQ at some point Input { id: downloadRate - text: Math.round(parseInt(nodeModel.downloadRate, 10) / 1024 * 100) / 100 + // Not Refactored Yet +// text: Math.round(parseInt(nodeModel.downloadRate, 10) / 1024 * 100) / 100 width: parent.width readOnly: true customHeight: 44 diff --git a/ui/app/AppLayouts/Onboarding/stores/KeycardStore.qml b/ui/app/AppLayouts/Onboarding/stores/KeycardStore.qml index 3190f2212..ea7a1270c 100644 --- a/ui/app/AppLayouts/Onboarding/stores/KeycardStore.qml +++ b/ui/app/AppLayouts/Onboarding/stores/KeycardStore.qml @@ -3,17 +3,18 @@ pragma Singleton import QtQuick 2.13 QtObject { - property var keycardModelInst: keycardModel + // Not Refactored Yet +// property var keycardModelInst: keycardModel function startConnection() { - keycardModel.startConnection() +// keycardModel.startConnection() } function init(pin) { - keycardModel.init(pin) +// keycardModel.init(pin) } function recoverAccount() { - keycardModel.recoverAccount() +// keycardModel.recoverAccount() } } diff --git a/ui/app/AppLayouts/Onboarding/views/KeycardFlowSelectionView.qml b/ui/app/AppLayouts/Onboarding/views/KeycardFlowSelectionView.qml index 0a55dfff1..1d144c2c9 100644 --- a/ui/app/AppLayouts/Onboarding/views/KeycardFlowSelectionView.qml +++ b/ui/app/AppLayouts/Onboarding/views/KeycardFlowSelectionView.qml @@ -56,59 +56,60 @@ Item { } } - Connections { - id: connection - target: OnboardingStore.keycardModelInst - ignoreUnknownSignals: true + // Not Refactored Yet +// Connections { +// id: connection +// target: OnboardingStore.keycardModelInst +// ignoreUnknownSignals: true - onCardUnpaired: { - pairingModal.open() - } +// onCardUnpaired: { +// pairingModal.open() +// } - onCardPaired: { - pinModal.open() - } +// onCardPaired: { +// pinModal.open() +// } - onCardAuthenticated: { - switch (flow) { - case OnboardingFlow.Recover: { - KeycardStore.recoverAccount(); - break; - } - case OnboardingFlow.Generate: { - break; - } - case OnboardingFlow.ImportMnemonic: { - break; - } - } - } +// onCardAuthenticated: { +// switch (flow) { +// case OnboardingFlow.Recover: { +// KeycardStore.recoverAccount(); +// break; +// } +// case OnboardingFlow.Generate: { +// break; +// } +// case OnboardingFlow.ImportMnemonic: { +// break; +// } +// } +// } - //TODO: support the states below +// //TODO: support the states below - onCardPreInit: { - createPinModal.open() - } +// onCardPreInit: { +// createPinModal.open() +// } - onCardFrozen: { - keycardView.onClosed() +// onCardFrozen: { +// keycardView.onClosed() - } +// } - onCardBlocked: { - keycardView.onClosed() - } +// onCardBlocked: { +// keycardView.onClosed() +// } - // TODO: handle these by showing an error an prompting for another card - // later add factory reset option for the NoFreeSlots case +// // TODO: handle these by showing an error an prompting for another card +// // later add factory reset option for the NoFreeSlots case - onCardNoFreeSlots: { - keycardView.onClosed() - } +// onCardNoFreeSlots: { +// keycardView.onClosed() +// } - onCardNotKeycard: { - keycardView.onClosed() - } +// onCardNotKeycard: { +// keycardView.onClosed() +// } - } +// } } diff --git a/ui/app/AppLayouts/Profile/controls/FleetRadioSelector.qml b/ui/app/AppLayouts/Profile/controls/FleetRadioSelector.qml index 05c360bc7..4460e8d0b 100644 --- a/ui/app/AppLayouts/Profile/controls/FleetRadioSelector.qml +++ b/ui/app/AppLayouts/Profile/controls/FleetRadioSelector.qml @@ -13,14 +13,16 @@ RadioButtonSelector { property string newFleet: "" title: fleetName - checked: profileModel.fleets.fleet === root.fleetName + // Not Refactored Yet +// checked: profileModel.fleets.fleet === root.fleetName onCheckedChanged: { - if (checked) { - if (profileModel.fleets.fleet === root.fleetName) return; - root.newFleet = root.fleetName; - Global.openPopup(confirmDialogComponent) - } + // Not Refactored Yet +// if (checked) { +// if (profileModel.fleets.fleet === root.fleetName) return; +// root.newFleet = root.fleetName; +// Global.openPopup(confirmDialogComponent) +// } } Component { @@ -30,9 +32,11 @@ RadioButtonSelector { header.title: qsTrId("close-app-title") //% "Change fleet to %1" confirmationText: qsTrId("change-fleet-to--1").arg(root.newFleet) - onConfirmButtonClicked: profileModel.fleets.setFleet(root.newFleet) + // Not Refactored Yet +// onConfirmButtonClicked: profileModel.fleets.setFleet(root.newFleet) onClosed: { - profileModel.fleets.triggerFleetChange() + // Not Refactored Yet +// profileModel.fleets.triggerFleetChange() destroy(); } } diff --git a/ui/app/AppLayouts/Profile/controls/NetworkRadioSelector.qml b/ui/app/AppLayouts/Profile/controls/NetworkRadioSelector.qml index e39c25452..036835c25 100644 --- a/ui/app/AppLayouts/Profile/controls/NetworkRadioSelector.qml +++ b/ui/app/AppLayouts/Profile/controls/NetworkRadioSelector.qml @@ -18,9 +18,10 @@ RadioButtonSelector { onCheckedChanged: { if (checked) { - if (profileModel.network.current === root.network) return; - root.newNetwork = root.network; - Global.openPopup(confirmDialogComponent) + // Not Refactored Yet +// if (profileModel.network.current === root.network) return; +// root.newNetwork = root.network; +// Global.openPopup(confirmDialogComponent) } } @@ -33,10 +34,12 @@ RadioButtonSelector { //% "The account will be logged out. When you unlock it again, the selected network will be used" confirmationText: qsTrId("logout-app-content") onConfirmButtonClicked: { - profileModel.network.current = root.newNetwork; + // Not Refactored Yet +// profileModel.network.current = root.newNetwork; } onClosed: { - profileModel.network.triggerNetworkChange() + // Not Refactored Yet +// profileModel.network.triggerNetworkChange() destroy() } } diff --git a/ui/app/AppLayouts/Profile/popups/ENSPopup.qml b/ui/app/AppLayouts/Profile/popups/ENSPopup.qml index a6d15efaa..9fe42e4ab 100644 --- a/ui/app/AppLayouts/Profile/popups/ENSPopup.qml +++ b/ui/app/AppLayouts/Profile/popups/ENSPopup.qml @@ -19,18 +19,20 @@ ModalPopup { onOpened: { for(var i in ensNames.contentItem.children){ - ensNames.contentItem.children[i].checked = ensNames.contentItem.children[i].text === profileModel.ens.preferredUsername + // Not Refactored Yet +// ensNames.contentItem.children[i].checked = ensNames.contentItem.children[i].text === profileModel.ens.preferredUsername } } StyledText { id: lbl1 - text: profileModel.ens.preferredUsername ? - //% "Your messages are displayed to others with this username:" - qsTrId("your-messages-are-displayed-to-others-with-this-username-") - : - //% "Once you select a username, you won’t be able to disable it afterwards. You will only be able choose a different username to display." - qsTrId("once-you-select-a-username--you-won-t-be-able-to-disable-it-afterwards--you-will-only-be-able-choose-a-different-username-to-display-") + // Not Refactored Yet +// text: profileModel.ens.preferredUsername ? +// //% "Your messages are displayed to others with this username:" +// qsTrId("your-messages-are-displayed-to-others-with-this-username-") +// : +// //% "Once you select a username, you won’t be able to disable it afterwards. You will only be able choose a different username to display." +// qsTrId("once-you-select-a-username--you-won-t-be-able-to-disable-it-afterwards--you-will-only-be-able-choose-a-different-username-to-display-") font.pixelSize: 15 wrapMode: Text.WordWrap width: parent.width @@ -40,7 +42,8 @@ ModalPopup { id: lbl2 anchors.top: lbl1.bottom anchors.topMargin: Style.current.padding - text: profileModel.ens.preferredUsername + // Not Refactored Yet +// text: profileModel.ens.preferredUsername font.pixelSize: 17 font.weight: Font.Bold } @@ -57,14 +60,16 @@ ModalPopup { ListView { anchors.fill: parent - model: profileModel.ens + // Not Refactored Yet +// model: profileModel.ens spacing: 0 clip: true id: ensNames delegate: RadioDelegate { id: radioDelegate text: username - checked: profileModel.ens.preferredUsername === username + // Not Refactored Yet +// checked: profileModel.ens.preferredUsername === username contentItem: StyledText { color: Style.current.textColor @@ -85,7 +90,8 @@ ModalPopup { } onNewUsernameChanged: { - btnSelectPreferred.state = newUsername === profileModel.ens.preferredUsername ? "inactive" : "active" + // Not Refactored Yet +// btnSelectPreferred.state = newUsername === profileModel.ens.preferredUsername ? "inactive" : "active" } footer: Item { @@ -129,9 +135,10 @@ ModalPopup { anchors.fill: parent onClicked : { if(btnSelectPreferred.state === "active"){ - profileModel.ens.preferredUsername = newUsername; - newUsername = ""; - popup.close(); + // Not Refactored Yet +// profileModel.ens.preferredUsername = newUsername; +// newUsername = ""; +// popup.close(); } } } diff --git a/ui/app/AppLayouts/Profile/popups/MutedChatsModal.qml b/ui/app/AppLayouts/Profile/popups/MutedChatsModal.qml index 62170fbca..d2861692a 100644 --- a/ui/app/AppLayouts/Profile/popups/MutedChatsModal.qml +++ b/ui/app/AppLayouts/Profile/popups/MutedChatsModal.qml @@ -32,7 +32,8 @@ ModalPopup { visible: true anchors.left: parent.left anchors.right: parent.right - model: root.showMutedContacts ? profileModel.mutedChats.contacts : profileModel.mutedChats.chats + // Not Refactored Yet +// model: root.showMutedContacts ? profileModel.mutedChats.contacts : profileModel.mutedChats.chats delegate: Rectangle { id: channelItem property bool isHovered: false @@ -99,7 +100,8 @@ ModalPopup { channelItem.isHovered = true } onClicked: { - chatsModel.channelView.unmuteChatItem(model.id) + // Not Refactored Yet +// chatsModel.channelView.unmuteChatItem(model.id) } } } diff --git a/ui/app/AppLayouts/Profile/popups/NetworksModal.qml b/ui/app/AppLayouts/Profile/popups/NetworksModal.qml index fa0295559..4a4524bc1 100644 --- a/ui/app/AppLayouts/Profile/popups/NetworksModal.qml +++ b/ui/app/AppLayouts/Profile/popups/NetworksModal.qml @@ -143,14 +143,15 @@ ModalPopup { anchors.rightMargin: -Style.current.padding } - Repeater { - model: profileModel.network.customNetworkList - delegate: NetworkRadioSelector { - networkName: name - network: customNetworkId - buttonGroup: radioGroup - } - } + // Not Refactored Yet +// Repeater { +// model: profileModel.network.customNetworkList +// delegate: NetworkRadioSelector { +// networkName: name +// network: customNetworkId +// buttonGroup: radioGroup +// } +// } } } } diff --git a/ui/app/AppLayouts/Profile/popups/NewCustomNetworkModal.qml b/ui/app/AppLayouts/Profile/popups/NewCustomNetworkModal.qml index 460fa476c..a1cc45c57 100644 --- a/ui/app/AppLayouts/Profile/popups/NewCustomNetworkModal.qml +++ b/ui/app/AppLayouts/Profile/popups/NewCustomNetworkModal.qml @@ -80,8 +80,9 @@ StatusModal { addNetworkPopup.networkId = parseInt(networkInput.text, 10); } - profileModel.network.add(nameInput.text, rpcInput.text, addNetworkPopup.networkId, addNetworkPopup.networkType) - profileModel.network.reloadCustomNetworks(); + // Not Refactored Yet +// profileModel.network.add(nameInput.text, rpcInput.text, addNetworkPopup.networkId, addNetworkPopup.networkType) +// profileModel.network.reloadCustomNetworks(); addNetworkPopup.close() } } diff --git a/ui/app/AppLayouts/Profile/stores/RootStore.qml b/ui/app/AppLayouts/Profile/stores/RootStore.qml index b439d7292..b6949f201 100644 --- a/ui/app/AppLayouts/Profile/stores/RootStore.qml +++ b/ui/app/AppLayouts/Profile/stores/RootStore.qml @@ -4,7 +4,8 @@ import utils 1.0 QtObject { id: root - property var profileModelInst: profileModel + // Not Refactored Yet +// property var profileModelInst: profileModel property var profileModuleInst: profileSectionModule property var profile: profileModule.model property var contactsModuleInst: contactsModule @@ -12,40 +13,55 @@ QtObject { property var languageModuleInst: languageModule property var mnemonicModuleInst: mnemonicModule - property var chatsModelInst: chatsModel - property var utilsModelInst: utilsModel - property var walletModelInst: walletModel - property var nodeModelInst: nodeModel + // Not Refactored Yet +// property var chatsModelInst: chatsModel + // Not Refactored Yet +// property var utilsModelInst: utilsModel + // Not Refactored Yet +// property var walletModelInst: walletModel + // Not Refactored Yet +// property var nodeModelInst: nodeModel - property var ens: profileModelInst.ens + // Not Refactored Yet +// property var ens: profileModelInst.ens property var dappList: dappPermissionsModule.dapps property var permissionList: dappPermissionsModule.permissions - property var mailservers: profileModelInst.mailservers - property var mailserversList: profileModelInst.mailservers.list + // Not Refactored Yet +// property var mailservers: profileModelInst.mailservers +// property var mailserversList: profileModelInst.mailservers.list property var contacts: contactsModuleInst.model.list property var blockedContacts: contactsModuleInst.model.blockedContacts property var addedContacts: contactsModuleInst.model.addedContacts - property var mutedChatsContacts: profileModelInst.mutedChats.contacts - property var mutedChats: profileModelInst.mutedChats.chats - property var devicesList: profileModelInst.devices.list + // Not Refactored Yet +// property var mutedChatsContacts: profileModelInst.mutedChats.contacts +// property var mutedChats: profileModelInst.mutedChats.chats +// property var devicesList: profileModelInst.devices.list - property string ensRegisterAddress: utilsModelInst.ensRegisterAddress - property string etherscanLink: walletModelInst.utilsView.etherscanLink + // Not Refactored Yet + property string ensRegisterAddress: "" //utilsModelInst.ensRegisterAddress + // Not Refactored Yet + property string etherscanLink: "" //walletModelInst.utilsView.etherscanLink property string pubKey: profile.pubKey - property string fleet: profileModelInst.fleets.fleet - property string bloomLevel: nodeModelInst.bloomLevel - property string currentNetwork: profileModelInst.network.current - property string preferredUsername: profileModelInst.ens.preferredUsername - property string firstEnsUsername: profileModelInst.ens.firstEnsUsername + // Not Refactored Yet +// property string fleet: profileModelInst.fleets.fleet + // Not Refactored Yet +// property string bloomLevel: nodeModelInst.bloomLevel + // Not Refactored Yet +// property string currentNetwork: profileModelInst.network.current +// property string preferredUsername: profileModelInst.ens.preferredUsername +// property string firstEnsUsername: profileModelInst.ens.firstEnsUsername property string username: profile.username property string identicon: profile.identicon property string profileLargeImage: profile.largeImage property string profileThumbnailImage: profile.thumbnailImage property bool profileHasIdentityImage: profile.hasIdentityImage - property bool automaticMailserverSelection: profileModelInst.mailservers.automaticSelection - property bool isWakuV2LightClient: nodeModelInst.WakuV2LightClient - property bool devicesSetup: profileModelInst.devices.isSetup + // Not Refactored Yet +// property bool automaticMailserverSelection: profileModelInst.mailservers.automaticSelection + // Not Refactored Yet +// property bool isWakuV2LightClient: nodeModelInst.WakuV2LightClient + // Not Refactored Yet +// property bool devicesSetup: profileModelInst.devices.isSetup property bool mnemonicBackedUp: mnemonicModuleInst.isBackedUp property bool messagesFromContactsOnly: profile.messagesFromContactsOnly @@ -170,11 +186,13 @@ QtObject { } function getQrCodeSource(publicKey) { - return profileModelInst.qrCode(publicKey) + // Not Refactored Yet +// return profileModelInst.qrCode(publicKey) } function copyToClipboard(value) { - chatsModelInst.copyToClipboard(value) + // Not Refactored Yet +// chatsModelInst.copyToClipboard(value) } function uploadImage(source, aX, aY, bX, bY) { @@ -194,7 +212,8 @@ QtObject { } function generateAlias(pubKey) { - return utilsModelInst.generateAlias(pubKey) + // Not Refactored Yet +// return utilsModelInst.generateAlias(pubKey) } function joinPrivateChat(address) { @@ -219,56 +238,74 @@ QtObject { } function ensDetails(username) { - profileModelInst.ens.details(username) + // Not Refactored Yet +// profileModelInst.ens.details(username) } function ensPendingLen() { - return profileModelInst.ens.pendingLen() + // Not Refactored Yet +// return profileModelInst.ens.pendingLen() } function validateEns(ensName, isStatus) { - profileModelInst.ens.validate(ensName, isStatus) + // Not Refactored Yet +// profileModelInst.ens.validate(ensName, isStatus) } function registerEnsGasEstimate(username, address) { - return profileModelInst.ens.registerENSGasEstimate(username, address) + // Not Refactored Yet +// return profileModelInst.ens.registerENSGasEstimate(username, address) } function registerEns(username, address, gasLimit, tipLimit, overallLimit, gasPrice, password) { - return profileModelInst.ens.registerENS(username, - address, gasLimit, gasPrice, tipLimit, overallLimit, password) + // Not Refactored Yet +// return profileModelInst.ens.registerENS(username, +// address, gasLimit, tipLimit, overallLimit, gasPrice, password) } function getEnsUsernameRegistrar() { - return profileModelInst.ens.getUsernameRegistrar() + // Not Refactored Yet +// return profileModelInst.ens.getUsernameRegistrar() + } + + function getEnsRegistry() { + // Not Refactored Yet +// return profileModelInst.ens.getENSRegistry() } function releaseEnsEstimate(username, address) { - return profileModelInst.ens.releaseEstimate(username, address) + // Not Refactored Yet +// return profileModelInst.ens.releaseEstimate(username, address) } function releaseEns(username, address, gasLimit, gasPrice, password) { - return profileModelInst.ens.release(username, address, gasLimit, gasPrice, password) + // Not Refactored Yet +// return profileModelInst.ens.release(username, address, gasLimit, gasPrice, password) } function getGasPrice() { - walletModelInst.gasView.getGasPrice() + // Not Refactored Yet +// walletModelInst.gasView.getGasPrice() } function getGasPricePredictions() { - walletModelInst.gasView.getGasPricePredictions() + // Not Refactored Yet +// walletModelInst.gasView.getGasPricePredictions() } function ensConnectOwnedUsername(name, isStatus) { - profileModelInst.ens.connectOwnedUsername(name, isStatus) + // Not Refactored Yet +// profileModelInst.ens.connectOwnedUsername(name, isStatus) } function getWalletDefaultAddress() { - return walletModelInst.getDefaultAddress() + // Not Refactored Yet +// return walletModelInst.getDefaultAddress() } function getSntBalance() { - return utilsModelInst.getSNTBalance() + // Not Refactored Yet +// return utilsModelInst.getSNTBalance() } function changeLocale(l) { @@ -277,35 +314,43 @@ QtObject { } function getMailserverName(mailserver) { - return profileModelInst.mailservers.list.getMailserverName(mailserver) + // Not Refactored Yet +// return profileModelInst.mailservers.list.getMailserverName(mailserver) } function setMailserver(mailserver) { - profileModelInst.mailservers.setMailserver(mailserver); + // Not Refactored Yet +// profileModelInst.mailservers.setMailserver(mailserver); } function saveMailserver(name, enode) { - profileModelInst.mailservers.save(name, enode) + // Not Refactored Yet +// profileModelInst.mailservers.save(name, enode) } function enableAutomaticMailserverSelection(checked) { - profileModelInst.mailservers.enableAutomaticSelection(checked) + // Not Refactored Yet +// profileModelInst.mailservers.enableAutomaticSelection(checked) } function getNetworkName() { - return utilsModelInst.getNetworkName() + // Not Refactored Yet +// return utilsModelInst.getNetworkName() } function logDir() { - return profileModelInst.logDir() + // Not Refactored Yet +// return profileModelInst.logDir() } function setBloomLevel(mode) { - nodeModelInst.setBloomLevel(mode) + // Not Refactored Yet +// nodeModelInst.setBloomLevel(mode) } function setWakuV2LightClient(mode) { - nodeModelInst.setWakuV2LightClient(mode) + // Not Refactored Yet +// nodeModelInst.setWakuV2LightClient(mode) } function getCurrentVersion() { @@ -317,50 +362,62 @@ QtObject { } function checkForUpdates() { - utilsModelInst.checkForUpdates() + // Not Refactored Yet +// utilsModelInst.checkForUpdates() } function setPubKeyGasEstimate(username, address) { - return profileModelInst.ens.setPubKeyGasEstimate(username, address) + // Not Refactored Yet +// return profileModelInst.ens.setPubKeyGasEstimate(username, address) } function setPubKey(username, address, gasLimit, gasPrice, password) { - return profileModelInst.ens.setPubKey(username, address, gasLimit, gasPrice, password) + // Not Refactored Yet +// return profileModelInst.ens.setPubKey(username, address, gasLimit, gasPrice, password) } function setDeviceName(name) { - profileModelInst.devices.setName(name) + // Not Refactored Yet +// profileModelInst.devices.setName(name) } function advertiseDevice() { - profileModelInst.devices.advertise() + // Not Refactored Yet +// profileModelInst.devices.advertise() } function enableDeviceInstallation(id, pairedSwitch) { - profileModelInst.devices.enableInstallation(id, pairedSwitch) + // Not Refactored Yet +// profileModelInst.devices.enableInstallation(id, pairedSwitch) } function syncAllDevices() { - profileModelInst.devices.syncAll() + // Not Refactored Yet +// profileModelInst.devices.syncAll() } function readTextFile(path) { - return utilsModelInst.readTextFile(path) + // Not Refactored Yet +// return utilsModelInst.readTextFile(path) } function writeTextFile(path, value) { - utilsModelInst.writeTextFile(path, value) + // Not Refactored Yet +// utilsModelInst.writeTextFile(path, value) } function setMessagesFromContactsOnly(checked) { - profileModelInst.setMessagesFromContactsOnly(checked) + // Not Refactored Yet +// profileModelInst.setMessagesFromContactsOnly(checked) } function userNameOrAlias(pk) { - return chatsModelInst.userNameOrAlias(pk); + // Not Refactored Yet +// return chatsModelInst.userNameOrAlias(pk); } function generateIdenticon(pk) { - return utilsModelInst.generateIdenticon(pk); + // Not Refactored Yet +// return utilsModelInst.generateIdenticon(pk); } } diff --git a/ui/app/AppLayouts/Profile/views/AdvancedView.qml b/ui/app/AppLayouts/Profile/views/AdvancedView.qml index 6f2ebc21f..f6c037d0f 100644 --- a/ui/app/AppLayouts/Profile/views/AdvancedView.qml +++ b/ui/app/AppLayouts/Profile/views/AdvancedView.qml @@ -259,11 +259,12 @@ ScrollView { root.store.setBloomLevel(mode) } onClosed: { - switch(root.store.nodeModelInst.bloomLevel){ - case "light": btnBloomLight.click(); break; - case "normal": btnBloomNormal.click(); break; - case "full": btnBloomFull.click(); break; - } + // Not Refactored Yet +// switch(root.store.nodeModelInst.bloomLevel){ +// case "light": btnBloomLight.click(); break; +// case "normal": btnBloomNormal.click(); break; +// case "full": btnBloomFull.click(); break; +// } destroy() } } diff --git a/ui/app/AppLayouts/Timeline/TimelineLayout.qml b/ui/app/AppLayouts/Timeline/TimelineLayout.qml index e31195437..86720f43f 100644 --- a/ui/app/AppLayouts/Timeline/TimelineLayout.qml +++ b/ui/app/AppLayouts/Timeline/TimelineLayout.qml @@ -123,12 +123,13 @@ ScrollView { section.property: "sectionIdentifier" section.criteria: ViewSection.FullString - Connections { - target: root.store.chatsModelInst.messageView - onMessagesLoaded: { - Qt.callLater(chatLogView.positionViewAtBeginning) - } - } + // Not Refactored Yet +// Connections { +// target: root.store.chatsModelInst.messageView +// onMessagesLoaded: { +// Qt.callLater(chatLogView.positionViewAtBeginning) +// } +// } } Timer { @@ -145,7 +146,8 @@ ScrollView { lessThan: [ function(left, right) { return left.clock > right.clock } ] - model: root.store.chatsModelInst.messageView.messageList + // Not Refactored Yet +// model: root.store.chatsModelInst.messageView.messageList // TODO: Replace with StatusQ component once it lives there. delegate: MessageView { id: msgDelegate diff --git a/ui/app/AppLayouts/Timeline/stores/RootStore.qml b/ui/app/AppLayouts/Timeline/stores/RootStore.qml new file mode 100644 index 000000000..0594e5a48 --- /dev/null +++ b/ui/app/AppLayouts/Timeline/stores/RootStore.qml @@ -0,0 +1,34 @@ +import QtQuick 2.13 +import QtQuick.Dialogs 1.3 + +import utils 1.0 + +QtObject { + id: root + + // Not Refactored Yet +// property var chatsModelInst: chatsModel + // Not Refactored Yet +// property var profileModelInst: profileModel + + function setActiveChannelToTimeline() { + // Not Refactored Yet +// chatsModelInst.setActiveChannelToTimeline() + } + + function getPlainTextFromRichText(text) { + // Not Refactored Yet +// return chatsModelInst.plainText(text) + } + + function sendMessage(message, contentType) { + // Not Refactored Yet +// chatsModelInst.messageView.sendMessage(message, "", contentType, true) + } + + function sendImage(url) { + // Not Refactored Yet +// chatsModelInst.sendImage(url, true) + } + +} diff --git a/ui/app/AppLayouts/Wallet/stores/RootStore.qml b/ui/app/AppLayouts/Wallet/stores/RootStore.qml index e884cba8d..583f3af3f 100644 --- a/ui/app/AppLayouts/Wallet/stores/RootStore.qml +++ b/ui/app/AppLayouts/Wallet/stores/RootStore.qml @@ -26,8 +26,10 @@ QtObject { property CollectiblesStore collectiblesStore: CollectiblesStore { } property var collectionList: walletSectionCollectiblesCollections.model + property var history: walletSectionTransactions property var historyTransactions: walletSectionTransactions.model - property var isNonArchivalNode: walletSectionTransactions.isNonArchivalNode +// property var transactions: walletModel.transactionsView.transactions +// property var historyView: walletModel.historyView // This should be exposed to the UI via "walletModule", WalletModule should use // Accounts Service which keeps the info about that (isFirstTimeAccountLogin). @@ -77,11 +79,18 @@ QtObject { function getLatestBlockNumber() { // TODO: Move to transaction root module and not wallet - return walletModel.getLatestBlockNumber() + // Not Refactored Yet +// return walletModel.getLatestBlockNumber() + } + + function isNonArchivalNode() { + // Not Refactored Yet +// return walletModel.isNonArchivalNode } function setInitialRange() { - walletModel.setInitialRange() + // Not Refactored Yet +// walletModel.setInitialRange() } function switchAccount(newIndex) { @@ -130,31 +139,36 @@ QtObject { function getQrCode(address) { // TODO: Move to transaction root module and not wallet - return profileModel.qrCode(address) + // Not Refactored Yet +// return profileModel.qrCode(address) } function hex2Dec(value) { // TODO: Move to transaction root module and not wallet - return utilsModel.hex2Dec(value) + // Not Refactored Yet +// return utilsModel.hex2Dec(value) } function hex2Eth(value) { // TODO: Move to transaction module - return utilsModel.hex2Eth(value) + // Not Refactored Yet +// return utilsModel.hex2Eth(value) } function checkRecentHistory() { - walletSectionTransactions.checkRecentHistory() + history.checkRecentHistory() } function isFetchingHistory() { - return walletSectionTransactions.isFetchingHistory(walletModel.accountsView.currentAccount.address) + // Not Refactored Yet +// return history.isFetchingHistory(walletModel.accountsView.currentAccount.address) } function loadTransactionsForAccount(pageSize) { - walletSectionTransactions.loadTransactionsForAccount(walletModel.accountsView.currentAccount.address, - historyTransactions.getLastTxBlockNumber(), - pageSize, true) + // Not Refactored Yet +// history.loadTransactionsForAccount(walletModel.accountsView.currentAccount.address, +// historyTransactions.getLastTxBlockNumber(), +// pageSize, true) } function fetchCollectionCollectiblesList(slug) { @@ -166,10 +180,11 @@ QtObject { } function getCollectionMaxValue(traitType, value, maxValue, collectionIndex) { - if(maxValue !== "") - return parseInt(value) + qsTr(" of ") + maxValue; - else - return parseInt(value) + qsTr(" of ") + - walletModelV2Inst.collectiblesView.collections.getCollectionTraitMaxValue(collectionIndex, traitType).toString(); + // Not Refactored Yet +// if(maxValue !== "") +// return parseInt(value) + qsTr(" of ") + maxValue; +// else +// return parseInt(value) + qsTr(" of ") + +// walletModelV2Inst.collectiblesView.collections.getCollectionTraitMaxValue(collectionIndex, traitType).toString(); } } diff --git a/ui/app/AppLayouts/WalletV2/WalletV2Layout.qml b/ui/app/AppLayouts/WalletV2/WalletV2Layout.qml index 756372cce..bf05eb8e5 100644 --- a/ui/app/AppLayouts/WalletV2/WalletV2Layout.qml +++ b/ui/app/AppLayouts/WalletV2/WalletV2Layout.qml @@ -33,7 +33,8 @@ Item { SignPhraseModal { id: signPhrasePopup - signingPhraseText: walletView.store.walletModelInst.utilsView.signingPhrase + // Not Refactored Yet +// signingPhraseText: walletView.store.walletModelInst.utilsView.signingPhrase onRemindLaterButtonClicked: { hideSignPhraseModal = true; signPhrasePopup.close(); @@ -95,14 +96,15 @@ Item { id: walletInfoContent WalletHeaderPanel { id: walletHeader - accountsModel: walletView.store.walletModelV2Inst.accountsView.accounts - currentAccount: walletView.store.walletModelV2Inst.accountsView.currentAccount - qrCode: walletView.store.profileModelInst.qrCode(walletView.store.selectedAccount.address) - allNetworksModel: walletView.store.walletModelV2Inst.networksView.allNetworks - enabledNetworksModel: walletView.store.walletModelV2Inst.networksView.enabledNetworks - onToggleNetwork: { - walletView.store.walletModelV2Inst.networksView.toggleNetwork(chainId) - } + // Not Refactored Yet +// accountsModel: walletView.store.walletModelV2Inst.accountsView.accounts +// currentAccount: walletView.store.walletModelV2Inst.accountsView.currentAccount +// qrCode: walletView.store.profileModelInst.qrCode(walletView.store.selectedAccount.address) +// allNetworksModel: walletView.store.walletModelV2Inst.networksView.allNetworks +// enabledNetworksModel: walletView.store.walletModelV2Inst.networksView.enabledNetworks +// onToggleNetwork: { +// walletView.store.walletModelV2Inst.networksView.toggleNetwork(chainId) +// } onCopyText: { walletView.store.copyText(text); } @@ -195,7 +197,8 @@ Item { WalletFooterPanel { id: walletFooter anchors.bottom: parent.bottom - walletV2Model: walletView.store.walletModelV2Inst + // Not Refactored Yet +// walletV2Model: walletView.store.walletModelV2Inst } } } diff --git a/ui/app/AppLayouts/WalletV2/panels/WalletFooterPanel.qml b/ui/app/AppLayouts/WalletV2/panels/WalletFooterPanel.qml index e71d3f5d5..1356811f2 100644 --- a/ui/app/AppLayouts/WalletV2/panels/WalletFooterPanel.qml +++ b/ui/app/AppLayouts/WalletV2/panels/WalletFooterPanel.qml @@ -51,6 +51,7 @@ Item { CryptoServicesModal { id: cryptoServicesModal anchors.centerIn: parent - walletV2Model: walletFooterRoot.walletV2Model + // Not Refactored Yet +// walletV2Model: walletFooterRoot.walletV2Model } } diff --git a/ui/app/AppLayouts/WalletV2/popups/AddEditSavedAddressPopup.qml b/ui/app/AppLayouts/WalletV2/popups/AddEditSavedAddressPopup.qml index fde6b16b0..43f62a1dd 100644 --- a/ui/app/AppLayouts/WalletV2/popups/AddEditSavedAddressPopup.qml +++ b/ui/app/AppLayouts/WalletV2/popups/AddEditSavedAddressPopup.qml @@ -124,13 +124,14 @@ StatusModal { } onClicked: { - root.loading = true; - root.beforeSave(); - edit ? - root.store.walletModelV2Inst.savedAddressesView.editSavedAddress(name, address) : - root.store.walletModelV2Inst.savedAddressesView.addSavedAddress(name, address); - root.close() - root.loading = false; + // Not Refactored Yet +// root.loading = true; +// root.beforeSave(); +// edit ? +// root.store.walletModelV2Inst.savedAddressesView.editSavedAddress(name, address) : +// root.store.walletModelV2Inst.savedAddressesView.addSavedAddress(name, address); +// root.close() +// root.loading = false; } } ] diff --git a/ui/app/AppLayouts/WalletV2/popups/CryptoServicesModal.qml b/ui/app/AppLayouts/WalletV2/popups/CryptoServicesModal.qml index 759de9c87..4fe82b945 100644 --- a/ui/app/AppLayouts/WalletV2/popups/CryptoServicesModal.qml +++ b/ui/app/AppLayouts/WalletV2/popups/CryptoServicesModal.qml @@ -17,15 +17,17 @@ StatusModal { onOpened: { loader.active = true; - cryptoServicesPopupRoot.walletV2Model.cryptoServiceController.fetchCryptoServices(); + // Not Refactored Yet +// cryptoServicesPopupRoot.walletV2Model.cryptoServiceController.fetchCryptoServices(); } - Connections { - target: cryptoServicesPopupRoot.walletV2Model.cryptoServiceController - function onFetchCryptoServicesFetched() { - loader.sourceComponent = servicesComponent; - } - } + // Not Refactored Yet +// Connections { +// target: cryptoServicesPopupRoot.walletV2Model.cryptoServiceController +// function onFetchCryptoServicesFetched() { +// loader.sourceComponent = servicesComponent; +// } +// } Loader { id: loader @@ -56,7 +58,8 @@ StatusModal { anchors.bottom: parent.bottom anchors.topMargin: Style.current.padding width: parent.width - model: cryptoServicesPopupRoot.walletV2Model.cryptoServiceController.cryptoServiceModel + // Not Refactored Yet +// model: cryptoServicesPopupRoot.walletV2Model.cryptoServiceController.cryptoServiceModel focus: true spacing: Style.current.padding clip: true diff --git a/ui/app/AppLayouts/WalletV2/stores/RootStore.qml b/ui/app/AppLayouts/WalletV2/stores/RootStore.qml index ba421bc28..445efa31c 100644 --- a/ui/app/AppLayouts/WalletV2/stores/RootStore.qml +++ b/ui/app/AppLayouts/WalletV2/stores/RootStore.qml @@ -7,10 +7,14 @@ QtObject { id: root property CollectiblesStore collectiblesStore: CollectiblesStore { } - property var walletModelInst: walletModel - property var walletModelV2Inst: walletV2Model - property var profileModelInst: profileModel - property var chatsModelInst: chatsModel + // Not Refactored Yet +// property var walletModelInst: walletModel + // Not Refactored Yet +// property var walletModelV2Inst: walletV2Model + // Not Refactored Yet +// property var profileModelInst: profileModel + // Not Refactored Yet +// property var chatsModelInst: chatsModel // This should be exposed to the UI via "walletModule", WalletModule should use // Accounts Service which keeps the info about that (isFirstTimeAccountLogin). @@ -37,27 +41,31 @@ QtObject { } function copyText(text) { - root.chatsModelInst.copyToClipboard(text); + // Not Refactored Yet +// root.chatsModelInst.copyToClipboard(text); } function changeSelectedAccount(newIndex) { - if (newIndex > root.walletModelV2Inst.accountsView.accounts) { - return; - } - root.selectedAccount = newIndex; - root.walletModelV2Inst.setCurrentAccountByIndex(newIndex); + // Not Refactored Yet +// if (newIndex > root.walletModelV2Inst.accountsView.accounts) { +// return; +// } +// root.selectedAccount = newIndex; +// root.walletModelV2Inst.setCurrentAccountByIndex(newIndex); } function afterAddAccount() { - changeSelectedAccount(walletModelInst.accountsView.accounts.rowCount() - 1); + // Not Refactored Yet +// changeSelectedAccount(walletModelInst.accountsView.accounts.rowCount() - 1); } function getCollectionMaxValue(traitType, value, maxValue, collectionIndex) { - if(maxValue !== "") - return parseInt(value) + qsTr(" of ") + maxValue; - else - return parseInt(value) + qsTr(" of ") + - walletModelV2Inst.collectiblesView.collections.getCollectionTraitMaxValue(collectionIndex, traitType).toString(); + // Not Refactored Yet +// if(maxValue !== "") +// return parseInt(value) + qsTr(" of ") + maxValue; +// else +// return parseInt(value) + qsTr(" of ") + +// walletModelV2Inst.collectiblesView.collections.getCollectionTraitMaxValue(collectionIndex, traitType).toString(); } property bool seedPhraseInserted: false @@ -113,34 +121,35 @@ QtObject { } function addAccount(text, model, keyOrSeedValid, accountNameInput) { - root.loadingAccounts = true; - if (!root.validateAddAccountPopup(text, model, keyOrSeedValid, accountNameInput.nameInputValid)) { - Global.playErrorSound(); - root.loadingAccounts = false; - } else { - //TODO account color to be verified with design - var result; - if (root.isSeedCountValid && !root.seedPhraseNotFound(text)) { - for (var i = 0; i < model.count; i++) { - //TODO add authorization process when Authorization moadl is ready - if (!!model.itemAtIndex(i)) { - result = root.walletModelInst.accountsView.addAccountsFromSeed(model.itemAtIndex(i).accountAddress, "qwqwqw", model.itemAtIndex(i).accountName, "") - } - } - } else { - result = root.walletModelInst.accountsView.addAccountsFromPrivateKey(text, "qwqwqw", accountNameInput.text, ""); - } - root.loadingAccounts = false; - if (result) { - let resultJson = JSON.parse(result); - if (!Utils.isInvalidPasswordMessage(resultJson.error)) { - accountError.text = resultJson.error; - accountError.open(); - } - Global.playErrorSound(); - return; - } - } + // Not Refactored Yet +// root.loadingAccounts = true; +// if (!root.validateAddAccountPopup(text, model, keyOrSeedValid, accountNameInput.nameInputValid)) { +// Global.playErrorSound(); +// root.loadingAccounts = false; +// } else { +// //TODO account color to be verified with design +// var result; +// if (root.isSeedCountValid && !root.seedPhraseNotFound(text)) { +// for (var i = 0; i < model.count; i++) { +// //TODO add authorization process when Authorization moadl is ready +// if (!!model.itemAtIndex(i)) { +// result = root.walletModelInst.accountsView.addAccountsFromSeed(model.itemAtIndex(i).accountAddress, "qwqwqw", model.itemAtIndex(i).accountName, "") +// } +// } +// } else { +// result = root.walletModelInst.accountsView.addAccountsFromPrivateKey(text, "qwqwqw", accountNameInput.text, ""); +// } +// root.loadingAccounts = false; +// if (result) { +// let resultJson = JSON.parse(result); +// if (!Utils.isInvalidPasswordMessage(resultJson.error)) { +// accountError.text = resultJson.error; +// accountError.open(); +// } +// Global.playErrorSound(); +// return; +// } +// } } property MessageDialog accountError: MessageDialog { @@ -151,7 +160,8 @@ QtObject { } function deleteAccount(address) { - walletModelInst.accountsView.deleteAccount(address); + // Not Refactored Yet +// walletModelInst.accountsView.deleteAccount(address); } property ListModel exampleWalletModel: ListModel { diff --git a/ui/app/AppLayouts/WalletV2/views/AssetsView.qml b/ui/app/AppLayouts/WalletV2/views/AssetsView.qml index 47a0ad739..3c745f056 100644 --- a/ui/app/AppLayouts/WalletV2/views/AssetsView.qml +++ b/ui/app/AppLayouts/WalletV2/views/AssetsView.qml @@ -63,7 +63,8 @@ Item { StatusBaseText { id: assetFiatValue color: Style.current.secondaryText - text: Utils.toLocaleString(fiatBalance, localAppSettings.locale) + " " + walletModel.balanceView.defaultCurrency.toUpperCase() + // Not Refactored Yet +// text: Utils.toLocaleString(fiatBalance, localAppSettings.locale) + " " + walletModel.balanceView.defaultCurrency.toUpperCase() anchors.right: parent.right anchors.rightMargin: 0 anchors.bottom: parent.bottom @@ -105,7 +106,8 @@ Item { spacing: Style.current.padding * 2 anchors.fill: parent //model: exampleModel - model: walletModel.tokensView.assets + // Not Refactored Yet +// model: walletModel.tokensView.assets delegate: assetViewDelegate boundsBehavior: Flickable.StopAtBounds } diff --git a/ui/app/AppLayouts/WalletV2/views/CollectiblesView.qml b/ui/app/AppLayouts/WalletV2/views/CollectiblesView.qml index 2669f5155..236d4d056 100644 --- a/ui/app/AppLayouts/WalletV2/views/CollectiblesView.qml +++ b/ui/app/AppLayouts/WalletV2/views/CollectiblesView.qml @@ -24,12 +24,13 @@ Item { height: parent.height sourceComponent: { - if (root.store.walletModelV2Inst.collectiblesView.isLoading) { - return loading; - } - if (root.store.walletModelV2Inst.collectiblesView.collections.rowCount() === 0) { - return empty; - } + // Not Refactored Yet +// if (root.store.walletModelV2Inst.collectiblesView.isLoading) { +// return loading; +// } +// if (root.store.walletModelV2Inst.collectiblesView.collections.rowCount() === 0) { +// return empty; +// } return loaded; } } @@ -72,7 +73,8 @@ Item { Repeater { id: collectionsRepeater - model: root.store.walletModelV2Inst.collectiblesView.collections + // Not Refactored Yet +// model: root.store.walletModelV2Inst.collectiblesView.collections //model: 5 delegate: StatusExpandableItem { width: parent.width - 156 diff --git a/ui/app/AppLayouts/WalletV2/views/LeftTabView.qml b/ui/app/AppLayouts/WalletV2/views/LeftTabView.qml index abc2cf0f5..0d41a22db 100644 --- a/ui/app/AppLayouts/WalletV2/views/LeftTabView.qml +++ b/ui/app/AppLayouts/WalletV2/views/LeftTabView.qml @@ -169,7 +169,8 @@ Rectangle { anchors.fill: parent spacing: 5 boundsBehavior: Flickable.StopAtBounds - model: walletInfoContainer.store.walletModelV2Inst.accountsView.accounts + // Not Refactored Yet +// model: walletInfoContainer.store.walletModelV2Inst.accountsView.accounts delegate: walletDelegate ListModel { id: exampleWalletModel diff --git a/ui/app/AppLayouts/WalletV2/views/SavedAddressesView.qml b/ui/app/AppLayouts/WalletV2/views/SavedAddressesView.qml index 45f1a873f..80e8d4aa0 100644 --- a/ui/app/AppLayouts/WalletV2/views/SavedAddressesView.qml +++ b/ui/app/AppLayouts/WalletV2/views/SavedAddressesView.qml @@ -171,57 +171,61 @@ Item { type: StatusBaseButton.Type.Danger text: qsTr("Delete") onClicked: { - root.loading = true - root.store.walletModelV2Inst.savedAddressesView.deleteSavedAddress( - deleteAddressConfirm.address) - deleteAddressConfirm.close() + // Not Refactored Yet +// root.loading = true +// root.store.walletModelV2Inst.savedAddressesView.deleteSavedAddress( +// deleteAddressConfirm.address) +// deleteAddressConfirm.close() } } ] } - Connections { - target: root.store.walletModelV2Inst.savedAddressesView - onAddEditResultChanged: { - root.loading = false - let resultRaw = root.store.walletModelV2Inst.savedAddressesView.addEditResult - let result = JSON.parse(resultRaw) - if (result.o) { - root.error = SavedAddressesView.Error.None - root.store.walletModelV2Inst.savedAddressesView.loadSavedAddresses(); - } else { - root.error = parseInt(result.e) - } - } - } - Connections { - target: root.store.walletModelV2Inst.savedAddressesView - onDeleteResultChanged: { - root.loading = false - let resultRaw = root.store.walletModelV2Inst.savedAddressesView.deleteResult - let result = JSON.parse(resultRaw) - if (result.o) { - root.error = SavedAddressesView.Error.None - root.store.walletModelV2Inst.savedAddressesView.loadSavedAddresses(); - deleteAddressConfirm.close(); - } else { - root.error = parseInt(result.e) - } - } - } - Connections { - target: root.store.walletModelV2Inst.savedAddressesView - onLoadResultChanged: { - root.loading = false - let resultRaw = root.store.walletModelV2Inst.savedAddressesView.loadResult - let result = JSON.parse(resultRaw) - if (result.o) { - root.error = SavedAddressesView.Error.None - } else { - root.error = parseInt(result.e) - } - } - } + // Not Refactored Yet +// Connections { +// target: root.store.walletModelV2Inst.savedAddressesView +// onAddEditResultChanged: { +// root.loading = false +// let resultRaw = root.store.walletModelV2Inst.savedAddressesView.addEditResult +// let result = JSON.parse(resultRaw) +// if (result.o) { +// root.error = SavedAddressesView.Error.None +// root.store.walletModelV2Inst.savedAddressesView.loadSavedAddresses(); +// } else { +// root.error = parseInt(result.e) +// } +// } +// } + // Not Refactored Yet +// Connections { +// target: root.store.walletModelV2Inst.savedAddressesView +// onDeleteResultChanged: { +// root.loading = false +// let resultRaw = root.store.walletModelV2Inst.savedAddressesView.deleteResult +// let result = JSON.parse(resultRaw) +// if (result.o) { +// root.error = SavedAddressesView.Error.None +// root.store.walletModelV2Inst.savedAddressesView.loadSavedAddresses(); +// deleteAddressConfirm.close(); +// } else { +// root.error = parseInt(result.e) +// } +// } +// } + // Not Refactored Yet +// Connections { +// target: root.store.walletModelV2Inst.savedAddressesView +// onLoadResultChanged: { +// root.loading = false +// let resultRaw = root.store.walletModelV2Inst.savedAddressesView.loadResult +// let result = JSON.parse(resultRaw) +// if (result.o) { +// root.error = SavedAddressesView.Error.None +// } else { +// root.error = parseInt(result.e) +// } +// } +// } SavedAddressesError { id: errorMessage @@ -258,7 +262,8 @@ Item { ListView { id: listView //model: root.store.exampleWalletModel - model: root.store.walletModelV2Inst.savedAddressesView.savedAddresses + // Not Refactored Yet +// model: root.store.walletModelV2Inst.savedAddressesView.savedAddresses clip: true spacing: 5 anchors.fill: parent diff --git a/ui/app/AppLayouts/WalletV2/views/SeedAddAccountView.qml b/ui/app/AppLayouts/WalletV2/views/SeedAddAccountView.qml index c31e1927f..0dab56294 100644 --- a/ui/app/AppLayouts/WalletV2/views/SeedAddAccountView.qml +++ b/ui/app/AppLayouts/WalletV2/views/SeedAddAccountView.qml @@ -50,7 +50,8 @@ Item { anchors.bottomMargin: 10 clip: true //TODO replace with active accounts model - model: root.store.walletModelInst.accountsView.accounts + // Not Refactored Yet +// model: root.store.walletModelInst.accountsView.accounts delegate: SeedAccountDetailsDelegate { deleteButtonVisible: (activeAccountsView.count > 1) onDeleteClicked: { diff --git a/ui/app/AppLayouts/WalletV2/views/SettingsTabView.qml b/ui/app/AppLayouts/WalletV2/views/SettingsTabView.qml index f9d4e355f..0e8796a9f 100644 --- a/ui/app/AppLayouts/WalletV2/views/SettingsTabView.qml +++ b/ui/app/AppLayouts/WalletV2/views/SettingsTabView.qml @@ -27,9 +27,10 @@ Item { anchors.right: parent.right anchors.rightMargin: 20 - visible : (root.store.walletModelV2Inst.accountsView.currentAccount.walletType !== Constants.seedWalletType) && - (root.store.walletModelV2Inst.accountsView.currentAccount.walletType !== Constants.watchWalletType) && - (root.store.walletModelV2Inst.accountsView.currentAccount.walletType !== Constants.keyWalletType) + // Not Refactored Yet +// visible : (root.store.walletModelV2Inst.accountsView.currentAccount.walletType !== Constants.seedWalletType) && +// (root.store.walletModelV2Inst.accountsView.currentAccount.walletType !== Constants.watchWalletType) && +// (root.store.walletModelV2Inst.accountsView.currentAccount.walletType !== Constants.keyWalletType) expandable: false icon.name: "seed-phrase" primaryText: qsTr("Back up seed phrase") @@ -45,7 +46,8 @@ Item { anchors.right: parent.right anchors.rightMargin: 20 - visible : root.store.walletModelV2Inst.accountsView.currentAccount.walletType !== Constants.watchWalletType + // Not Refactored Yet +// visible : root.store.walletModelV2Inst.accountsView.currentAccount.walletType !== Constants.watchWalletType expandable: true icon.name: "secret" primaryText: qsTr("Account signing phrase") @@ -59,8 +61,9 @@ Item { anchors.right: parent.right anchors.rightMargin: 20 - visible : (root.store.walletModelV2Inst.accountsView.currentAccount.walletType === Constants.keyWalletType) || - (root.store.walletModelV2Inst.accountsView.currentAccount.walletType === Constants.seedWalletType) + // Not Refactored Yet +// visible : (root.store.walletModelV2Inst.accountsView.currentAccount.walletType === Constants.keyWalletType) || +// (root.store.walletModelV2Inst.accountsView.currentAccount.walletType === Constants.seedWalletType) expandable: true icon.name: "seed-phrase" primaryText: qsTr("View private key") @@ -133,7 +136,8 @@ Item { lineHeightMode: Text.FixedHeight elide: Text.ElideRight wrapMode: Text.Wrap - text: root.store.walletModelV2Inst.settingsView.signingPhrase + // Not Refactored Yet +// text: root.store.walletModelV2Inst.settingsView.signingPhrase } } Rectangle { diff --git a/ui/app/AppLayouts/WalletV2/views/collectibles/CollectibleCollectionView.qml b/ui/app/AppLayouts/WalletV2/views/collectibles/CollectibleCollectionView.qml index 6e0790c24..3322fa742 100644 --- a/ui/app/AppLayouts/WalletV2/views/collectibles/CollectibleCollectionView.qml +++ b/ui/app/AppLayouts/WalletV2/views/collectibles/CollectibleCollectionView.qml @@ -17,12 +17,13 @@ Item { property var store signal collectibleClicked() - Connections { - target: root.store.walletV2ModelInst.collectiblesView.getAssetsList(root.slug) - onAssetsChanged: { - root.assetsLoaded = true; - } - } + // Not Refactored Yet +// Connections { +// target: root.store.walletV2ModelInst.collectiblesView.getAssetsList(root.slug) +// onAssetsChanged: { +// root.assetsLoaded = true; +// } +// } Loader { id: contentLoader @@ -57,7 +58,8 @@ Item { spacing: 24 Repeater { - model: root.store.walletV2ModelInst.collectiblesView.getAssetsList(root.slug) + // Not Refactored Yet +// model: root.store.walletV2ModelInst.collectiblesView.getAssetsList(root.slug) StatusRoundedImage { id: image width: 146 @@ -91,6 +93,7 @@ Item { } Component.onCompleted: { - root.store.walletV2ModelInst.collectiblesView.loadAssets(root.store.walletV2ModelInst.accountsView.currentAccount.address, root.slug); + // Not Refactored Yet +// root.store.walletV2ModelInst.collectiblesView.loadAssets(root.store.walletV2ModelInst.accountsView.currentAccount.address, root.slug); } } diff --git a/ui/app/AppLayouts/stores/RootStore.qml b/ui/app/AppLayouts/stores/RootStore.qml index c1ff9879c..8a542d53a 100644 --- a/ui/app/AppLayouts/stores/RootStore.qml +++ b/ui/app/AppLayouts/stores/RootStore.qml @@ -11,13 +11,16 @@ QtObject { property var mainModuleInst: mainModule property var profileModuleInst: profileModule - property var chatsModelInst: chatsModel - property var walletModelInst: walletModel + // Not Refactored Yet +// property var chatsModelInst: chatsModel + // Not Refactored Yet +// property var walletModelInst: walletModel property var userProfileInst: userProfile property var accounts: walletSectionAccounts.model property var currentAccount: walletSectionCurrent - property var profileModelInst: profileModel + // Not Refactored Yet +// property var profileModelInst: profileModel property var assets: walletSectionAccountTokens.model // property MessageStore messageStore: MessageStore { } @@ -27,26 +30,32 @@ QtObject { function setCommunityMuted(communityId, checked) { - chatsModelInst.communities.setCommunityMuted(communityId, checked); + // Not Refactored Yet +// chatsModelInst.communities.setCommunityMuted(communityId, checked); } function exportCommunity() { - chatsModelInst.communities.exportCommunity(); + // Not Refactored Yet +// chatsModelInst.communities.exportCommunity(); } function leaveCommunity(communityId) { - chatsModelInst.communities.leaveCommunity(communityId); + // Not Refactored Yet +// chatsModelInst.communities.leaveCommunity(communityId); } function createCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY) { - chatsModelInst.communities.createCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY); + // Not Refactored Yet +// chatsModelInst.communities.createCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY); } function editCommunity(communityId, communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY) { - chatsModelInst.communities.editCommunity(communityId, communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY); + // Not Refactored Yet +// chatsModelInst.communities.editCommunity(communityId, communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY); } function copyToClipboard(text) { - chatsModelInst.copyToClipboard(text); + // Not Refactored Yet +// chatsModelInst.copyToClipboard(text); } } diff --git a/ui/app/AppMain.qml b/ui/app/AppMain.qml index 50f045f22..316f450f0 100644 --- a/ui/app/AppMain.qml +++ b/ui/app/AppMain.qml @@ -33,9 +33,11 @@ Item { anchors.fill: parent property alias appLayout: appLayout - property var newVersionJSON: JSON.parse(utilsModel.newVersion) + // Not Refactored Yet + property var newVersionJSON: "" //JSON.parse(utilsModel.newVersion) property bool profilePopupOpened: false - property bool networkGuarded: profileModel.network.current === Constants.networkMainnet || (profileModel.network.current === Constants.networkRopsten && localAccountSensitiveSettings.stickersEnsRopsten) + // Not Refactored Yet +// property bool networkGuarded: profileModel.network.current === Constants.networkMainnet || (profileModel.network.current === Constants.networkRopsten && localAccountSensitiveSettings.stickersEnsRopsten) property RootStore rootStore: RootStore { } signal settingsLoaded() @@ -251,35 +253,40 @@ Item { id: communityContextMenu openHandler: function () { - chatsModel.communities.setObservedCommunity(model.id) + // Not Refactored Yet +// chatsModel.communities.setObservedCommunity(model.id) } StatusMenuItem { //% "Invite People" text: qsTrId("invite-people") icon.name: "share-ios" - enabled: chatsModel.communities.observedCommunity.canManageUsers - onTriggered: Global.openPopup(inviteFriendsToCommunityPopup, { - community: chatsModel.communities.observedCommunity - }) + // Not Refactored Yet +// enabled: chatsModel.communities.observedCommunity.canManageUsers +// onTriggered: Global.openPopup(inviteFriendsToCommunityPopup, { +// community: chatsModel.communities.observedCommunity +// }) } StatusMenuItem { //% "View Community" text: qsTrId("view-community") icon.name: "group-chat" - onTriggered: Global.openPopup(communityProfilePopup, { - store: appMain.rootStore, - community: chatsModel.communities.observedCommunity - }) + // Not Refactored Yet +// onTriggered: Global.openPopup(communityProfilePopup, { +// store: appMain.rootStore, +// community: chatsModel.communities.observedCommunity +// }) } StatusMenuItem { - enabled: chatsModel.communities.observedCommunity.admin + // Not Refactored Yet +// enabled: chatsModel.communities.observedCommunity.admin //% "Edit Community" text: qsTrId("edit-community") icon.name: "edit" - onTriggered: Global.openPopup(editCommunityPopup, {store: appMain.rootStore, community: chatsModel.communities.observedCommunity}) + // Not Refactored Yet +// onTriggered: Global.openPopup(editCommunityPopup, {store: appMain.rootStore, community: chatsModel.communities.observedCommunity}) } StatusMenuSeparator {} @@ -291,7 +298,8 @@ Item { icon.width: 14 iconRotation: 180 type: StatusMenuItem.Type.Danger - onTriggered: chatsModel.communities.leaveCommunity(model.id) + // Not Refactored Yet +// onTriggered: chatsModel.communities.leaveCommunity(model.id) } } } @@ -452,9 +460,12 @@ Item { Layout.fillHeight: true // Loaders do not have access to the context, so props need to be set // Adding a "_" to avoid a binding loop - property var _chatsModel: chatsModel.messageView - property var _walletModel: walletModel - property var _utilsModel: utilsModel + // Not Refactored Yet +// property var _chatsModel: chatsModel.messageView + // Not Refactored Yet +// property var _walletModel: walletModel + // Not Refactored Yet +// property var _utilsModel: utilsModel property var _web3Provider: web3Provider } @@ -532,40 +543,40 @@ Item { } } - Connections { - target: chatsModel - onNotificationClicked: { - applicationWindow.makeStatusAppActive() +// Connections { +// target: chatsModel +// onNotificationClicked: { +// applicationWindow.makeStatusAppActive() - switch(notificationType){ - case Constants.osNotificationType.newContactRequest: - appView.currentIndex = Constants.appViewStackIndex.chat - appMain.openContactsPopup() - break - case Constants.osNotificationType.acceptedContactRequest: - appView.currentIndex = Constants.appViewStackIndex.chat - break - case Constants.osNotificationType.joinCommunityRequest: - case Constants.osNotificationType.acceptedIntoCommunity: - case Constants.osNotificationType.rejectedByCommunity: - // Not Refactored - Need to check what community exactly we need to switch to. -// appView.currentIndex = Utils.getAppSectionIndex(Constants.community) - break - case Constants.osNotificationType.newMessage: - appView.currentIndex = Constants.appViewStackIndex.chat - break - } - } - } +// switch(notificationType){ +// case Constants.osNotificationType.newContactRequest: +// appView.currentIndex = Constants.appViewStackIndex.chat +// appMain.openContactsPopup() +// break +// case Constants.osNotificationType.acceptedContactRequest: +// appView.currentIndex = Constants.appViewStackIndex.chat +// break +// case Constants.osNotificationType.joinCommunityRequest: +// case Constants.osNotificationType.acceptedIntoCommunity: +// case Constants.osNotificationType.rejectedByCommunity: +// // Not Refactored - Need to check what community exactly we need to switch to. +//// appView.currentIndex = Utils.getAppSectionIndex(Constants.community) +// break +// case Constants.osNotificationType.newMessage: +// appView.currentIndex = Constants.appViewStackIndex.chat +// break +// } +// } +// } - Connections { - target: profileModel - ignoreUnknownSignals: true - enabled: removeMnemonicAfterLogin - onInitialized: { - mnemonicModule.remove() - } - } +// Connections { +// target: profileModel +// ignoreUnknownSignals: true +// enabled: removeMnemonicAfterLogin +// onInitialized: { +// mnemonicModule.remove() +// } +// } Connections { target: appMain.rootStore.contactsModuleInst.model @@ -594,12 +605,13 @@ Item { return systemTray.showMessage(title, message, systemTray.icon.source, 4000) } + // Not Refactored Yet //% "Contact request accepted" - profileModel.showOSNotification(title, - message, - isContact? Constants.osNotificationType.acceptedContactRequest : - Constants.osNotificationType.newContactRequest, - localAccountSensitiveSettings.useOSNotifications) +// profileModel.showOSNotification(title, +// message, +// isContact? Constants.osNotificationType.acceptedContactRequest : +// Constants.osNotificationType.newContactRequest, +// localAccountSensitiveSettings.useOSNotifications) } } @@ -689,7 +701,8 @@ Item { sourceComponent: SendModal { store: appMain.rootStore onOpened: { - walletModel.gasView.getGasPrice() + // Not Refactored Yet +// walletModel.gasView.getGasPrice() } onClosed: { sendModal.closed() @@ -756,7 +769,8 @@ Item { width: 350 x: parent.width / 2 - width / 2 y: parent.height / 2 - height / 2 - modelList: chatsModel.channelView.chats + // Not Refactored Yet +// modelList: chatsModel.channelView.chats getText: function (modelData) { return modelData.name } @@ -766,11 +780,13 @@ Item { name: modelData.name }); } - onClicked: function (index) { - Global.changeAppSectionBySectionType(Constants.appSection.chat) - chatsModel.channelView.setActiveChannelByIndex(index) - channelPicker.close() - } + + // Not Refactored Yet +// onClicked: function (index) { +// Global.changeAppSectionBySectionType(Constants.appSection.chat) +// chatsModel.channelView.setActiveChannelByIndex(index) +// channelPicker.close() +// } } } @@ -779,51 +795,52 @@ Item { // we're hiding the setting to change appearance for compact normal mode // of the UI. For now, compact mode is the new default. - const whitelist = profileModel.getLinkPreviewWhitelist() - try { - const whiteListedSites = JSON.parse(whitelist) - let settingsUpdated = false + // Not Refactored Yet +// const whitelist = profileModel.getLinkPreviewWhitelist() +// try { +// const whiteListedSites = JSON.parse(whitelist) +// let settingsUpdated = false - // Add Status links to whitelist - whiteListedSites.push({title: "Status", address: Constants.deepLinkPrefix, imageSite: false}) - whiteListedSites.push({title: "Status", address: Constants.joinStatusLink, imageSite: false}) - let settings = localAccountSensitiveSettings.whitelistedUnfurlingSites +// // Add Status links to whitelist +// whiteListedSites.push({title: "Status", address: Constants.deepLinkPrefix, imageSite: false}) +// whiteListedSites.push({title: "Status", address: Constants.joinStatusLink, imageSite: false}) +// let settings = localAccountSensitiveSettings.whitelistedUnfurlingSites - if (!settings) { - settings = {} - } +// if (!settings) { +// settings = {} +// } - // Set Status links as true. We intercept thoseURLs so it is privacy-safe - if (!settings[Constants.deepLinkPrefix] || !settings[Constants.joinStatusLink]) { - settings[Constants.deepLinkPrefix] = true - settings[Constants.joinStatusLink] = true - settingsUpdated = true - } +// // Set Status links as true. We intercept thoseURLs so it is privacy-safe +// if (!settings[Constants.deepLinkPrefix] || !settings[Constants.joinStatusLink]) { +// settings[Constants.deepLinkPrefix] = true +// settings[Constants.joinStatusLink] = true +// settingsUpdated = true +// } - const whitelistedHostnames = [] +// const whitelistedHostnames = [] - // Add whitelisted sites in to app settings that are not already there - whiteListedSites.forEach(site => { - if (!settings.hasOwnProperty(site.address)) { - settings[site.address] = false - settingsUpdated = true - } - whitelistedHostnames.push(site.address) - }) - // Remove any whitelisted sites from app settings that don't exist in the - // whitelist from status-go - Object.keys(settings).forEach(settingsHostname => { - if (!whitelistedHostnames.includes(settingsHostname)) { - delete settings[settingsHostname] - settingsUpdated = true - } - }) - if (settingsUpdated) { - localAccountSensitiveSettings.whitelistedUnfurlingSites = settings - } - } catch (e) { - console.error('Could not parse the whitelist for sites', e) - } +// // Add whitelisted sites in to app settings that are not already there +// whiteListedSites.forEach(site => { +// if (!settings.hasOwnProperty(site.address)) { +// settings[site.address] = false +// settingsUpdated = true +// } +// whitelistedHostnames.push(site.address) +// }) +// // Remove any whitelisted sites from app settings that don't exist in the +// // whitelist from status-go +// Object.keys(settings).forEach(settingsHostname => { +// if (!whitelistedHostnames.includes(settingsHostname)) { +// delete settings[settingsHostname] +// settingsUpdated = true +// } +// }) +// if (settingsUpdated) { +// localAccountSensitiveSettings.whitelistedUnfurlingSites = settings +// } +// } catch (e) { +// console.error('Could not parse the whitelist for sites', e) +// } appMain.settingsLoaded() } } diff --git a/ui/imports/shared/controls/ContactsListAndSearch.qml b/ui/imports/shared/controls/ContactsListAndSearch.qml index 6806b8763..7e8e51e86 100644 --- a/ui/imports/shared/controls/ContactsListAndSearch.qml +++ b/ui/imports/shared/controls/ContactsListAndSearch.qml @@ -37,7 +37,8 @@ Item { noContactsRect.visible = false searchResults.loading = true searchResults.showProfileNotFoundMessage = false - chatsModel.ensView.resolveENS(ensName) + // Not Refactored Yet +// chatsModel.ensView.resolveENS(ensName) }); function validate() { @@ -74,7 +75,8 @@ Item { if (Utils.isChatKey(chatKey.text)) { pubKey = chatKey.text; if (!contactsModule.model.isAdded(pubKey)) { - searchResults.username = utilsModel.generateAlias(pubKey); + // Not Refactored Yet +// searchResults.username = utilsModel.generateAlias(pubKey); searchResults.userAlias = Utils.compactAddress(pubKey, 4); searchResults.pubKey = pubKey } @@ -89,35 +91,36 @@ Item { } textField.anchors.rightMargin: clearBtn.width + Style.current.padding + 2 - Connections { - target: chatsModel.ensView - onEnsWasResolved: { - if (chatKey.text == "") { - ensUsername.text = ""; - pubKey = ""; - } else if(resolvedPubKey == ""){ - ensUsername.text = ""; - searchResults.pubKey = pubKey = ""; - searchResults.address = ""; - searchResults.showProfileNotFoundMessage = true - } else { - if (userProfile.pubKey === resolvedPubKey) { - //% "Can't chat with yourself" - root.validationError = qsTrId("can-t-chat-with-yourself"); - } else { - searchResults.username = chatsModel.ensView.formatENSUsername(chatKey.text) - let userAlias = utilsModel.generateAlias(resolvedPubKey) - userAlias = userAlias.length > 20 ? userAlias.substring(0, 19) + "..." : userAlias - searchResults.userAlias = userAlias + " • " + Utils.compactAddress(resolvedPubKey, 4) - searchResults.pubKey = pubKey = resolvedPubKey; - searchResults.address = resolvedAddress; - } - searchResults.showProfileNotFoundMessage = false - } - searchResults.loading = false; - noContactsRect.visible = pubKey === "" && ensUsername.text === "" && !contactsModule.model.list.hasAddedContacts() && !profileNotFoundMessage.visible - } - } + // Not Refactored Yet +// Connections { +// target: chatsModel.ensView +// onEnsWasResolved: { +// if (chatKey.text == "") { +// ensUsername.text = ""; +// pubKey = ""; +// } else if(resolvedPubKey == ""){ +// ensUsername.text = ""; +// searchResults.pubKey = pubKey = ""; +// searchResults.address = ""; +// searchResults.showProfileNotFoundMessage = true +// } else { +// if (userProfile.pubKey === resolvedPubKey) { +// //% "Can't chat with yourself" +// root.validationError = qsTrId("can-t-chat-with-yourself"); +// } else { +// searchResults.username = chatsModel.ensView.formatENSUsername(chatKey.text) +// let userAlias = utilsModel.generateAlias(resolvedPubKey) +// userAlias = userAlias.length > 20 ? userAlias.substring(0, 19) + "..." : userAlias +// searchResults.userAlias = userAlias + " • " + Utils.compactAddress(resolvedPubKey, 4) +// searchResults.pubKey = pubKey = resolvedPubKey; +// searchResults.address = resolvedAddress; +// } +// searchResults.showProfileNotFoundMessage = false +// } +// searchResults.loading = false; +// noContactsRect.visible = pubKey === "" && ensUsername.text === "" && !contactsModule.model.list.hasAddedContacts() && !profileNotFoundMessage.visible +// } +// } StatusFlatRoundButton { id: clearBtn diff --git a/ui/imports/shared/controls/CopyToClipBoardButton.qml b/ui/imports/shared/controls/CopyToClipBoardButton.qml index d809a0c70..1ce8547d2 100644 --- a/ui/imports/shared/controls/CopyToClipBoardButton.qml +++ b/ui/imports/shared/controls/CopyToClipBoardButton.qml @@ -57,7 +57,8 @@ Rectangle { } onClicked: { if (textToCopy) { - chatsModel.copyToClipboard(textToCopy) + // Not Refactored Yet +// chatsModel.copyToClipboard(textToCopy) } onClick() } diff --git a/ui/imports/shared/controls/GasSelector.qml b/ui/imports/shared/controls/GasSelector.qml index 396a6f286..ec9266c4b 100644 --- a/ui/imports/shared/controls/GasSelector.qml +++ b/ui/imports/shared/controls/GasSelector.qml @@ -17,9 +17,10 @@ Item { property double gasPrice: 0 - property bool eip1599Enabled: walletModel.transactionsView.isEIP1559Enabled - property var suggestedFees: JSON.parse(walletModel.gasView.suggestedFees) - property var latestBaseFee: JSON.parse(walletModel.transactionsView.latestBaseFee) + // Not Refactored Yet + property bool eip1599Enabled: false //walletModel.transactionsView.isEIP1559Enabled + property var suggestedFees: "" //JSON.parse(walletModel.gasView.suggestedFees) + property var latestBaseFee: "" //JSON.parse(walletModel.transactionsView.latestBaseFee) property double latestBaseFeeGwei: { if (!eip1599Enabled) return 0; diff --git a/ui/imports/shared/controls/Input.qml b/ui/imports/shared/controls/Input.qml index 8bdc25cc1..af5681966 100644 --- a/ui/imports/shared/controls/Input.qml +++ b/ui/imports/shared/controls/Input.qml @@ -176,18 +176,19 @@ Item { font.pixelSize: 12 size: StatusBaseButton.Size.Small onClicked: { - if (inputBox.copyToClipboard) { - chatsModel.copyToClipboard(inputBox.textToCopy ? inputBox.textToCopy : inputValue.text) - } else { - if (inputValue.canPaste) { - inputValue.paste() - } - } + // Not Refactored Yet +// if (inputBox.copyToClipboard) { +// chatsModel.copyToClipboard(inputBox.textToCopy ? inputBox.textToCopy : inputValue.text) +// } else { +// if (inputValue.canPaste) { +// inputValue.paste() +// } +// } - copyBtn.copied = true - timer.setTimeout(function() { - copyBtn.copied = false - }, 2000); +// copyBtn.copied = true +// timer.setTimeout(function() { +// copyBtn.copied = false +// }, 2000); } } } diff --git a/ui/imports/shared/controls/SendToContractWarning.qml b/ui/imports/shared/controls/SendToContractWarning.qml index 34d895be3..59401603c 100644 --- a/ui/imports/shared/controls/SendToContractWarning.qml +++ b/ui/imports/shared/controls/SendToContractWarning.qml @@ -23,12 +23,13 @@ Item { return root.isValid } txtValidationError.text = "" - if (walletModel.tokensView.isKnownTokenContract(selectedRecipient.address)) { - // do not set isValid = false here because it would make the - // TransactionStackGroup invalid and therefore not let the user - // continue in the modal - txtValidationError.text = sendToContractWarningMessage - } + // Not Refactored Yet +// if (walletModel.tokensView.isKnownTokenContract(selectedRecipient.address)) { +// // do not set isValid = false here because it would make the +// // TransactionStackGroup invalid and therefore not let the user +// // continue in the modal +// txtValidationError.text = sendToContractWarningMessage +// } return isValid } diff --git a/ui/imports/shared/keycard/InsertCard.qml b/ui/imports/shared/keycard/InsertCard.qml index 56738de5c..7b727b61b 100644 --- a/ui/imports/shared/keycard/InsertCard.qml +++ b/ui/imports/shared/keycard/InsertCard.qml @@ -55,17 +55,18 @@ StatusModal { } ] - Connections { - id: connection - target: keycardModel - ignoreUnknownSignals: true + // Not Refactored Yet +// Connections { +// id: connection +// target: keycardModel +// ignoreUnknownSignals: true - onCardConnected: { - insertCard.close() - } +// onCardConnected: { +// insertCard.close() +// } - onCardDisconnected: { - insertCard.open() - } - } +// onCardDisconnected: { +// insertCard.open() +// } +// } } diff --git a/ui/imports/shared/keycard/PINModal.qml b/ui/imports/shared/keycard/PINModal.qml index 18d44c41b..5cc4a8668 100644 --- a/ui/imports/shared/keycard/PINModal.qml +++ b/ui/imports/shared/keycard/PINModal.qml @@ -61,7 +61,8 @@ StatusModal { onClicked: { submitted = true - keycardModel.authenticate(pinField.text) + // Not Refactored Yet +// keycardModel.authenticate(pinField.text) popup.close() } } diff --git a/ui/imports/shared/keycard/PairingModal.qml b/ui/imports/shared/keycard/PairingModal.qml index fb2f8c0c5..cac1a3b36 100644 --- a/ui/imports/shared/keycard/PairingModal.qml +++ b/ui/imports/shared/keycard/PairingModal.qml @@ -58,7 +58,8 @@ StatusModal { onClicked: { submitted = true - keycardModel.pair(pairingPasswordField.text) + // Not Refactored Yet +// keycardModel.pair(pairingPasswordField.text) popup.close() } } diff --git a/ui/imports/shared/panels/ImageLoader.qml b/ui/imports/shared/panels/ImageLoader.qml index 466766d28..89a35b435 100644 --- a/ui/imports/shared/panels/ImageLoader.qml +++ b/ui/imports/shared/panels/ImageLoader.qml @@ -51,17 +51,17 @@ Rectangle { } ] - Connections { - target: chatsModel - onOnlineStatusChanged: { - if (connected && root.state !== "ready" && - root.visible && - root.source && - root.source.startsWith("http")) { - root.reload() - } - } - } +// Connections { +// target: chatsModel +// onOnlineStatusChanged: { +// if (connected && root.state !== "ready" && +// root.visible && +// root.source && +// root.source.startsWith("http")) { +// root.reload() +// } +// } +// } function reload() { // From the documentation (https://doc.qt.io/qt-5/qml-qtquick-image.html#sourceSize-prop) diff --git a/ui/imports/shared/popups/SendModal.qml b/ui/imports/shared/popups/SendModal.qml index ec8e2a7f6..f7af3f0a1 100644 --- a/ui/imports/shared/popups/SendModal.qml +++ b/ui/imports/shared/popups/SendModal.qml @@ -33,38 +33,39 @@ ModalPopup { } function sendTransaction() { - stack.currentGroup.isPending = true - let success = false - if(txtAmount.selectedAsset.address === "" || txtAmount.selectedAsset.address === Constants.zeroAddress){ - success = walletModel.transactionsView.transferEth( - selectFromAccount.selectedAccount.address, - selectRecipient.selectedRecipient.address, - txtAmount.selectedAmount, - gasSelector.selectedGasLimit, - gasSelector.eip1599Enabled ? "" : gasSelector.selectedGasPrice, - gasSelector.selectedTipLimit, - gasSelector.selectedOverallLimit, - transactionSigner.enteredPassword, - stack.uuid) - } else { - success = walletModel.transactionsView.transferTokens( - selectFromAccount.selectedAccount.address, - selectRecipient.selectedRecipient.address, - txtAmount.selectedAsset.address, - txtAmount.selectedAmount, - gasSelector.selectedGasLimit, - gasSelector.eip1599Enabled ? "" : gasSelector.selectedGasPrice, - gasSelector.selectedTipLimit, - gasSelector.selectedOverallLimit, - transactionSigner.enteredPassword, - stack.uuid) - } + // Not Refactored Yet +// stack.currentGroup.isPending = true +// let success = false +// if(txtAmount.selectedAsset.address === "" || txtAmount.selectedAsset.address === Constants.zeroAddress){ +// success = walletModel.transactionsView.transferEth( +// selectFromAccount.selectedAccount.address, +// selectRecipient.selectedRecipient.address, +// txtAmount.selectedAmount, +// gasSelector.selectedGasLimit, +// gasSelector.eip1599Enabled ? "" : gasSelector.selectedGasPrice, +// gasSelector.selectedTipLimit, +// gasSelector.selectedOverallLimit, +// transactionSigner.enteredPassword, +// stack.uuid) +// } else { +// success = walletModel.transactionsView.transferTokens( +// selectFromAccount.selectedAccount.address, +// selectRecipient.selectedRecipient.address, +// txtAmount.selectedAsset.address, +// txtAmount.selectedAmount, +// gasSelector.selectedGasLimit, +// gasSelector.eip1599Enabled ? "" : gasSelector.selectedGasPrice, +// gasSelector.selectedTipLimit, +// gasSelector.selectedOverallLimit, +// transactionSigner.enteredPassword, +// stack.uuid) +// } - if(!success){ - //% "Invalid transaction parameters" - sendingError.text = qsTrId("invalid-transaction-parameters") - sendingError.open() - } +// if(!success){ +// //% "Invalid transaction parameters" +// sendingError.text = qsTrId("invalid-transaction-parameters") +// sendingError.open() +// } } TransactionStackView { @@ -93,7 +94,8 @@ ModalPopup { } return null } - currency: walletModel.balanceView.defaultCurrency + // Not Refactored Yet +// currency: walletModel.balanceView.defaultCurrency width: stack.width //% "From account" label: qsTrId("from-account") @@ -126,10 +128,12 @@ ModalPopup { AssetAndAmountInput { id: txtAmount selectedAccount: selectFromAccount.selectedAccount - defaultCurrency: walletModel.balanceView.defaultCurrency + // Not Refactored Yet +// defaultCurrency: walletModel.balanceView.defaultCurrency currentCurrency: walletSection.currentCurrency - getFiatValue: walletModel.balanceView.getFiatValue - getCryptoValue: walletModel.balanceView.getCryptoValue + // Not Refactored Yet +// getFiatValue: walletModel.balanceView.getFiatValue +// getCryptoValue: walletModel.balanceView.getCryptoValue width: stack.width onSelectedAssetChanged: if (isValid) { gasSelector.estimateGas() } onSelectedAmountChanged: if (isValid) { gasSelector.estimateGas() } @@ -138,33 +142,35 @@ ModalPopup { id: gasSelector anchors.top: txtAmount.bottom anchors.topMargin: Style.current.padding - gasPrice: parseFloat(walletModel.gasView.gasPrice) - getGasEthValue: walletModel.gasView.getGasEthValue - getFiatValue: walletModel.balanceView.getFiatValue - defaultCurrency: walletModel.balanceView.defaultCurrency + // Not Refactored Yet +// gasPrice: parseFloat(walletModel.gasView.gasPrice) +// getGasEthValue: walletModel.gasView.getGasEthValue +// getFiatValue: walletModel.balanceView.getFiatValue +// defaultCurrency: walletModel.balanceView.defaultCurrency width: stack.width property var estimateGas: Backpressure.debounce(gasSelector, 600, function() { - if (!(selectFromAccount.selectedAccount && selectFromAccount.selectedAccount.address && - selectRecipient.selectedRecipient && selectRecipient.selectedRecipient.address && - txtAmount.selectedAsset && txtAmount.selectedAsset.address && - txtAmount.selectedAmount)) return + // Not Refactored Yet +// if (!(selectFromAccount.selectedAccount && selectFromAccount.selectedAccount.address && +// selectRecipient.selectedRecipient && selectRecipient.selectedRecipient.address && +// txtAmount.selectedAsset && txtAmount.selectedAsset.address && +// txtAmount.selectedAmount)) return - let gasEstimate = JSON.parse(walletModel.gasView.estimateGas( - selectFromAccount.selectedAccount.address, - selectRecipient.selectedRecipient.address, - txtAmount.selectedAsset.address, - txtAmount.selectedAmount, - "")) +// let gasEstimate = JSON.parse(walletModel.gasView.estimateGas( +// selectFromAccount.selectedAccount.address, +// selectRecipient.selectedRecipient.address, +// txtAmount.selectedAsset.address, +// txtAmount.selectedAmount, +// "")) - if (!gasEstimate.success) { - //% "Error estimating gas: %1" - console.warn(qsTrId("error-estimating-gas---1").arg(gasEstimate.error.message)) - return - } +// if (!gasEstimate.success) { +// //% "Error estimating gas: %1" +// console.warn(qsTrId("error-estimating-gas---1").arg(gasEstimate.error.message)) +// return +// } - selectedGasLimit = gasEstimate.result - defaultGasLimit = selectedGasLimit +// selectedGasLimit = gasEstimate.result +// defaultGasLimit = selectedGasLimit }) } GasValidator { @@ -195,7 +201,8 @@ ModalPopup { toAccount: selectRecipient.selectedRecipient asset: txtAmount.selectedAsset amount: { "value": txtAmount.selectedAmount, "fiatValue": txtAmount.selectedFiatAmount } - currency: walletModel.balanceView.defaultCurrency + // Not Refactored Yet +// currency: walletModel.balanceView.defaultCurrency } SendToContractWarning { id: sendToContractWarning @@ -213,7 +220,8 @@ ModalPopup { TransactionSigner { id: transactionSigner width: stack.width - signingPhrase: walletModel.utilsView.signingPhrase + // Not Refactored Yet +// signingPhrase: walletModel.utilsView.signingPhrase } } } @@ -281,54 +289,55 @@ ModalPopup { } } - Connections { - target: walletModel.transactionsView - onTransactionWasSent: { - try { - let response = JSON.parse(txResult) + // Not Refactored Yet +// Connections { +// target: walletModel.transactionsView +// onTransactionWasSent: { +// try { +// let response = JSON.parse(txResult) - if (response.uuid !== stack.uuid) return +// if (response.uuid !== stack.uuid) return - stack.currentGroup.isPending = false +// stack.currentGroup.isPending = false - if (!response.success) { - if (Utils.isInvalidPasswordMessage(response.result)){ - //% "Wrong password" - transactionSigner.validationError = qsTrId("wrong-password") - return - } - sendingError.text = response.result - return sendingError.open() - } +// if (!response.success) { +// if (Utils.isInvalidPasswordMessage(response.result)){ +// //% "Wrong password" +// transactionSigner.validationError = qsTrId("wrong-password") +// return +// } +// sendingError.text = response.result +// return sendingError.open() +// } - //% "Transaction pending..." - toastMessage.title = qsTrId("ens-transaction-pending") - toastMessage.source = Style.svg("loading") - toastMessage.iconColor = Style.current.primary - toastMessage.iconRotates = true - toastMessage.link = `${walletModel.utilsView.etherscanLink}/${response.result}` - toastMessage.open() - root.close() - } catch (e) { - console.error('Error parsing the response', e) - } - } - onTransactionCompleted: { - if (success) { - //% "Transaction completed" - toastMessage.title = qsTrId("transaction-completed") - toastMessage.source = Style.svg("check-circle") - toastMessage.iconColor = Style.current.success - } else { - //% "Transaction failed" - toastMessage.title = qsTrId("ens-registration-failed-title") - toastMessage.source = Style.svg("block-icon") - toastMessage.iconColor = Style.current.danger - } - toastMessage.link = `${walletModel.utilsView.etherscanLink}/${txHash}` - toastMessage.open() - } - } +// //% "Transaction pending..." +// toastMessage.title = qsTrId("ens-transaction-pending") +// toastMessage.source = Style.svg("loading") +// toastMessage.iconColor = Style.current.primary +// toastMessage.iconRotates = true +// toastMessage.link = `${walletModel.utilsView.etherscanLink}/${response.result}` +// toastMessage.open() +// root.close() +// } catch (e) { +// console.error('Error parsing the response', e) +// } +// } +// onTransactionCompleted: { +// if (success) { +// //% "Transaction completed" +// toastMessage.title = qsTrId("transaction-completed") +// toastMessage.source = Style.svg("check-circle") +// toastMessage.iconColor = Style.current.success +// } else { +// //% "Transaction failed" +// toastMessage.title = qsTrId("ens-registration-failed-title") +// toastMessage.source = Style.svg("block-icon") +// toastMessage.iconColor = Style.current.danger +// } +// toastMessage.link = `${walletModel.utilsView.etherscanLink}/${txHash}` +// toastMessage.open() +// } +// } } } diff --git a/ui/imports/shared/popups/SignTransactionModal.qml b/ui/imports/shared/popups/SignTransactionModal.qml index ae24dec4d..025323107 100644 --- a/ui/imports/shared/popups/SignTransactionModal.qml +++ b/ui/imports/shared/popups/SignTransactionModal.qml @@ -34,37 +34,38 @@ StatusModal { property alias transactionSigner: transactionSigner property var sendTransaction: function(selectedGasLimit, selectedGasPrice, selectedTipLimit, selectedOveralLimit, enteredPassword) { - let success = false - if(root.selectedAsset.address == Constants.zeroAddress){ - success = root.store.walletModelInst.transactionsView.transferEth( - selectFromAccount.selectedAccount.address, - selectRecipient.selectedRecipient.address, - root.selectedAmount, - selectedGasLimit, - gasSelector.eip1599Enabled ? "" : gasSelector.selectedGasPrice, - gasSelector.selectedTipLimit, - gasSelector.selectedOverallLimit, - enteredPassword, - stack.uuid) - } else { - success = root.store.walletModelInst.transactionsView.transferTokens( - selectFromAccount.selectedAccount.address, - selectRecipient.selectedRecipient.address, - root.selectedAsset.address, - root.selectedAmount, - selectedGasLimit, - gasSelector.eip1599Enabled ? "" : gasSelector.selectedGasPrice, - gasSelector.selectedTipLimit, - gasSelector.selectedOverallLimit, - enteredPassword, - stack.uuid) - } + // Not Refactored Yet +// let success = false +// if(root.selectedAsset.address == Constants.zeroAddress){ +// success = root.store.walletModelInst.transactionsView.transferEth( +// selectFromAccount.selectedAccount.address, +// selectRecipient.selectedRecipient.address, +// root.selectedAmount, +// selectedGasLimit, +// gasSelector.eip1599Enabled ? "" : gasSelector.selectedGasPrice, +// gasSelector.selectedTipLimit, +// gasSelector.selectedOverallLimit, +// enteredPassword, +// stack.uuid) +// } else { +// success = root.store.walletModelInst.transactionsView.transferTokens( +// selectFromAccount.selectedAccount.address, +// selectRecipient.selectedRecipient.address, +// root.selectedAsset.address, +// root.selectedAmount, +// selectedGasLimit, +// gasSelector.eip1599Enabled ? "" : gasSelector.selectedGasPrice, +// gasSelector.selectedTipLimit, +// gasSelector.selectedOverallLimit, +// enteredPassword, +// stack.uuid) +// } - if(!success){ - //% "Invalid transaction parameters" - sendingError.text = qsTrId("invalid-transaction-parameters") - sendingError.open() - } +// if(!success){ +// //% "Invalid transaction parameters" +// sendingError.text = qsTrId("invalid-transaction-parameters") +// sendingError.open() +// } } property MessageDialog sendingError: MessageDialog { @@ -89,18 +90,19 @@ StatusModal { initialItem: groupPreview isLastGroup: stack.currentGroup === groupSignTx onGroupActivated: { - root.header.title = group.headerText + root.title = group.headerText btnNext.text = group.footerText } TransactionFormGroup { id: groupSelectAcct headerText: { - if(trxData.startsWith("0x095ea7b3")){ - const approveData = JSON.parse(root.store.walletModelInst.tokensView.decodeTokenApproval(selectedRecipient.address, trxData)) - if(approveData.symbol) - //% "Authorize %1 %2" - return qsTrId("authorize--1--2").arg(approveData.amount).arg(approveData.symbol) - } + // Not Refactored Yet +// if(trxData.startsWith("0x095ea7b3")){ +// const approveData = JSON.parse(root.store.walletModelInst.tokensView.decodeTokenApproval(selectedRecipient.address, trxData)) +// if(approveData.symbol) +// //% "Authorize %1 %2" +// return qsTrId("authorize--1--2").arg(approveData.amount).arg(approveData.symbol) +// } return qsTrId("command-button-send"); } //% "Continue" @@ -113,8 +115,9 @@ StatusModal { } StatusAccountSelector { id: selectFromAccount - accounts: root.store.walletModelInst.accountsView.accounts - currency: root.store.walletModelInst.balanceView.defaultCurrency + // Not Refactored Yet +// accounts: root.store.walletModelInst.accountsView.accounts +// currency: root.store.walletModelInst.balanceView.defaultCurrency width: stack.width selectedAccount: root.selectedAccount //% "Choose account" @@ -126,8 +129,10 @@ StatusModal { RecipientSelector { id: selectRecipient visible: false - accounts: root.store.accounts - contacts: root.store.addedContacts + // Not Refactored Yet +// accounts: root.store.walletModelInst.accountsView.accounts + // Not Refactored Yet +// contacts: root.store.profileModelInst.contacts.addedContacts selectedRecipient: root.selectedRecipient readOnly: true } @@ -144,40 +149,42 @@ StatusModal { GasSelector { id: gasSelector anchors.topMargin: Style.current.padding - gasPrice: parseFloat(root.store.walletModelInst.gasView.gasPrice) - getGasEthValue: root.store.walletModelInst.gasView.getGasEthValue - getFiatValue: root.store.walletModelInst.balanceView.getFiatValue - defaultCurrency: root.store.walletModelInst.balanceView.defaultCurrency + // Not Refactored Yet +// gasPrice: parseFloat(root.store.walletModelInst.gasView.gasPrice) +// getGasEthValue: root.store.walletModelInst.gasView.getGasEthValue +// getFiatValue: root.store.walletModelInst.balanceView.getFiatValue +// defaultCurrency: root.store.walletModelInst.balanceView.defaultCurrency width: stack.width property var estimateGas: Backpressure.debounce(gasSelector, 600, function() { - if (!(selectFromAccount.selectedAccount && selectFromAccount.selectedAccount.address && - selectRecipient.selectedRecipient && selectRecipient.selectedRecipient.address && - root.selectedAsset && root.selectedAsset.address && - root.selectedAmount)) { - selectedGasLimit = 250000 - defaultGasLimit = selectedGasLimit - return - } + // Not Refactored Yet +// if (!(selectFromAccount.selectedAccount && selectFromAccount.selectedAccount.address && +// selectRecipient.selectedRecipient && selectRecipient.selectedRecipient.address && +// root.selectedAsset && root.selectedAsset.address && +// root.selectedAmount)) { +// selectedGasLimit = 250000 +// defaultGasLimit = selectedGasLimit +// return +// } - let gasEstimate = JSON.parse(root.store.walletModelInst.gasView.estimateGas( - selectFromAccount.selectedAccount.address, - selectRecipient.selectedRecipient.address, - root.selectedAsset.address, - root.selectedAmount, - trxData)) +// let gasEstimate = JSON.parse(root.store.walletModelInst.gasView.estimateGas( +// selectFromAccount.selectedAccount.address, +// selectRecipient.selectedRecipient.address, +// root.selectedAsset.address, +// root.selectedAmount, +// trxData)) - if (!gasEstimate.success) { - //% "Error estimating gas: %1" - let message = qsTrId("error-estimating-gas---1").arg(gasEstimate.error.message) +// if (!gasEstimate.success) { +// //% "Error estimating gas: %1" +// let message = qsTrId("error-estimating-gas---1").arg(gasEstimate.error.message) - //% ". The transaction will probably fail." - gasEstimateErrorPopup.confirmationText = message + qsTrId("--the-transaction-will-probably-fail-") - gasEstimateErrorPopup.open() - return - } - selectedGasLimit = gasEstimate.result - defaultGasLimit = selectedGasLimit +// //% ". The transaction will probably fail." +// gasEstimateErrorPopup.confirmationText = message + qsTrId("--the-transaction-will-probably-fail-") +// gasEstimateErrorPopup.open() +// return +// } +// selectedGasLimit = gasEstimate.result +// defaultGasLimit = selectedGasLimit }) } GasValidator { @@ -214,7 +221,8 @@ StatusModal { toAccount: selectRecipient.selectedRecipient asset: root.selectedAsset amount: { "value": root.selectedAmount, "fiatValue": root.selectedFiatAmount } - currency: root.store.walletModelInst.balanceView.defaultCurrency + // Not Refactored Yet +// currency: root.store.walletModelInst.balanceView.defaultCurrency isFromEditable: false trxData: root.trxData isGasEditable: true @@ -255,7 +263,8 @@ StatusModal { TransactionSigner { id: transactionSigner width: stack.width - signingPhrase: root.store.walletModelInst.utilsView.signingPhrase + // Not Refactored Yet +// signingPhrase: root.store.walletModelInst.utilsView.signingPhrase } } } @@ -282,6 +291,7 @@ StatusModal { rightButtons: [ StatusButton { id: btnNext + anchors.right: parent.right //% "Next" text: qsTrId("next") enabled: stack.currentGroup.isValid && !stack.currentGroup.isPending @@ -334,43 +344,45 @@ StatusModal { } } - Connections { - target: root.store.walletModelInst.transactionsView - onTransactionWasSent: { - try { - let response = JSON.parse(txResult) - if (response.uuid !== stack.uuid) - return + // Not Refactored Yet +// Connections { +// target: root.store.walletModelInst.transactionsView +// onTransactionWasSent: { +// try { +// let response = JSON.parse(txResult) +// if (response.uuid !== stack.uuid) +// return - let transactionId = response.result +// let transactionId = response.result - if (!response.success) { - if (Utils.isInvalidPasswordMessage(transactionId)){ - //% "Wrong password" - transactionSigner.validationError = qsTrId("wrong-password") - return - } - sendingError.text = transactionId - return sendingError.open() - } +// if (!response.success) { +// if (Utils.isInvalidPasswordMessage(transactionId)){ +// //% "Wrong password" +// transactionSigner.validationError = qsTrId("wrong-password") +// return +// } +// sendingError.text = transactionId +// return sendingError.open() +// } - chatsModel.transactions.acceptRequestTransaction(transactionId, - messageId, - root.store.profileModelInst.profile.pubKey + transactionId.substr(2)) +// // Not Refactored Yet +//// chatsModel.transactions.acceptRequestTransaction(transactionId, +//// messageId, +//// root.store.profileModelInst.profile.pubKey + transactionId.substr(2)) - //% "Transaction pending..." - toastMessage.title = qsTrId("ens-transaction-pending") - toastMessage.source = Style.svg("loading") - toastMessage.iconColor = Style.current.primary - toastMessage.iconRotates = true - toastMessage.link = `${root.store.walletModelInst.utilsView.etherscanLink}/${transactionId}` - toastMessage.open() +// //% "Transaction pending..." +// toastMessage.title = qsTrId("ens-transaction-pending") +// toastMessage.source = Style.svg("loading") +// toastMessage.iconColor = Style.current.primary +// toastMessage.iconRotates = true +// toastMessage.link = `${root.store.walletModelInst.utilsView.etherscanLink}/${transactionId}` +// toastMessage.open() - root.close() - } catch (e) { - console.error('Error parsing the response', e) - } - } - } +// root.close() +// } catch (e) { +// console.error('Error parsing the response', e) +// } +// } +// } } diff --git a/ui/imports/shared/popups/UserStatusContextMenu.qml b/ui/imports/shared/popups/UserStatusContextMenu.qml index cb6848b00..01d01706a 100644 --- a/ui/imports/shared/popups/UserStatusContextMenu.qml +++ b/ui/imports/shared/popups/UserStatusContextMenu.qml @@ -87,7 +87,8 @@ PopupMenu { text: qsTr("Online") onTriggered: { if (userProfile.sendUserStatus != true) { - root.store.profileModelInst.profile.setSendUserStatus(true) + // Not Refactored Yet +// root.store.profileModelInst.profile.setSendUserStatus(true) } root.close(); } @@ -101,7 +102,8 @@ PopupMenu { text: qsTr("Offline") onTriggered: { if (userProfile.sendUserStatus != false) { - root.store.profileModelInst.profile.setSendUserStatus(false) + // Not Refactored Yet +// root.store.profileModelInst.profile.setSendUserStatus(false) } root.close(); } diff --git a/ui/imports/shared/status/StatusChatImageSizeValidator.qml b/ui/imports/shared/status/StatusChatImageSizeValidator.qml index 25e0b14de..4899f5666 100644 --- a/ui/imports/shared/status/StatusChatImageSizeValidator.qml +++ b/ui/imports/shared/status/StatusChatImageSizeValidator.qml @@ -11,15 +11,16 @@ StatusChatImageValidator { readonly property int maxImgSizeBytes: Constants.maxUploadFilesizeMB * 1048576 /* 1 MB in bytes */ onImagesChanged: { - let isValid = true - root.validImages = images.filter(img => { - let size = parseInt(utilsModel.getFileSize(img)) - const isSmallEnough = size <= maxImgSizeBytes - isValid = isValid && isSmallEnough - return isSmallEnough - }) - root.isValid = isValid + // Not Refactored Yet +// let isValid = true +// root.validImages = images.filter(img => { +// let size = parseInt(utilsModel.getFileSize(img)) +// const isSmallEnough = size <= maxImgSizeBytes +// isValid = isValid && isSmallEnough +// return isSmallEnough +// }) +// root.isValid = isValid } //% "Max image size is %1 MB" errorMessage: qsTrId("max-image-size-is--1-mb").arg(Constants.maxUploadFilesizeMB) -} \ No newline at end of file +} diff --git a/ui/imports/shared/status/StatusChatInput.qml b/ui/imports/shared/status/StatusChatInput.qml index 1ca4d4f83..c42777ec7 100644 --- a/ui/imports/shared/status/StatusChatInput.qml +++ b/ui/imports/shared/status/StatusChatInput.qml @@ -284,7 +284,9 @@ Rectangle { const deparsedEmoji = Emoji.deparse(textWithoutMention); - return chatsModel.plainText(deparsedEmoji); + // Not Refactored Yet + return "" +// return chatsModel.plainText(deparsedEmoji); } function removeMentions(currentText) { @@ -610,12 +612,14 @@ Rectangle { SuggestionBoxPanel { id: suggestionsBox - model: { - if (chatsModel.communities.activeCommunity.active) { - return chatsModel.communities.activeCommunity.members - } - return chatsModel.messageView.messageList.userList - } + + // Not Refactored Yet +// model: { +// if (chatsModel.communities.activeCommunity.active) { +// return chatsModel.communities.activeCommunity.members +// } +// return chatsModel.messageView.messageList.userList +// } x : messageInput.x y: -height - Style.current.smallPadding width: messageInput.width @@ -1088,7 +1092,8 @@ Rectangle { anchors.rightMargin: Style.current.halfPadding anchors.verticalCenter: parent.verticalCenter visible: imageBtn2.visible - enabled: (chatsModel.plainText(Emoji.deparse(messageInputField.text)).length > 0 || isImage) && messageInputField.length < messageLimit + // Not Refactored Yet +// enabled: (chatsModel.plainText(Emoji.deparse(messageInputField.text)).length > 0 || isImage) && messageInputField.length < messageLimit onClicked: function (event) { control.sendMessage(event) control.hideExtendedArea(); @@ -1150,7 +1155,8 @@ Rectangle { text: qsTr("Unblock") type: StatusQ.StatusBaseButton.Type.Danger onClicked: function (event) { - contactsModule.unblockContact(chatsModel.channelView.activeChannel.id) + // Not Refactored Yet +// contactsModule.unblockContact(chatsModel.channelView.activeChannel.id) } } } diff --git a/ui/imports/shared/status/StatusETHTransactionModal.qml b/ui/imports/shared/status/StatusETHTransactionModal.qml index 9cb33beef..b50dabc0f 100644 --- a/ui/imports/shared/status/StatusETHTransactionModal.qml +++ b/ui/imports/shared/status/StatusETHTransactionModal.qml @@ -23,39 +23,41 @@ ModalPopup { property var onSuccess: (function(){}) Component.onCompleted: { - walletModel.gasView.getGasPricePredictions() + // Not Refactored Yet +// walletModel.gasView.getGasPricePredictions() } height: 540 function sendTransaction() { - try { - let responseStr = profileModel.ens.setPubKey(root.ensUsername, - selectFromAccount.selectedAccount.address, - gasSelector.selectedGasLimit, - gasSelector.eip1599Enabled ? "" : gasSelector.selectedGasPrice, - gasSelector.selectedTipLimit, - gasSelector.selectedOverallLimit, - transactionSigner.enteredPassword) - let response = JSON.parse(responseStr) + // Not Refactored Yet +// try { +// let responseStr = profileModel.ens.setPubKey(root.ensUsername, +// selectFromAccount.selectedAccount.address, +// gasSelector.selectedGasLimit, +// gasSelector.eip1599Enabled ? "" : gasSelector.selectedGasPrice, +// gasSelector.selectedTipLimit, +// gasSelector.selectedOverallLimit, +// transactionSigner.enteredPassword) +// let response = JSON.parse(responseStr) - if (!response.success) { - if (Utils.isInvalidPasswordMessage(response.result)){ - //% "Wrong password" - transactionSigner.validationError = qsTrId("wrong-password") - return - } - sendingError.text = response.result - return sendingError.open() - } +// if (!response.success) { +// if (Utils.isInvalidPasswordMessage(response.result)){ +// //% "Wrong password" +// transactionSigner.validationError = qsTrId("wrong-password") +// return +// } +// sendingError.text = response.result +// return sendingError.open() +// } - onSuccess(); - root.close(); - } catch (e) { - console.error('Error sending the transaction', e) - sendingError.text = "Error sending the transaction: " + e.message; - return sendingError.open() - } +// onSuccess(); +// root.close(); +// } catch (e) { +// console.error('Error sending the transaction', e) +// sendingError.text = "Error sending the transaction: " + e.message; +// return sendingError.open() +// } } property MessageDialog sendingError: MessageDialog { @@ -92,7 +94,8 @@ ModalPopup { } return null } - currency: walletModel.balanceView.defaultCurrency + // Not Refactored Yet +// currency: walletModel.balanceView.defaultCurrency width: stack.width //% "Choose account" label: qsTrId("choose-account") @@ -103,9 +106,11 @@ ModalPopup { RecipientSelector { id: selectRecipient visible: false - accounts: walletModel.accountsView.accounts + // Not Refactored Yet +// accounts: walletModel.accountsView.accounts contacts: contactsModule.model.addedContacts - selectedRecipient: { "address": utilsModel.ensRegisterAddress, "type": RecipientSelector.Type.Address } + // Not Refactored Yet +// selectedRecipient: { "address": utilsModel.ensRegisterAddress, "type": RecipientSelector.Type.Address } readOnly: true onSelectedRecipientChanged: if (isValid) { gasSelector.estimateGas() } } @@ -114,10 +119,11 @@ ModalPopup { visible: true anchors.top: selectFromAccount.bottom anchors.topMargin: Style.current.padding - gasPrice: parseFloat(walletModel.gasView.gasPrice) - getGasEthValue: walletModel.gasView.getGasEthValue - getFiatValue: walletModel.balanceView.getFiatValue - defaultCurrency: walletModel.balanceView.defaultCurrency + // Not Refactored Yet +// gasPrice: parseFloat(walletModel.gasView.gasPrice) +// getGasEthValue: walletModel.gasView.getGasEthValue +// getFiatValue: walletModel.balanceView.getFiatValue +// defaultCurrency: walletModel.balanceView.defaultCurrency property var estimateGas: Backpressure.debounce(gasSelector, 600, function() { let estimatedGas = root.estimateGasFunction(selectFromAccount.selectedAccount); @@ -151,11 +157,12 @@ ModalPopup { } toAccount: selectRecipient.selectedRecipient asset: root.asset - currency: walletModel.balanceView.defaultCurrency - amount: { - const fiatValue = walletModel.balanceView.getFiatValue(0, root.asset.symbol, currency) - return { "value": 0, "fiatValue": fiatValue } - } + // Not Refactored Yet +// currency: walletModel.balanceView.defaultCurrency +// amount: { +// const fiatValue = walletModel.balanceView.getFiatValue(0, root.asset.symbol, currency) +// return { "value": 0, "fiatValue": fiatValue } +// } } } TransactionFormGroup { @@ -167,7 +174,8 @@ ModalPopup { TransactionSigner { id: transactionSigner width: stack.width - signingPhrase: walletModel.utilsView.signingPhrase + // Not Refactored Yet +// signingPhrase: walletModel.utilsView.signingPhrase } } } diff --git a/ui/imports/shared/status/StatusGifColumn.qml b/ui/imports/shared/status/StatusGifColumn.qml index 39e09bcec..421f7cf85 100644 --- a/ui/imports/shared/status/StatusGifColumn.qml +++ b/ui/imports/shared/status/StatusGifColumn.qml @@ -109,7 +109,8 @@ Column { hoverEnabled: true onClicked: function (event) { root.gifSelected(event, model.url) - chatsModel.gif.addToRecents(model.id) + // Not Refactored Yet +// chatsModel.gif.addToRecents(model.id) } } } diff --git a/ui/imports/shared/status/StatusGifPopup.qml b/ui/imports/shared/status/StatusGifPopup.qml index 41db3996c..696db5003 100644 --- a/ui/imports/shared/status/StatusGifPopup.qml +++ b/ui/imports/shared/status/StatusGifPopup.qml @@ -21,22 +21,25 @@ Popup { id: popup property var gifSelected: function () {} property var searchGif: Backpressure.debounce(searchBox, 500, function (query) { - chatsModel.gif.search(query) + // Not Refactored Yet +// chatsModel.gif.search(query) }); property var toggleCategory: function(newCategory) { previousCategory = currentCategory currentCategory = newCategory searchBox.text = "" - if (currentCategory === StatusGifPopup.Category.Trending) { - chatsModel.gif.getTrendings() - } else if(currentCategory === StatusGifPopup.Category.Favorite) { - chatsModel.gif.getFavorites() - } else if(currentCategory === StatusGifPopup.Category.Recent) { - chatsModel.gif.getRecents() - } + // Not Refactored Yet +// if (currentCategory === StatusGifPopup.Category.Trending) { +// chatsModel.gif.getTrendings() +// } else if(currentCategory === StatusGifPopup.Category.Favorite) { +// chatsModel.gif.getFavorites() +// } else if(currentCategory === StatusGifPopup.Category.Recent) { +// chatsModel.gif.getRecents() +// } } property var toggleFavorite: function(item) { - chatsModel.gif.toggleFavorite(item.id, currentCategory === StatusGifPopup.Category.Favorite) + // Not Refactored Yet +// chatsModel.gif.toggleFavorite(item.id, currentCategory === StatusGifPopup.Category.Favorite) } property alias searchString: searchBox.text property int currentCategory: StatusGifPopup.Category.Trending @@ -65,7 +68,8 @@ Popup { searchBox.text = "" searchBox.forceActiveFocus(Qt.MouseFocusReason) if (localAccountSensitiveSettings.isTenorWarningAccepted) { - chatsModel.gif.getTrendings() + // Not Refactored Yet +// chatsModel.gif.getTrendings() } else { confirmationPopup.open() } @@ -159,7 +163,9 @@ Popup { const headerTextHeight = searchBox.text === "" ? headerText.height : 0 return 400 - gifHeader.height - headerTextHeight } - sourceComponent: chatsModel.gif.columnA.rowCount() == 0 ? empty : gifItems + // Not Refactored Yet + sourceComponent: empty +// sourceComponent: chatsModel.gif.columnA.rowCount() == 0 ? empty : gifItems } Row { @@ -257,7 +263,8 @@ Popup { text: qsTr("Enable") onClicked: { localAccountSensitiveSettings.isTenorWarningAccepted = true - chatsModel.gif.getTrendings() + // Not Refactored Yet +// chatsModel.gif.getTrendings() confirmationPopup.close() } } @@ -297,7 +304,8 @@ Popup { visible: currentCategory === StatusGifPopup.Category.Trending || currentCategory === StatusGifPopup.Category.Search onClicked: { if (searchBox.text === "") { - chatsModel.gif.getTrendings() + // Not Refactored Yet +// chatsModel.gif.getTrendings() return } @@ -328,7 +336,8 @@ Popup { property string lastHoveredId StatusGifColumn { - gifList.model: chatsModel.gif.columnA + // Not Refactored Yet +// gifList.model: chatsModel.gif.columnA gifWidth: (popup.width / 3) - Style.current.padding gifSelected: popup.gifSelected toggleFavorite: popup.toggleFavorite @@ -339,7 +348,8 @@ Popup { } StatusGifColumn { - gifList.model: chatsModel.gif.columnB + // Not Refactored Yet +// gifList.model: chatsModel.gif.columnB gifWidth: (popup.width / 3) - Style.current.padding gifSelected: popup.gifSelected toggleFavorite: popup.toggleFavorite @@ -350,7 +360,8 @@ Popup { } StatusGifColumn { - gifList.model: chatsModel.gif.columnC + // Not Refactored Yet +// gifList.model: chatsModel.gif.columnC gifWidth: (popup.width / 3) - Style.current.padding gifSelected: popup.gifSelected toggleFavorite: popup.toggleFavorite diff --git a/ui/imports/shared/status/StatusSNTTransactionModal.qml b/ui/imports/shared/status/StatusSNTTransactionModal.qml index 71e39cde6..3b3a98a88 100644 --- a/ui/imports/shared/status/StatusSNTTransactionModal.qml +++ b/ui/imports/shared/status/StatusSNTTransactionModal.qml @@ -13,7 +13,8 @@ import shared.controls 1.0 // TODO: replace with StatusModal ModalPopup { id: root - readonly property var asset: JSON.parse(walletModel.tokensView.getStatusToken()) + // Not Refactored Yet + readonly property var asset: "" //JSON.parse(walletModel.tokensView.getStatusToken()) property string assetPrice property string contractAddress property var estimateGasFunction: (function(userAddress, uuid) { return 0; }) @@ -21,7 +22,8 @@ ModalPopup { property var onSuccess: (function(){}) Component.onCompleted: { - walletModel.gasView.getGasPrice() + // Not Refactored Yet +// walletModel.gasView.getGasPrice() } height: 540 @@ -108,7 +110,8 @@ ModalPopup { RecipientSelector { id: selectRecipient visible: false - accounts: walletModel.accountsView.accounts + // Not Refactored Yet +// accounts: walletModel.accountsView.accounts contacts: contactsModule.model.addedContacts selectedRecipient: { "address": contractAddress, "type": RecipientSelector.Type.Address } readOnly: true @@ -118,9 +121,10 @@ ModalPopup { id: gasSelector anchors.top: selectFromAccount.bottom anchors.topMargin: Style.current.padding - gasPrice: parseFloat(walletModel.gasView.gasPrice) - getGasEthValue: walletModel.gasView.getGasEthValue - getFiatValue: walletModel.balanceView.getFiatValue + // Not Refactored Yet +// gasPrice: parseFloat(walletModel.gasView.gasPrice) +// getGasEthValue: walletModel.gasView.getGasEthValue +// getFiatValue: walletModel.balanceView.getFiatValue defaultCurrency: walletSection.currentCurrency width: stack.width @@ -158,10 +162,11 @@ ModalPopup { toAccount: selectRecipient.selectedRecipient asset: root.asset currency: walletSection.currentCurrency - amount: { - const fiatValue = walletModel.balanceView.getFiatValue(root.assetPrice || 0, root.asset.symbol, currency) - return { "value": root.assetPrice, "fiatValue": fiatValue } - } + // Not Refactored Yet +// amount: { +// const fiatValue = walletModel.balanceView.getFiatValue(root.assetPrice || 0, root.asset.symbol, currency) +// return { "value": root.assetPrice, "fiatValue": fiatValue } +// } } } TransactionFormGroup { @@ -174,7 +179,8 @@ ModalPopup { TransactionSigner { id: transactionSigner width: stack.width - signingPhrase: walletModel.utilsView.signingPhrase + // Not Refactored Yet +// signingPhrase: walletModel.utilsView.signingPhrase } } } diff --git a/ui/imports/shared/status/StatusStickerMarket.qml b/ui/imports/shared/status/StatusStickerMarket.qml index 2f4d98b97..05ab57061 100644 --- a/ui/imports/shared/status/StatusStickerMarket.qml +++ b/ui/imports/shared/status/StatusStickerMarket.qml @@ -97,7 +97,8 @@ Item { Component { id: stickerPackPurchaseModal StatusSNTTransactionModal { - contractAddress: utilsModel.stickerMarketAddress + // Not Refactored Yet +// contractAddress: utilsModel.stickerMarketAddress assetPrice: price estimateGasFunction: function(selectedAccount, uuid) { if (packId < 0 || !selectedAccount || !price) return 325000 diff --git a/ui/imports/shared/status/StatusStickerPackClickPopup.qml b/ui/imports/shared/status/StatusStickerPackClickPopup.qml index ac4ef3ae3..036d8de9a 100644 --- a/ui/imports/shared/status/StatusStickerPackClickPopup.qml +++ b/ui/imports/shared/status/StatusStickerPackClickPopup.qml @@ -58,7 +58,8 @@ ModalPopup { Component { id: stickerPackPurchaseModal StatusSNTTransactionModal { - contractAddress: utilsModel.stickerMarketAddress + // Not Refactored Yet +// contractAddress: utilsModel.stickerMarketAddress assetPrice: price estimateGasFunction: function(selectedAccount, uuid) { if (packId < 0 || !selectedAccount || !price) return 325000 diff --git a/ui/imports/shared/status/StatusStickersPopup.qml b/ui/imports/shared/status/StatusStickersPopup.qml index 4a3a11d5b..9b4e15f4e 100644 --- a/ui/imports/shared/status/StatusStickersPopup.qml +++ b/ui/imports/shared/status/StatusStickersPopup.qml @@ -41,12 +41,12 @@ Popup { footerContent.visible = true stickersContainer.visible = true } - Connections { - target: chatsModel - onOnlineStatusChanged: { - root.close() - } - } +// Connections { +// target: chatsModel +// onOnlineStatusChanged: { +// root.close() +// } +// } Component.onCompleted: { if (stickersModule.packsLoaded) { diff --git a/ui/imports/shared/views/EnsResolver.qml b/ui/imports/shared/views/EnsResolver.qml index 26d7d2a1f..91af2a13c 100644 --- a/ui/imports/shared/views/EnsResolver.qml +++ b/ui/imports/shared/views/EnsResolver.qml @@ -14,7 +14,8 @@ Item { readonly property var validateAsync: Backpressure.debounce(inpAddress, debounceDelay, function (inputValue) { root.isPending = true var name = inputValue.startsWith("@") ? inputValue.substring(1) : inputValue - chatsModel.ensView.resolveENSWithUUID(name, uuid) + // Not Refactored Yet +// chatsModel.ensView.resolveENSWithUUID(name, uuid) }); signal resolved(string resolvedAddress) @@ -40,14 +41,14 @@ Item { } } - Connections { - target: chatsModel.ensView - onEnsWasResolved: { - if (uuid !== root.uuid) { - return - } - root.isPending = false - root.resolved(resolvedAddress) - } - } +// Connections { +// target: chatsModel.ensView +// onEnsWasResolved: { +// if (uuid !== root.uuid) { +// return +// } +// root.isPending = false +// root.resolved(resolvedAddress) +// } +// } } diff --git a/ui/imports/shared/views/ExistingContacts.qml b/ui/imports/shared/views/ExistingContacts.qml index b269ea522..66d977982 100644 --- a/ui/imports/shared/views/ExistingContacts.qml +++ b/ui/imports/shared/views/ExistingContacts.qml @@ -46,11 +46,12 @@ Item { name: model.name address: model.address identicon: model.thumbnailImage || model.identicon - visible: model.isContact && !model.isBlocked && (root.filterText === "" || - root.matchesAlias(model.name.toLowerCase(), root.filterText.toLowerCase()) || - model.name.toLowerCase().includes(root.filterText.toLowerCase()) || - model.address.toLowerCase().includes(root.filterText.toLowerCase())) && - (!root.hideCommunityMembers || !chatsModel.communities.activeCommunity.hasMember(model.pubKey)) + // Not Refactored Yet +// visible: model.isContact && !model.isBlocked && (root.filterText === "" || +// root.matchesAlias(model.name.toLowerCase(), root.filterText.toLowerCase()) || +// model.name.toLowerCase().includes(root.filterText.toLowerCase()) || +// model.address.toLowerCase().includes(root.filterText.toLowerCase())) && +// (!root.hideCommunityMembers || !chatsModel.communities.activeCommunity.hasMember(model.pubKey)) onContactClicked: function () { root.contactClicked(model) } diff --git a/ui/imports/shared/views/SearchResults.qml b/ui/imports/shared/views/SearchResults.qml index f044d3078..8e0f7b716 100644 --- a/ui/imports/shared/views/SearchResults.qml +++ b/ui/imports/shared/views/SearchResults.qml @@ -42,7 +42,9 @@ Item { } function isContactAdded() { - return pubKey != "" ? chatsModel.messageView.isAddedContact(pubKey) : false + // Not Refactored Yet + return false +// return pubKey != "" ? chatsModel.messageView.isAddedContact(pubKey) : false } width: parent.width @@ -84,7 +86,8 @@ Item { anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left anchors.leftMargin: Style.current.padding - image.source: utilsModel.generateIdenticon(root.pubKey) + // Not Refactored Yet +// image.source: utilsModel.generateIdenticon(root.pubKey) image.isIdenticon: true } diff --git a/ui/imports/shared/views/chat/AcceptTransactionView.qml b/ui/imports/shared/views/chat/AcceptTransactionView.qml index 974924792..abdcc4d72 100644 --- a/ui/imports/shared/views/chat/AcceptTransactionView.qml +++ b/ui/imports/shared/views/chat/AcceptTransactionView.qml @@ -74,11 +74,12 @@ Item { anchors.fill: parent cursorShape: Qt.PointingHandCursor onClicked: { - if (root.state === Constants.addressRequested) { - root.store.chatsModelInst.transactions.declineAddressRequest(messageId) - } else if (root.state === Constants.transactionRequested) { - root.store.chatsModelInst.transactions.declineRequest(messageId) - } + // Not Refactored Yet +// if (root.state === Constants.addressRequested) { +// root.store.chatsModelInst.transactions.declineAddressRequest(messageId) +// } else if (root.state === Constants.transactionRequested) { +// root.store.chatsModelInst.transactions.declineRequest(messageId) +// } } } @@ -97,7 +98,8 @@ Item { SignTransactionModal { store: root.store onOpened: { - root.store.walletModelInst.gasView.getGasPrice() + // Not Refactored Yet +// root.store.walletModelInst.gasView.getGasPrice() } onClosed: { destroy(); @@ -106,8 +108,9 @@ Item { selectedRecipient: { return { address: commandParametersObject.address, - identicon: root.store.chatsModelInst.channelView.activeChannel.identicon, - name: root.store.chatsModelInst.channelView.activeChannel.name, + // Not Refactored Yet +// identicon: root.store.chatsModelInst.channelView.activeChannel.identicon, +// name: root.store.chatsModelInst.channelView.activeChannel.name, type: RecipientSelector.Type.Contact } } @@ -119,11 +122,13 @@ Item { SelectAccountModal { id: selectAccountModal - accounts: root.store.walletModelInst.accountsView.accounts - currency: root.store.walletModelInst.balanceView.defaultCurrency + // Not Refactored Yet +// accounts: root.store.walletModelInst.accountsView.accounts +// currency: root.store.walletModelInst.balanceView.defaultCurrency onSelectAndShareAddressButtonClicked: { - root.store.chatsModelInst.transactions.acceptAddressRequest(messageId, accountSelector.selectedAccount.address) - selectAccountModal.close() + // Not Refactored Yet +// root.store.chatsModelInst.transactions.acceptAddressRequest(messageId, accountSelector.selectedAccount.address) +// selectAccountModal.close() } } } diff --git a/ui/imports/shared/views/chat/InvitationBubbleView.qml b/ui/imports/shared/views/chat/InvitationBubbleView.qml index 83d439f88..32d103c4b 100644 --- a/ui/imports/shared/views/chat/InvitationBubbleView.qml +++ b/ui/imports/shared/views/chat/InvitationBubbleView.qml @@ -23,20 +23,21 @@ Item { property var store function getCommunity() { - try { - const communityJson = root.store.chatsModelInst.communities.list.getCommunityByIdJson(communityId) - if (!communityJson) { - return null - } + // Not Refactored Yet +// try { +// const communityJson = root.store.chatsModelInst.communities.list.getCommunityByIdJson(communityId) +// if (!communityJson) { +// return null +// } - let community = JSON.parse(communityJson); - if (community) { - community.nbMembers = community.members.length; - } - return community - } catch (e) { - console.error("Error parsing community", e) - } +// let community = JSON.parse(communityJson); +// if (community) { +// community.nbMembers = community.members.length; +// } +// return community +// } catch (e) { +// console.error("Error parsing community", e) +// } return null } @@ -45,14 +46,14 @@ Item { root.invitedCommunity = getCommunity() } - Connections { - target: root.store.chatsModelInst.communities - onCommunityChanged: function (communityId) { - if (communityId === root.communityId) { - root.invitedCommunity = getCommunity() - } - } - } +// Connections { +// target: root.store.chatsModelInst.communities +// onCommunityChanged: function (communityId) { +// if (communityId === root.communityId) { +// root.invitedCommunity = getCommunity() +// } +// } +// } Component { id: confirmationPopupComponent @@ -88,7 +89,8 @@ Item { Rectangle { id: rectangleBubble property alias button: joinBtn - property bool isPendingRequest: root.store.chatsModelInst.communities.isCommunityRequestPending(communityId) + // Not Refactored Yet + property bool isPendingRequest: false //root.store.chatsModelInst.communities.isCommunityRequestPending(communityId) width: 270 height: title.height + title.anchors.topMargin + invitedYou.height + invitedYou.anchors.topMargin + @@ -106,7 +108,8 @@ Item { states: [ State { name: "requiresEns" - when: invitedCommunity.ensOnly && !root.store.profileModelInst.profile.ensVerified + // Not Refactored Yet +// when: invitedCommunity.ensOnly && !root.store.profileModelInst.profile.ensVerified PropertyChanges { target: joinBtn //% "Membership requires an ENS username" @@ -172,14 +175,15 @@ Item { } ] - Connections { - target: root.store.chatsModelInst.communities - onMembershipRequestChanged: function(communityId, communityName, requestAccepted) { - if (communityId === root.communityId) { - rectangleBubble.isPendingRequest = false - } - } - } + // Not Refactored Yet +// Connections { +// target: root.store.chatsModelInst.communities +// onMembershipRequestChanged: function(communityId, communityName, requestAccepted) { +// if (communityId === root.communityId) { +// rectangleBubble.isPendingRequest = false +// } +// } +// } // TODO add check if verified StatusBaseText { @@ -201,19 +205,21 @@ Item { StatusBaseText { id: invitedYou text: { - if (root.store.chatsModelInst.channelView.activeChannel.chatType === Constants.chatType.oneToOne) { - return isCurrentUser ? - //% "You invited %1 to join a community" - qsTrId("you-invited--1-to-join-a-community").arg(root.store.chatsModelInst.userNameOrAlias(root.store.chatsModelInst.channelView.activeChannel.id)) - //% "%1 invited you to join a community" - : qsTrId("-1-invited-you-to-join-a-community").arg(displayUserName) - } else { - return isCurrentUser ? - //% "You shared a community" - qsTrId("you-shared-a-community") - //% "A community has been shared" - : qsTrId("a-community-has-been-shared") - } + // Not Refactored Yet + return "" +// if (root.store.chatsModelInst.channelView.activeChannel.chatType === Constants.chatType.oneToOne) { +// return isCurrentUser ? +// //% "You invited %1 to join a community" +// qsTrId("you-invited--1-to-join-a-community").arg(root.store.chatsModelInst.userNameOrAlias(root.store.chatsModelInst.channelView.activeChannel.id)) +// //% "%1 invited you to join a community" +// : qsTrId("-1-invited-you-to-join-a-community").arg(displayUserName) +// } else { +// return isCurrentUser ? +// //% "You shared a community" +// qsTrId("you-shared-a-community") +// //% "A community has been shared" +// : qsTrId("a-community-has-been-shared") +// } } anchors.top: title.bottom anchors.topMargin: 4 @@ -298,33 +304,34 @@ Item { //% "Unsupported state" text: qsTrId("unsupported-state") onClicked: { - let onBtnClick = function(){ - let error + // Not Refactored Yet +// let onBtnClick = function(){ +// let error - if (rectangleBubble.state === "joined") { - root.store.chatsModelInst.communities.setActiveCommunity(communityId); - return - } else if (rectangleBubble.state === "unjoined") { - error = root.store.chatsModelInst.communities.joinCommunity(communityId, true) - } - else if (rectangleBubble.state === "requestToJoin") { - error = root.store.chatsModelInst.communities.requestToJoinCommunity(communityId, userProfile.name) - if (!error) { - rectangleBubble.isPendingRequest = root.store.chatsModelInst.communities.isCommunityRequestPending(communityId) - } - } +// if (rectangleBubble.state === "joined") { +// root.store.chatsModelInst.communities.setActiveCommunity(communityId); +// return +// } else if (rectangleBubble.state === "unjoined") { +// error = root.store.chatsModelInst.communities.joinCommunity(communityId, true) +// } +// else if (rectangleBubble.state === "requestToJoin") { +// error = root.store.chatsModelInst.communities.requestToJoinCommunity(communityId, userProfile.name) +// if (!error) { +// rectangleBubble.isPendingRequest = root.store.chatsModelInst.communities.isCommunityRequestPending(communityId) +// } +// } - if (error) { - joiningError.text = error - return joiningError.open() - } - } +// if (error) { +// joiningError.text = error +// return joiningError.open() +// } +// } - if (localAccountSensitiveSettings.communitiesEnabled) { - onBtnClick(); - } else { - Global.openPopup(confirmationPopupComponent, { onConfirmed: onBtnClick }); - } +// if (localAccountSensitiveSettings.communitiesEnabled) { +// onBtnClick(); +// } else { +// Global.openPopup(confirmationPopupComponent, { onConfirmed: onBtnClick }); +// } } MessageDialog { diff --git a/ui/imports/shared/views/chat/LinksMessageView.qml b/ui/imports/shared/views/chat/LinksMessageView.qml index 4788ce6ff..f8462221e 100644 --- a/ui/imports/shared/views/chat/LinksMessageView.qml +++ b/ui/imports/shared/views/chat/LinksMessageView.qml @@ -64,62 +64,65 @@ Column { linkMessageLoader.sourceComponent = linkMessageLoader.getSourceComponent() } } - Connections { - id: linkFetchConnections - enabled: false - target: root.store.chatsModelInst - onLinkPreviewDataWasReceived: { - let response - try { - response = JSON.parse(previewData) - } catch (e) { - console.error(previewData, e) - return - } + // Not Refactored Yet +// Connections { +// id: linkFetchConnections +// enabled: false +// target: root.store.chatsModelInst +// onLinkPreviewDataWasReceived: { +// let response +// try { +// response = JSON.parse(previewData) + +// } catch (e) { +// console.error(previewData, e) +// return +// } - if (response.uuid !== linkMessageLoader.uuid) return +// if (response.uuid !== linkMessageLoader.uuid) return - linkFetchConnections.enabled = false +// linkFetchConnections.enabled = false - if (!response.success) { - console.error(response.result.error) - return undefined - } +// if (!response.success) { +// console.error(response.result.error) +// return undefined +// } - linkData = response.result +// linkData = response.result - if (linkData.contentType.startsWith("image/")) { - return linkMessageLoader.sourceComponent = unfurledImageComponent - } - if (linkData.site && linkData.title) { - linkData.address = link - return linkMessageLoader.sourceComponent = unfurledLinkComponent - } - } - } +// if (linkData.contentType.startsWith("image/")) { +// return linkMessageLoader.sourceComponent = unfurledImageComponent +// } +// if (linkData.site && linkData.title) { +// linkData.address = link +// return linkMessageLoader.sourceComponent = unfurledLinkComponent +// } +// } +// } - Connections { - id: linkCommunityFetchConnections - enabled: false - target: root.store.chatsModelInst.communities - onCommunityAdded: { - if (communityId !== linkData.communityId) { - return - } - linkCommunityFetchConnections.enabled = false - const data = Utils.getLinkDataForStatusLinks(link) - if (data) { - linkData = data - if (!data.fetching && data.communityId) { - return linkMessageLoader.sourceComponent = invitationBubble - } + // Not Refactored Yet +// Connections { +// id: linkCommunityFetchConnections +// enabled: false +// target: root.store.chatsModelInst.communities +// onCommunityAdded: { +// if (communityId !== linkData.communityId) { +// return +// } +// linkCommunityFetchConnections.enabled = false +// const data = Utils.getLinkDataForStatusLinks(link) +// if (data) { +// linkData = data +// if (!data.fetching && data.communityId) { +// return linkMessageLoader.sourceComponent = invitationBubble +// } - return linkMessageLoader.sourceComponent = unfurledLinkComponent - } - } - } +// return linkMessageLoader.sourceComponent = unfurledLinkComponent +// } +// } +// } function getSourceComponent() { // Reset the height in case we set it to 0 below. See note below @@ -181,7 +184,9 @@ Column { } linkFetchConnections.enabled = true - return root.store.chatsModelInst.getLinkPreviewData(link, linkMessageLoader.uuid) + // Not Refactored Yet + return "" +// return root.store.chatsModelInst.getLinkPreviewData(link, linkMessageLoader.uuid) } // setting the height to 0 allows the "enable link" dialog to // disappear correctly when localAccountSensitiveSettings.neverAskAboutUnfurlingAgain diff --git a/ui/imports/shared/views/chat/MessageContextMenuView.qml b/ui/imports/shared/views/chat/MessageContextMenuView.qml index dff9e5bcc..1303e0da3 100644 --- a/ui/imports/shared/views/chat/MessageContextMenuView.qml +++ b/ui/imports/shared/views/chat/MessageContextMenuView.qml @@ -48,8 +48,10 @@ StatusPopupMenu { property var setXPosition: function() {return 0} property var setYPosition: function() {return 0} property bool canPin: { - const nbPinnedMessages = root.store.chatsModelInst.messageView.pinnedMessagesList.count - return nbPinnedMessages < Constants.maxNumberOfPins + // Not Refactored Yet + return false +// const nbPinnedMessages = root.store.chatsModelInst.messageView.pinnedMessagesList.count +// return nbPinnedMessages < Constants.maxNumberOfPins } onHeightChanged: { @@ -107,7 +109,8 @@ StatusPopupMenu { emojiId: model.emojiId reactedByUser: !!root.emojiReactionsReactedByUser[model.emojiId] onCloseModal: { - chatsModel.toggleReaction(SelectedMessage.messageId, emojiId) + // Not Refactored Yet +// chatsModel.toggleReaction(SelectedMessage.messageId, emojiId) root.close() } } @@ -137,7 +140,8 @@ StatusPopupMenu { StyledText { id: username - text: Utils.removeStatusEns(isCurrentUser ? root.store.profileModelInst.ens.preferredUsername || userName : userName) + // Not Refactored Yet +// text: Utils.removeStatusEns(isCurrentUser ? root.store.profileModelInst.ens.preferredUsername || userName : userName) elide: Text.ElideRight maximumLineCount: 3 horizontalAlignment: Text.AlignHCenter @@ -220,7 +224,8 @@ StatusPopupMenu { id: copyImageAction text: qsTr("Copy image") onTriggered: { - root.store.chatsModelInst.copyImageToClipboard(imageSource ? imageSource : "") + // Not Refactored Yet +// root.store.chatsModelInst.copyImageToClipboard(imageSource ? imageSource : "") root.close() } icon.name: "copy" @@ -287,7 +292,8 @@ StatusPopupMenu { icon.name: "chat" enabled: store.isDebugEnabled onTriggered: { - root.store.chatsModelInst.copyToClipboard(SelectedMessage.messageId) + // Not Refactored Yet +// root.store.chatsModelInst.copyToClipboard(SelectedMessage.messageId) close() } } @@ -305,7 +311,8 @@ StatusPopupMenu { } onTriggered: { if (pinnedMessage) { - root.store.chatsModelInst.messageView.unPinMessage(messageId, root.store.chatsModelInst.channelView.activeChannel.id) + // Not Refactored Yet +// root.store.chatsModelInst.messageView.unPinMessage(messageId, root.store.chatsModelInst.channelView.activeChannel.id) return } @@ -315,7 +322,8 @@ StatusPopupMenu { return } - root.store.chatsModelInst.messageView.pinMessage(messageId, root.store.chatsModelInst.channelView.activeChannel.id) + // Not Refactored Yet +// root.store.chatsModelInst.messageView.pinMessage(messageId, root.store.chatsModelInst.channelView.activeChannel.id) root.close() } icon.name: "pin" @@ -323,13 +331,14 @@ StatusPopupMenu { if(isProfile || emojiOnly || isRightClickOnImage) return false - switch (root.store.chatsModelInst.channelView.activeChannel.chatType) { - case Constants.chatType.publicChat: return false - case Constants.chatType.profile: return false - case Constants.chatType.oneToOne: return true - case Constants.chatType.privateGroupChat: return root.store.chatsModelInst.channelView.activeChannel.isAdmin(userProfile.pubKey) - case Constants.chatType.communityChat: return root.store.chatsModelInst.communities.activeCommunity.admin - } + // Not Refactored Yet +// switch (root.store.chatsModelInst.channelView.activeChannel.chatType) { +// case Constants.chatType.publicChat: return false +// case Constants.chatType.profile: return false +// case Constants.chatType.oneToOne: return true +// case Constants.chatType.privateGroupChat: return root.store.chatsModelInst.channelView.activeChannel.isAdmin(userProfile.pubKey) +// case Constants.chatType.communityChat: return root.store.chatsModelInst.communities.activeCommunity.admin +// } return false } @@ -352,7 +361,8 @@ StatusPopupMenu { text: qsTrId("delete-message") onTriggered: { if (!localAccountSensitiveSettings.showDeleteMessageWarning) { - return root.store.chatsModelInst.messageView.deleteMessage(messageId) + // Not Refactored Yet +// return root.store.chatsModelInst.messageView.deleteMessage(messageId) } let confirmationDialog = openPopup(genericConfirmationDialog, { @@ -368,7 +378,8 @@ StatusPopupMenu { } confirmationDialog.close() - root.store.chatsModelInst.messageView.deleteMessage(messageId) + // Not Refactored Yet +// root.store.chatsModelInst.messageView.deleteMessage(messageId) } }) } @@ -393,7 +404,8 @@ StatusPopupMenu { selectFolder: true modality: Qt.NonModal onAccepted: { - root.store.chatsModelInst.downloadImage(imageSource ? imageSource : "", fileDialog.fileUrls) + // Not Refactored Yet +// root.store.chatsModelInst.downloadImage(imageSource ? imageSource : "", fileDialog.fileUrls) fileDialog.close() } onRejected: { diff --git a/ui/imports/shared/views/chat/StatusUpdateView.qml b/ui/imports/shared/views/chat/StatusUpdateView.qml index de9cf9016..4e460413c 100644 --- a/ui/imports/shared/views/chat/StatusUpdateView.qml +++ b/ui/imports/shared/views/chat/StatusUpdateView.qml @@ -189,7 +189,8 @@ MouseArea { messageContextMenu.setXPosition = function() { return (messageContextMenu.parent.x + 4)} messageContextMenu.setYPosition = function() { return (-messageContextMenu.height - 4)} } - onToggleReaction: chatsModel.toggleReaction(messageId, emojiID) + // Not Refactored Yet +// onToggleReaction: chatsModel.toggleReaction(messageId, emojiID) // onSetMessageActive: { // root.setMessageActive(messageId, active);; diff --git a/ui/imports/shared/views/chat/TransactionBubbleView.qml b/ui/imports/shared/views/chat/TransactionBubbleView.qml index 1d5101f0e..8a0595e91 100644 --- a/ui/imports/shared/views/chat/TransactionBubbleView.qml +++ b/ui/imports/shared/views/chat/TransactionBubbleView.qml @@ -4,7 +4,6 @@ import shared 1.0 import shared.panels 1.0 import shared.popups 1.0 import shared.views.chat 1.0 -import shared.controls 1.0 import shared.controls.chat 1.0 Item { @@ -40,8 +39,10 @@ Item { if (!tokenAmount || !token.symbol) { return "0" } - var defaultFiatSymbol = root.store.walletModelInst.balanceView.defaultCurrency - return root.store.walletModelInst.balanceView.getFiatValue(tokenAmount, token.symbol, defaultFiatSymbol) + " " + defaultFiatSymbol.toUpperCase() + // Not Refactored Yet +// var defaultFiatSymbol = root.store.walletModelInst.balanceView.defaultCurrency +// return root.store.walletModelInst.balanceView.getFiatValue(tokenAmount, token.symbol, defaultFiatSymbol) + " " + defaultFiatSymbol.toUpperCase() + return "0" } property int state: commandParametersObject.commandState @@ -190,7 +191,8 @@ Item { SendTransactionButton { // outgoing: root.outgoing - acc: root.store.currentAccount + // Not Refactored Yet +// acc: root.store.walletModelInst.accountsView.focusedAccount selectedAsset: token selectedAmount: tokenAmount selectedFiatAmount: fiatValue @@ -198,19 +200,21 @@ Item { selectedRecipient: { return { address: commandParametersObject.address, - identicon: root.store.chatsModelInst.channelView.activeChannel.identicon, - name: root.store.chatsModelInst.channelView.activeChannel.name, + // Not Refactored Yet +// identicon: root.store.chatsModelInst.channelView.activeChannel.identicon, +// name: root.store.chatsModelInst.channelView.activeChannel.name, type: RecipientSelector.Type.Contact } } onSendTransaction: { - root.store.walletModelInst.accountsView.setFocusedAccountByAddress(fromAddress); - Global.openPopup(signTxComponent, {selectedAccount: { - name: acc.name, - address: fromAddress, - iconColor: acc.iconColor, - assets: acc.assets - }}) + // Not Refactored Yet +// root.store.walletModelInst.accountsView.setFocusedAccountByAddress(fromAddress); +// Global.openPopup(signTxComponent, {selectedAccount: { +// name: acc.name, +// address: fromAddress, +// iconColor: acc.iconColor, +// assets: acc.assets +// }}) } } } @@ -218,21 +222,18 @@ Item { Component { id: signTxComponent SignTransactionModal { - anchors.centerIn: parent store: root.store - selectedAsset: token - selectedAmount: tokenAmount - selectedRecipient: { - return { - address: commandParametersObject.address, - identicon: root.store.chatsModelInst.channelView.activeChannel.identicon, - name: root.store.chatsModelInst.channelView.activeChannel.name, - type: RecipientSelector.Type.Contact - } + selectedAsset: root.selectedAsset + selectedAmount: root.selectedAmount + selectedRecipient: root.selectedRecipient + selectedFiatAmount: root.selectedFiatAmount + onOpened: { + // Not Refactored Yet +// root.store.walletModelInst.gasView.getGasPrice(); + } + onClosed: { + destroy(); } - selectedFiatAmount: fiatValue - onOpened: root.store.walletModelInst.gasView.getGasPrice(); - onClosed: destroy(); } } diff --git a/ui/imports/utils/Utils.qml b/ui/imports/utils/Utils.qml index b23b338ff..a516aaf89 100644 --- a/ui/imports/utils/Utils.qml +++ b/ui/imports/utils/Utils.qml @@ -131,7 +131,9 @@ QtObject { } if (contactIndex === -1) { - return utilsModel.generateAlias(publicKey) + // Not Refactored Yet + return "" +// return utilsModel.generateAlias(publicKey) } const ensVerified = contactsModule.model.list.rowData(contactIndex, 'ensVerified') if (!ensVerified) { @@ -420,7 +422,8 @@ QtObject { let chatCommunitySectionModule = mainModule.getChatSectionModule() chatCommunitySectionModule.createOneToOneChat(pk, "") } else { - chatsModel.channelView.joinWithENS(pk); + // Not Refactored Yet +// chatsModel.channelView.joinWithENS(pk); } } return result @@ -431,11 +434,13 @@ QtObject { if (index > -1) { const communityId = link.substring(index + 3) - const communityName = chatsModel.communities.getCommunityNameById(communityId) + // Not Refactored Yet + const communityName = "" //chatsModel.communities.getCommunityNameById(communityId) if (!communityName) { + // Not Refactored Yet // Unknown community, fetch the info if possible - chatsModel.communities.requestCommunityInfo(communityId) +// chatsModel.communities.requestCommunityInfo(communityId) result.communityId = communityId result.fetching = true return result @@ -445,15 +450,19 @@ QtObject { result.title = qsTrId("join-the--1-community").arg(communityName) result.communityId = communityId result.callback = function () { - const isUserMemberOfCommunity = chatsModel.communities.isUserMemberOfCommunity(communityId) + // Not Refactored Yet + const isUserMemberOfCommunity = ""//chatsModel.communities.isUserMemberOfCommunity(communityId) if (isUserMemberOfCommunity) { - chatsModel.communities.setActiveCommunity(communityId) + // Not Refactored Yet +// chatsModel.communities.setActiveCommunity(communityId) return } - const userCanJoin = chatsModel.communities.userCanJoin(communityId) + // Not Refactored Yet + const userCanJoin = "" //chatsModel.communities.userCanJoin(communityId) // TODO find what to do when you can't join if (userCanJoin) { - chatsModel.communities.joinCommunity(communityId, true) + // Not Refactored Yet +// chatsModel.communities.joinCommunity(communityId, true) } } return result @@ -471,7 +480,8 @@ QtObject { //% "Join the %1 group chat" result.title = qsTrId("join-the--1-group-chat").arg(chatName) result.callback = function () { - chatsModel.groups.joinGroupChatFromInvitation(chatName, chatId, pubKey); + // Not Refactored Yet +// chatsModel.groups.joinGroupChatFromInvitation(chatName, chatId, pubKey); } return result diff --git a/ui/main.qml b/ui/main.qml index ef32f0ce1..48259a901 100644 --- a/ui/main.qml +++ b/ui/main.qml @@ -160,21 +160,22 @@ StatusWindow { onEventReceived: { let event = JSON.parse(eventStr) if (event.hasOwnProperty("uri")) { - chatsModel.handleProtocolUri(event.uri) + // Not Refactored Yet +// chatsModel.handleProtocolUri(event.uri) } else { console.warn("Unknown event received: " + eventStr) } } } - Connections { - target: profileModel - ignoreUnknownSignals: true - enabled: removeMnemonicAfterLogin - onInitialized: { - mnemonicModule.remove() - } - } +// Connections { +// target: profileModel +// ignoreUnknownSignals: true +// enabled: removeMnemonicAfterLogin +// onInitialized: { +// mnemonicModule.remove() +// } +// } // The easiest way to get current system theme (is it light or dark) without using // OS native methods is to check lightness (0 - 1.0) of the window color. @@ -420,22 +421,24 @@ StatusWindow { signal droppedOnValidScreen(var drop) property alias droppedUrls: rptDraggedPreviews.model - property bool enabled: !drag.source && !!loader.item && !!loader.item.appLayout && - ( - // in chat view - (loader.item.appLayout.appView.currentIndex === Constants.appViewStackIndex.chat && - ( - // in a one-to-one chat - chatsModel.channelView.activeChannel.chatType === Constants.chatType.oneToOne || - // in a private group chat - chatsModel.channelView.activeChannel.chatType === Constants.chatType.privateGroupChat - ) - ) || - // in timeline view - loader.item.appLayout.appView.currentIndex === Constants.appViewStackIndex.timeline || - // In community section - chatsModel.communities.activeCommunity.active - ) + property bool enabled: !drag.source && !!loader.item && !!loader.item.appLayout + + // Not Refactored Yet +// && ( +// // in chat view +// (loader.item.appLayout.appView.currentIndex === Constants.appViewStackIndex.chat && +// ( +// // in a one-to-one chat +// chatsModel.channelView.activeChannel.chatType === Constants.chatType.oneToOne || +// // in a private group chat +// chatsModel.channelView.activeChannel.chatType === Constants.chatType.privateGroupChat +// ) +// ) || +// // in timeline view +// loader.item.appLayout.appView.currentIndex === Constants.appViewStackIndex.timeline || +// // In community section +// chatsModel.communities.activeCommunity.active +// ) width: applicationWindow.width height: applicationWindow.height diff --git a/ui/shared/status/StatusIconTabButton.qml b/ui/shared/status/StatusIconTabButton.qml index 5b8d70196..e0622c1d6 100644 --- a/ui/shared/status/StatusIconTabButton.qml +++ b/ui/shared/status/StatusIconTabButton.qml @@ -28,7 +28,8 @@ TabButton { return } - chatsModel.communities.activeCommunity.active = false + // Not Refactored Yet +// chatsModel.communities.activeCommunity.active = false Global.changeAppSectionBySectionType(section) }