Using ClipboardUtils.setText instead of nim's copyToClipboard

This commit is contained in:
Michał Cieślak 2024-08-27 16:35:52 +02:00 committed by Michał
parent 7757f4e615
commit a8940a71f5
42 changed files with 72 additions and 267 deletions

View File

@ -47,9 +47,6 @@ SplitView {
{colorId: 19, segmentLength: 2}])
}
function copyToClipboard(text) {
}
Component.onCompleted: {
Utils.globalUtilsInst = this
globalUtilsReady = true

View File

@ -361,9 +361,6 @@ SplitView {
function getQrCodeSource() {
return "https://upload.wikimedia.org/wikipedia/commons/4/41/QR_Code_Example.svg"
}
function copyToClipboard(text) {
logs.logEvent("profileStore::copyToClipboard", ["text"], arguments)
}
}
contactsStore: ProfileStores.ContactsStore {

View File

@ -23,10 +23,6 @@ QtObject {
property var getGasEthValue
property var flatNetworks
function copyToClipboard(text) {
console.warn("STUB: copyToClipboard:", text)
}
function setNeverAskAboutUnfurlingAgain(value) {
console.log("STUB: setNeverAskAboutUnfurlingAgain:", value)
neverAskAboutUnfurlingAgain = value

View File

@ -39,7 +39,7 @@ import StatusQ.Controls 0.1
autHideCopyIcon: true
expanded: false
onDoCopy: (address) => root.store.copyToClipboard(address)
onDoCopy: (address) => ClipboardUtils.setText(address)
}
\endqml
For a list of components available see StatusQ.

View File

@ -156,10 +156,6 @@ QtObject {
return chatCommunitySectionModule.getChatContentModule()
}
function copyToClipboard(text) {
globalUtils.copyToClipboard(text)
}
// Contact requests related part
property var contactRequestsModel: chatCommunitySectionModule.contactRequestsModel

View File

@ -1,6 +1,7 @@
import QtQuick 2.14
import QtQuick.Layouts 1.4
import StatusQ 0.1
import StatusQ.Components 0.1
import StatusQ.Controls 0.1
import StatusQ.Popups 0.1
@ -93,7 +94,7 @@ ColumnLayout {
asset.name: "copy"
iconButton.onClicked: {
let link = Utils.getCommunityShareLink(root.community.id)
Utils.copyToClipboard(link)
ClipboardUtils.setText(link)
tooltip.visible = !tooltip.visible
}
}

View File

@ -2,6 +2,7 @@ import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import StatusQ 0.1
import StatusQ.Controls 0.1
import StatusQ.Popups 0.1
@ -63,9 +64,7 @@ StatusModal {
root.community.spectated ? communitySectionModule.leaveCommunity()
: Global.leaveCommunityRequested(root.community.name, root.community.id, root.community.outroMessage)
}
onCopyToClipboard: {
Utils.copyToClipboard(link);
}
onCopyToClipboard: ClipboardUtils.setText(link)
}
}
}

View File

@ -72,10 +72,6 @@ QtObject {
return ensUsernamesModule.getSigningPhrase()
}
function copyToClipboard(value) {
globalUtils.copyToClipboard(value)
}
function authenticateAndReleaseEns(chainId, ensUsername, address, gas, gasPrice, maxPriorityFeePerGas, maxFeePerGas, eip1559Enabled) {
if(!root.ensUsernamesModule)
return ""

View File

@ -79,10 +79,6 @@ QtObject {
return globalUtils.qrCode(text)
}
function copyToClipboard(value) {
globalUtils.copyToClipboard(value)
}
function saveProfileIdentityChanges(displayName, bio, imageInfo) {
const changes = Object.assign({},
displayName !== undefined && { displayName },

View File

@ -176,10 +176,6 @@ QtObject {
return networksModuleInst.getNetworkShortNames(chainIds)
}
function copyToClipboard(textToCopy) {
globalUtils.copyToClipboard(textToCopy)
}
function getNetworkData(combinedNetwork) {
return {
prod: {chainId: combinedNetwork.prod.chainId,

View File

@ -2,6 +2,7 @@ import QtQuick 2.14
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.14
import StatusQ 0.1
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1 as StatusQControls
@ -98,7 +99,7 @@ Item {
asset.name: "copy"
tooltip.text: qsTr("Copied to clipboard!")
iconButton.onClicked: {
root.ensUsernamesStore.copyToClipboard(subTitle)
ClipboardUtils.setText(subTitle)
tooltip.visible = !tooltip.visible
}
}
@ -111,7 +112,7 @@ Item {
asset.name: "copy"
tooltip.text: qsTr("Copied to clipboard!")
iconButton.onClicked: {
root.ensUsernamesStore.copyToClipboard(subTitle)
ClipboardUtils.setText(subTitle)
tooltip.visible = !tooltip.visible
}
}

View File

@ -307,7 +307,7 @@ Item {
tooltip.text: qsTr("Copied to clipboard!")
asset.name: "copy"
iconButton.onClicked: {
root.ensUsernamesStore.copyToClipboard(subTitle)
ClipboardUtils.setText(subTitle)
tooltip.visible = !tooltip.visible
}
anchors.top: ensUsername.bottom
@ -324,7 +324,7 @@ Item {
tooltip.text: qsTr("Copied to clipboard!")
asset.name: "copy"
iconButton.onClicked: {
root.ensUsernamesStore.copyToClipboard(root.ensUsernamesStore.pubkey)
ClipboardUtils.setText(subTitle)
tooltip.visible = !tooltip.visible
}
anchors.top: walletAddressLbl.bottom

View File

@ -148,7 +148,7 @@ StatusDialog {
CopyToClipBoardButton {
id: copyToClipboardButton
onCopyClicked: root.walletStore.copyToClipboard(textToCopy)
onCopyClicked: ClipboardUtils.setText(textToCopy)
onPressed: function() {
let copiedText = "Total" + '\t' + d.totalFilteredCalls + " of " + d.totalCalls + '\n' + '\n'
for (let i = 0; i < resultsListView.model.count; i++) {

View File

@ -1,6 +1,7 @@
import QtQuick 2.13
import QtQuick.Layouts 1.13
import StatusQ 0.1
import StatusQ.Controls 0.1
import StatusQ.Components 0.1
import StatusQ.Core 0.1
@ -197,7 +198,7 @@ ColumnLayout {
copyButtonEnabled: true
title: qsTr("Derivation Path")
subTitle: !!root.account? Utils.getPathForDisplay(root.account.path) : ""
onCopyClicked: root.walletStore.copyToClipboard(!!root.account? root.account.path : "")
onCopyClicked: ClipboardUtils.setText(!!root.account? root.account.path : "")
visible: !!subTitle && !d.privateKeyAccount && !d.watchOnlyAccount
}
Separator {
@ -333,7 +334,7 @@ ColumnLayout {
areTestNetworksEnabled: root.walletStore.areTestNetworksEnabled
isGoerliEnabled: root.walletStore.isGoerliEnabled
preferredSharedNetworkNamesArray: d.preferredSharingNetworkShortNames.split(":").filter(Boolean)
onCopyToClipboard: root.walletStore.copyToClipboard(address)
onCopyToClipboard: ClipboardUtils.setText(address)
}
WalletKeypairAccountMenu {

View File

@ -3,10 +3,11 @@ import QtQuick.Layouts 1.13
import utils 1.0
import StatusQ 0.1
import StatusQ.Components 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Core 0.1
import StatusQ.Controls 0.1
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import shared.controls 1.0
@ -156,7 +157,7 @@ ColumnLayout {
if (collectionTag.isUnkownCommunity) {
collectionTag.copySuccess = true
debounceTimer.restart()
Utils.copyToClipboard(root.communityId)
ClipboardUtils.setText(root.communityId)
return
}
root.collectionTagClicked()

View File

@ -2,6 +2,7 @@ import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import StatusQ 0.1
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Components 0.1
@ -112,9 +113,7 @@ Control {
icon.color: Theme.palette.directColor1
color: Style.current.transparent
textToCopy: root.communityName
onCopyClicked: {
Utils.copyToClipboard(textToCopy)
}
onCopyClicked: ClipboardUtils.setText(textToCopy)
}
}
}

View File

@ -2,6 +2,7 @@ import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import StatusQ 0.1
import StatusQ.Core 0.1
import StatusQ.Components 0.1
import StatusQ.Controls 0.1
@ -144,9 +145,7 @@ DropArea {
icon.color: Theme.palette.directColor1
color: Style.current.transparent
textToCopy: model.communityName
onCopyClicked: {
Utils.copyToClipboard(textToCopy)
}
onCopyClicked: ClipboardUtils.setText(textToCopy)
}
HoverHandler {

View File

@ -3,6 +3,7 @@ import QtQuick.Controls 2.13
import utils 1.0
import StatusQ 0.1
import StatusQ.Controls 0.1
import StatusQ.Components 0.1
import StatusQ.Core 0.1
@ -177,9 +178,7 @@ StatusListItem {
icon.name: "copy"
timeout: 1500
autoDismissMenu: true
onTriggered: {
RootStore.copyToClipboard(d.visibleAddress)
}
onTriggered: ClipboardUtils.setText(d.visibleAddress)
}
StatusAction {

View File

@ -55,7 +55,7 @@ StatusFlatButton {
successText: qsTr("Copied")
icon.name: "copy"
autoDismissMenu: true
onTriggered: Utils.copyToClipboard(root.contractAddress)
onTriggered: ClipboardUtils.setText(root.contractAddress)
}
}
}

View File

@ -1,6 +1,7 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick 2.15
import QtQuick.Controls 2.15
import StatusQ 0.1
import StatusQ.Core 0.1
import StatusQ.Core.Utils 0.1 as StatusQUtils
import StatusQ.Core.Theme 0.1
@ -227,7 +228,7 @@ StatusModal {
anchors.top: addressText.top
icon.name: "copy"
type: StatusRoundButton.Type.Tertiary
onClicked: WalletStore.RootStore.copyToClipboard(d.visibleAddress)
onClicked: ClipboardUtils.setText(d.visibleAddress)
}
}

View File

@ -3,6 +3,7 @@ import QtQuick.Layouts 1.13
import QtQuick.Controls 2.14
import QtQuick.Window 2.12
import StatusQ 0.1
import StatusQ.Components 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Core 0.1
@ -279,7 +280,7 @@ StatusMenu {
}
}
icon.name: "copy"
onTriggered: RootStore.copyToClipboard(d.selectedAddress)
onTriggered: ClipboardUtils.setText(d.selectedAddress)
}
StatusAction {
id: showQrAction

View File

@ -383,10 +383,6 @@ QtObject {
networksModule.enableNetwork(chainId)
}
function copyToClipboard(text) {
globalUtils.copyToClipboard(text)
}
function runAddAccountPopup() {
walletSection.runAddAccountPopup(false)
}

View File

@ -1,6 +1,7 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import StatusQ 0.1
import StatusQ.Popups 0.1
import "../stores"
@ -27,7 +28,7 @@ StatusMenu {
icon.name: "copy"
timeout: 1500
enabled: !!root.account
onTriggered: RootStore.copyToClipboard(root.account.address?? "")
onTriggered: ClipboardUtils.setText(root.account.address?? "")
}
StatusMenuSeparator {

View File

@ -4,6 +4,7 @@ import QtQuick.Controls 2.14
import QtQuick.Window 2.12
import QtGraphicalEffects 1.15
import StatusQ 0.1
import StatusQ.Components 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Core 0.1
@ -806,7 +807,7 @@ Item {
icon.width: 20
icon.height: 20
size: StatusButton.Small
onClicked: RootStore.copyToClipboard(transactionHeader.getDetailsString(d.details))
onClicked: ClipboardUtils.setText(transactionHeader.getDetailsString(d.details))
}
}
}

View File

@ -201,10 +201,6 @@ QtObject {
communitiesModuleInst.cancelRequestToJoinCommunity(id)
}
function copyToClipboard(text) {
globalUtils.copyToClipboard(text)
}
function plainText(text) {
return globalUtils.plainText(text);
}

View File

@ -1,12 +1,12 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import StatusQ 0.1
import StatusQ.Core 0.1
import StatusQ.Core.Backpressure 0.1
import StatusQ.Core.Theme 0.1
import utils 1.0
import shared.stores 1.0
StatusIcon {
id: root
@ -29,7 +29,7 @@ StatusIcon {
hoverEnabled: true
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
onClicked: {
RootStore.copyToClipboard(root.textToCopy)
ClipboardUtils.setText(root.textToCopy)
root.icon = "tiny/checkmark"
root.color = Theme.palette.successColor1

View File

@ -1,12 +1,12 @@
import QtQuick 2.15
import QtQml 2.15
import StatusQ 0.1
import StatusQ.Controls 0.1
import StatusQ.Core.Backpressure 0.1
import StatusQ.Core.Theme 0.1
import utils 1.0
import shared.stores 1.0
StatusRoundButton {
id: root
@ -61,7 +61,7 @@ StatusRoundButton {
}
onClicked: {
RootStore.copyToClipboard(root.textToCopy)
ClipboardUtils.setText(root.textToCopy)
d.copied = true
Backpressure.debounce(root, 1500, function () {
d.copied = false

View File

@ -1,6 +1,7 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick 2.15
import QtQuick.Controls 2.15
import StatusQ 0.1
import StatusQ.Controls 0.1
import StatusQ.Popups 0.1
import StatusQ.Core 0.1
@ -9,7 +10,6 @@ import utils 1.0
import "../panels"
import "../controls"
import "../stores"
Item {
id: inputBox
@ -157,7 +157,7 @@ Item {
}
onClicked: {
if (inputBox.copyToClipboard) {
RootStore.copyToClipboard(inputBox.textToCopy ? inputBox.textToCopy : inputValue.text)
ClipboardUtils.setText(inputBox.textToCopy ? inputBox.textToCopy : inputValue.text)
} else {
inputValue.paste()
}

View File

@ -1,10 +1,11 @@
import QtQuick 2.14
import QtQuick.Layouts 1.14
import QtQuick 2.15
import QtQuick.Layouts 1.15
import utils 1.0
import shared.panels 1.0
import shared.controls 1.0
import StatusQ 0.1
import StatusQ.Controls 0.1
import StatusQ.Components 0.1
import StatusQ.Popups 0.1
@ -268,7 +269,7 @@ Item {
Layout.preferredHeight: 20
color: Style.current.transparent
textToCopy: pubkey
onCopyClicked: root.store.copyToClipboard(textToCopy)
onCopyClicked: ClipboardUtils.setText(textToCopy)
}
}

View File

@ -1,4 +1,6 @@
import QtQuick 2.15
import StatusQ 0.1
import StatusQ.Popups 0.1
import utils 1.0
@ -39,7 +41,7 @@ StatusMenu {
text: qsTr("Copy link")
icon.name: "copy"
enabled: d.isUnfurled
onTriggered: Utils.copyToClipboard(url)
onTriggered: ClipboardUtils.setText(url)
}
StatusAction {

View File

@ -1,5 +1,7 @@
import StatusQ 0.1
import StatusQ.Components 0.1
import StatusQ.Popups 0.1
import utils 1.0
StatusModal {
@ -13,7 +15,7 @@ StatusModal {
tooltip.text: qsTr("Copied!")
asset.name: "copy"
iconButton.onClicked: {
Utils.copyToClipboard(Constants.downloadLink)
ClipboardUtils.setText(Constants.downloadLink)
tooltip.visible = !tooltip.visible
}
width: parent.width

View File

@ -8,6 +8,7 @@ import shared.controls.chat 1.0
import shared.panels 1.0
import shared.controls.chat.menuItems 1.0
import StatusQ 0.1
import StatusQ.Components 0.1
import StatusQ.Popups 0.1
@ -44,7 +45,7 @@ StatusMenu {
text: qsTr("Copy link to profile")
icon.name: "copy"
onTriggered: {
Utils.copyToClipboard(root.store.contactStore.getLinkToProfile(root.store.userProfileInst.pubKey))
ClipboardUtils.setText(root.store.contactStore.getLinkToProfile(root.store.userProfileInst.pubKey))
root.close()
}
}

View File

@ -1,105 +0,0 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import utils 1.0
import "../"
import "../panels"
import "../controls"
// TODO: replace with StatusQ components
Item {
id: root
height: control.height
width: control.width + copyToClipBoardBtn.width + Style.current.smallPadding
property bool hovered: false
property string address: ""
property bool expanded: false
property int addressWidth
property int originalButtonWidth
property var store
Button {
id: control
width: root.addressWidth
leftPadding: 8
rightPadding: 8
contentItem: StyledText {
id: addressText
text: root.address
font.pixelSize: 13
font.family: Style.current.monoFont.name
color: Style.current.secondaryText
elide: Text.ElideMiddle
horizontalAlignment: Text.AlignHCenter
}
background: Rectangle {
color: root.hovered ? Style.current.backgroundHover : "transparent"
radius: Style.current.radius
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
if (root.expanded) {
control.width = root.originalButtonWidth
this.width = control.width
} else {
root.originalButtonWidth = root.addressWidth
control.width = control.maxWidth > 0 ?
Math.min(addressText.implicitWidth, control.maxWidth) :
addressText.implicitWidth + control.leftPadding + control.rightPadding
}
this.width = control.width
root.expanded = !root.expanded
}
}
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
propagateComposedEvents: true
onPressed: mouse.accepted = false
onEntered: {
if (!root.hovered) {
root.hovered = true
}
}
onExited: {
if (root.hovered) {
root.hovered = false
}
}
}
CopyToClipBoardButton {
id: copyToClipBoardBtn
visible: root.hovered
anchors.left: control.right
anchors.leftMargin: Style.current.smallPadding
anchors.verticalCenter: parent.verticalCenter
color: Style.current.transparent
textToCopy: root.address
onCopyClicked: root.store.copyToClipboard(textToCopy)
MouseArea {
anchors.fill: parent
propagateComposedEvents: true
onPressed: mouse.accepted = false
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
onEntered: {
if (!root.hovered) {
root.hovered = true
}
}
onExited: {
if (root.hovered) {
root.hovered = false
}
}
}
}
}

View File

@ -1,54 +0,0 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import QtGraphicalEffects 1.13
import utils 1.0
import "../"
import "../panels"
import "../controls"
// TODO: replace with StatusQ component
Item {
property string name
property string description
property alias tooltipUnder: copyToClipboardBtn.tooltipUnder
property var store
property alias textFont: name.font
property alias textColor: name.color
id: root
width: parent.width
height: name.height
StyledText {
id: name
text: root.name
font.pixelSize: 15
}
StyledText {
id: description
visible: !!root.description
text: root.description
elide: Text.ElideRight
font.pixelSize: 15
horizontalAlignment: Text.AlignRight
color: Style.current.secondaryText
anchors.right: parent.right
anchors.rightMargin: Style.current.smallPadding
anchors.verticalCenter: name.verticalCenter
CopyToClipBoardButton {
id: copyToClipboardBtn
textToCopy: root.description
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.right
anchors.leftMargin: Style.current.smallPadding
color: Style.current.transparent
onCopyClicked: root.store.copyToClipboard(textToCopy)
}
}
}

View File

@ -12,7 +12,6 @@ StatusChatInputTextFormationAction 1.0 StatusChatInputTextFormationAction.qml
StatusEmojiPopup 1.0 StatusEmojiPopup.qml
StatusEmojiSection 1.0 StatusEmojiSection.qml
StatusEmojiSuggestionPopup 1.0 StatusEmojiSuggestionPopup.qml
StatusExpandableAddress 1.0 StatusExpandableAddress.qml
StatusGifPopup 1.0 StatusGifPopup.qml
StatusImageModal 1.0 StatusImageModal.qml
StatusVideoModal 1.0 StatusVideoModal.qml
@ -20,7 +19,6 @@ StatusImageRadioButton 1.0 StatusImageRadioButton.qml
StatusInputListPopup 1.0 StatusInputListPopup.qml
StatusNotification 1.0 StatusNotification.qml
StatusSearchListPopup 1.0 StatusSearchListPopup.qml
StatusSectionDescItem 1.0 StatusSectionDescItem.qml
StatusSectionHeadline 1.0 StatusSectionHeadline.qml
StatusSettingsLineButton 1.0 StatusSettingsLineButton.qml
StatusSticker 1.0 StatusSticker.qml

View File

@ -69,10 +69,6 @@ QtObject {
localAccountSensitiveSettings.gifUnfurlingEnabled = value
}
function copyToClipboard(text) {
globalUtils.copyToClipboard(text)
}
property var gifsModuleInst: typeof gifsModule !== "undefined" ? gifsModule : null
property var gifColumnA: gifsModuleInst ? gifsModuleInst.gifColumnA
: null

View File

@ -60,10 +60,6 @@ QtObject {
return networksModule.getBlockExplorerURL(chainID)
}
function copyToClipboard(text) {
globalUtils.copyToClipboard(text)
}
function authenticateAndTransfer(uuid) {
walletSectionSendInst.authenticateAndTransfer(uuid)
}

View File

@ -3,6 +3,7 @@ import QtQml 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import StatusQ 0.1
import StatusQ.Core 0.1
import StatusQ.Core.Utils 0.1 as SQUtils
import StatusQ.Components 0.1
@ -389,7 +390,7 @@ ColumnLayout {
RootStore.fetchTxDetails(delegateMenu.transaction.id)
let detailsObj = RootStore.getTxDetails()
let detailsString = delegateMenu.transactionDelegate.getDetailsString(detailsObj)
RootStore.copyToClipboard(detailsString)
ClipboardUtils.setText(detailsString)
}
}
StatusMenuSeparator {

View File

@ -3,6 +3,7 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtGraphicalEffects 1.15
import StatusQ 0.1
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
@ -397,7 +398,7 @@ Pane {
text: qsTr("Copy link to profile")
icon.name: "copy"
onTriggered: {
root.profileStore.copyToClipboard(d.linkToProfile)
ClipboardUtils.setText(d.linkToProfile)
}
}
StatusMenuSeparator {}
@ -620,7 +621,7 @@ Pane {
walletStore: WalletStores.RootStore
onCloseRequested: root.closeRequested()
onCopyToClipboard: root.profileStore.copyToClipboard(text)
onCopyToClipboard: ClipboardUtils.setText(text)
}
}
}

View File

@ -1,14 +1,15 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import Qt.labs.platform 1.1
import utils 1.0
import StatusQ 0.1
import StatusQ.Popups 0.1
import shared.popups 1.0
import shared.controls.chat.menuItems 1.0
import AppLayouts.Communities.popups 1.0
import shared.controls.chat.menuItems 1.0
import shared.popups 1.0
import utils 1.0
StatusMenu {
id: root
@ -66,7 +67,7 @@ StatusMenu {
enabled: root.isCommunityChat
onTriggered: {
const link = Utils.getCommunityChannelShareLinkWithChatId(root.chatId)
Utils.copyToClipboard(link)
ClipboardUtils.setText(link)
}
}
@ -133,9 +134,7 @@ StatusMenu {
StatusAction {
text: root.isCommunityChat ? qsTr("Copy channel ID") : qsTr("Copy chat ID")
icon.name: "copy"
onTriggered: {
Utils.copyToClipboard(root.chatId)
}
onTriggered: ClipboardUtils.setText(root.chatId)
}
StatusAction {

View File

@ -3,6 +3,7 @@ import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import QtQml.Models 2.3
import StatusQ 0.1
import StatusQ.Popups 0.1
import StatusQ.Components 0.1
@ -103,7 +104,7 @@ StatusMenu {
text: qsTr("Copy message")
icon.name: "copy"
onTriggered: {
root.store.copyToClipboard(root.unparsedText)
ClipboardUtils.setText(root.unparsedText)
close()
}
enabled: root.messageContentType === Constants.messageContentType.messageType && replyToMenuItem.enabled
@ -115,7 +116,7 @@ StatusMenu {
icon.name: "copy"
enabled: root.isDebugEnabled && replyToMenuItem.enabled
onTriggered: {
root.store.copyToClipboard(root.messageId)
ClipboardUtils.setText(root.messageId)
close()
}
}

View File

@ -714,10 +714,6 @@ QtObject {
return text
}
function copyToClipboard(text) {
globalUtilsInst.copyToClipboard(text)
}
function getFromClipboard() {
return globalUtilsInst.getFromClipboard()
}