parent
ddfa3d3e4e
commit
d073dd215a
|
@ -92,6 +92,12 @@ QtObject:
|
||||||
proc copyToClipboard*(self: Utils, content: string) {.slot.} =
|
proc copyToClipboard*(self: Utils, content: string) {.slot.} =
|
||||||
setClipBoardText(content)
|
setClipBoardText(content)
|
||||||
|
|
||||||
|
proc copyImageToClipboard*(self: Utils, content: string) {.slot.} =
|
||||||
|
setClipBoardImage(content)
|
||||||
|
|
||||||
|
proc downloadImage*(self: Utils, content: string, path: string) {.slot.} =
|
||||||
|
downloadImage(content, path)
|
||||||
|
|
||||||
proc generateQRCodeSVG*(self: Utils, text: string, border: int = 0): string =
|
proc generateQRCodeSVG*(self: Utils, text: string, border: int = 0): string =
|
||||||
var qr0: array[0..qrcodegen_BUFFER_LEN_MAX, uint8]
|
var qr0: array[0..qrcodegen_BUFFER_LEN_MAX, uint8]
|
||||||
var tempBuffer: array[0..qrcodegen_BUFFER_LEN_MAX, uint8]
|
var tempBuffer: array[0..qrcodegen_BUFFER_LEN_MAX, uint8]
|
||||||
|
|
|
@ -170,6 +170,7 @@ StatusAppThreePanelLayout {
|
||||||
|
|
||||||
MessageContextMenuView {
|
MessageContextMenuView {
|
||||||
id: quickActionMessageOptionsMenu
|
id: quickActionMessageOptionsMenu
|
||||||
|
store: root.rootStore
|
||||||
|
|
||||||
onOpenProfileClicked: {
|
onOpenProfileClicked: {
|
||||||
Global.openProfilePopup(publicKey)
|
Global.openProfilePopup(publicKey)
|
||||||
|
|
|
@ -180,7 +180,7 @@ StatusModal {
|
||||||
//% "Pinned messages"
|
//% "Pinned messages"
|
||||||
text: qsTrId("pinned-messages")
|
text: qsTrId("pinned-messages")
|
||||||
currentValue: pinnedCount
|
currentValue: pinnedCount
|
||||||
onClicked: Global.openPopup(pinnedMessagesPopupComponent)
|
onClicked: Global.openPopup(pinnedMessagesPopupComponent, {store: popup.store})
|
||||||
iconSource: Style.svg("pin")
|
iconSource: Style.svg("pin")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ import StatusQ.Controls 0.1 as StatusQControls
|
||||||
ModalPopup {
|
ModalPopup {
|
||||||
id: popup
|
id: popup
|
||||||
|
|
||||||
|
property var store
|
||||||
property var messageStore
|
property var messageStore
|
||||||
property var pinnedMessagesModel //this doesn't belong to the messageStore, it is a part of the ChatContentStore, but we didn't introduce it yet.
|
property var pinnedMessagesModel //this doesn't belong to the messageStore, it is a part of the ChatContentStore, but we didn't introduce it yet.
|
||||||
property string messageToPin
|
property string messageToPin
|
||||||
|
@ -167,6 +168,7 @@ ModalPopup {
|
||||||
MessageContextMenuView {
|
MessageContextMenuView {
|
||||||
id: msgContextMenu
|
id: msgContextMenu
|
||||||
reactionModel: popup.emojiReactionsModel
|
reactionModel: popup.emojiReactionsModel
|
||||||
|
store: popup.store
|
||||||
pinnedPopup: true
|
pinnedPopup: true
|
||||||
pinnedMessage: true
|
pinnedMessage: true
|
||||||
onShouldCloseParentPopup: {
|
onShouldCloseParentPopup: {
|
||||||
|
|
|
@ -103,6 +103,14 @@ QtObject {
|
||||||
globalUtilsInst.copyToClipboard(text)
|
globalUtilsInst.copyToClipboard(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function copyImageToClipboard(content) {
|
||||||
|
globalUtilsInst.copyImageToClipboard(content)
|
||||||
|
}
|
||||||
|
|
||||||
|
function downloadImage(content, path) {
|
||||||
|
globalUtilsInst.downloadImage(content, path)
|
||||||
|
}
|
||||||
|
|
||||||
function getCommunity(communityId) {
|
function getCommunity(communityId) {
|
||||||
// Not Refactored Yet
|
// Not Refactored Yet
|
||||||
// try {
|
// try {
|
||||||
|
|
|
@ -133,6 +133,7 @@ Item {
|
||||||
|
|
||||||
MessageContextMenuView {
|
MessageContextMenuView {
|
||||||
id: contextmenu
|
id: contextmenu
|
||||||
|
store: root.rootStore
|
||||||
reactionModel: root.rootStore.emojiReactionsModel
|
reactionModel: root.rootStore.emojiReactionsModel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,7 @@ ColumnLayout {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
Global.openPopup(pinnedMessagesPopupComponent, {
|
Global.openPopup(pinnedMessagesPopupComponent, {
|
||||||
|
store: rootStore,
|
||||||
messageStore: messageStore,
|
messageStore: messageStore,
|
||||||
pinnedMessagesModel: chatContentModule.pinnedMessagesModel,
|
pinnedMessagesModel: chatContentModule.pinnedMessagesModel,
|
||||||
messageToPin: ""
|
messageToPin: ""
|
||||||
|
@ -228,6 +229,7 @@ ColumnLayout {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
Global.openPopup(pinnedMessagesPopupComponent, {
|
Global.openPopup(pinnedMessagesPopupComponent, {
|
||||||
|
store: rootStore,
|
||||||
messageStore: messageStore,
|
messageStore: messageStore,
|
||||||
pinnedMessagesModel: chatContentModule.pinnedMessagesModel,
|
pinnedMessagesModel: chatContentModule.pinnedMessagesModel,
|
||||||
messageToPin: ""
|
messageToPin: ""
|
||||||
|
@ -307,6 +309,7 @@ ColumnLayout {
|
||||||
|
|
||||||
MessageContextMenuView {
|
MessageContextMenuView {
|
||||||
id: contextmenu
|
id: contextmenu
|
||||||
|
store: chatContentRoot.rootStore
|
||||||
reactionModel: chatContentRoot.rootStore.emojiReactionsModel
|
reactionModel: chatContentRoot.rootStore.emojiReactionsModel
|
||||||
onPinMessage: {
|
onPinMessage: {
|
||||||
messageStore.pinMessage(messageId)
|
messageStore.pinMessage(messageId)
|
||||||
|
@ -322,6 +325,7 @@ ColumnLayout {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
Global.openPopup(pinnedMessagesPopupComponent, {
|
Global.openPopup(pinnedMessagesPopupComponent, {
|
||||||
|
store: rootStore,
|
||||||
messageStore: messageStore,
|
messageStore: messageStore,
|
||||||
pinnedMessagesModel: chatContentModule.pinnedMessagesModel,
|
pinnedMessagesModel: chatContentModule.pinnedMessagesModel,
|
||||||
messageToPin: messageId
|
messageToPin: messageId
|
||||||
|
|
|
@ -326,6 +326,7 @@ Item {
|
||||||
chatCommunitySectionModule.prepareChatContentModuleForChatId(chatId)
|
chatCommunitySectionModule.prepareChatContentModuleForChatId(chatId)
|
||||||
let chatContentModule = chatCommunitySectionModule.getChatContentModule()
|
let chatContentModule = chatCommunitySectionModule.getChatContentModule()
|
||||||
Global.openPopup(pinnedMessagesPopupComponent, {
|
Global.openPopup(pinnedMessagesPopupComponent, {
|
||||||
|
store: root.store,
|
||||||
messageStore: messageStore,
|
messageStore: messageStore,
|
||||||
pinnedMessagesModel: chatContentModule.pinnedMessagesModel,
|
pinnedMessagesModel: chatContentModule.pinnedMessagesModel,
|
||||||
messageToPin: ""
|
messageToPin: ""
|
||||||
|
|
|
@ -301,6 +301,7 @@ Item {
|
||||||
chatCommunitySectionModule.prepareChatContentModuleForChatId(chatId)
|
chatCommunitySectionModule.prepareChatContentModuleForChatId(chatId)
|
||||||
let chatContentModule = chatCommunitySectionModule.getChatContentModule()
|
let chatContentModule = chatCommunitySectionModule.getChatContentModule()
|
||||||
Global.openPopup(pinnedMessagesPopupComponent, {
|
Global.openPopup(pinnedMessagesPopupComponent, {
|
||||||
|
store: root.store,
|
||||||
messageStore: messageStore,
|
messageStore: messageStore,
|
||||||
pinnedMessagesModel: chatContentModule.pinnedMessagesModel,
|
pinnedMessagesModel: chatContentModule.pinnedMessagesModel,
|
||||||
messageToPin: ""
|
messageToPin: ""
|
||||||
|
|
|
@ -18,6 +18,7 @@ StatusPopupMenu {
|
||||||
id: root
|
id: root
|
||||||
width: emojiContainer.visible ? emojiContainer.width : 176
|
width: emojiContainer.visible ? emojiContainer.width : 176
|
||||||
|
|
||||||
|
property var store
|
||||||
property var reactionModel
|
property var reactionModel
|
||||||
property alias emojiContainer: emojiContainer
|
property alias emojiContainer: emojiContainer
|
||||||
|
|
||||||
|
@ -173,8 +174,9 @@ StatusPopupMenu {
|
||||||
id: copyImageAction
|
id: copyImageAction
|
||||||
text: qsTr("Copy image")
|
text: qsTr("Copy image")
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
// Not Refactored Yet - Should be in GlobalUtils
|
if (root.imageSource) {
|
||||||
// root.store.chatsModelInst.copyImageToClipboard(imageSource ? imageSource : "")
|
root.store.copyImageToClipboard(root.imageSource)
|
||||||
|
}
|
||||||
root.close()
|
root.close()
|
||||||
}
|
}
|
||||||
icon.name: "copy"
|
icon.name: "copy"
|
||||||
|
@ -248,8 +250,7 @@ StatusPopupMenu {
|
||||||
icon.name: "chat"
|
icon.name: "chat"
|
||||||
enabled: root.isDebugEnabled
|
enabled: root.isDebugEnabled
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
// Not Refactored Yet - Should be in GlobalUtils
|
root.store.copyToClipboard(SelectedMessage.messageId)
|
||||||
// root.store.chatsModelInst.copyToClipboard(SelectedMessage.messageId)
|
|
||||||
close()
|
close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -353,8 +354,9 @@ StatusPopupMenu {
|
||||||
selectFolder: true
|
selectFolder: true
|
||||||
modality: Qt.NonModal
|
modality: Qt.NonModal
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
// Not Refactored Yet - Should be in GlobalUtils
|
if (root.imageSource) {
|
||||||
// root.store.chatsModelInst.downloadImage(imageSource ? imageSource : "", fileDialog.fileUrls)
|
root.store.downloadImage(root.imageSource, fileDialog.fileUrls)
|
||||||
|
}
|
||||||
fileDialog.close()
|
fileDialog.close()
|
||||||
}
|
}
|
||||||
onRejected: {
|
onRejected: {
|
||||||
|
|
Loading…
Reference in New Issue