diff --git a/storybook/qmlTests/tests/tst_EnterSeedPhrase.qml b/storybook/qmlTests/tests/tst_EnterSeedPhrase.qml index 0b369f0ed3..551abbab02 100644 --- a/storybook/qmlTests/tests/tst_EnterSeedPhrase.qml +++ b/storybook/qmlTests/tests/tst_EnterSeedPhrase.qml @@ -3,6 +3,7 @@ import QtQuick.Controls 2.15 import QtQml 2.15 import QtQml.Models 2.15 +import StatusQ 0.1 import StatusQ.Core.Utils 0.1 import QtTest 1.15 @@ -133,9 +134,7 @@ Item { itemUnderTest.dictionary.append(expectedSeedPhrase.map((word) => ({seedWord: word}))) - const clipboardHelper = createTemporaryQmlObject("import QtQuick 2.15; QtObject { property var getFromClipboard }", root) - clipboardHelper.getFromClipboard = () => expectedSeedPhrase.join(" ") - Utils.globalUtilsInst = clipboardHelper + ClipboardUtils.setText(expectedSeedPhrase.join(" ")) // Trigger the paste action keyClick("v", Qt.ControlModifier) @@ -239,9 +238,7 @@ Item { itemUnderTest.dictionary.append(dictionaryVariation.map((word) => ({seedWord: word}))) - const clipboardHelper = createTemporaryQmlObject("import QtQuick 2.15; QtObject { property var getFromClipboard }", root) - clipboardHelper.getFromClipboard = () => expectedSeedPhrase.join(" ") - Utils.globalUtilsInst = clipboardHelper + ClipboardUtils.setText(expectedSeedPhrase.join(" ")) // Trigger the paste action keyClick("v", Qt.ControlModifier) diff --git a/ui/app/AppLayouts/Profile/popups/SendContactRequestModal.qml b/ui/app/AppLayouts/Profile/popups/SendContactRequestModal.qml index 6f36191072..9ff0364a76 100644 --- a/ui/app/AppLayouts/Profile/popups/SendContactRequestModal.qml +++ b/ui/app/AppLayouts/Profile/popups/SendContactRequestModal.qml @@ -4,6 +4,7 @@ import QtQuick.Layouts 1.14 import utils 1.0 +import StatusQ 0.1 import StatusQ.Controls 0.1 import StatusQ.Controls.Validators 0.1 import StatusQ.Core 0.1 @@ -110,7 +111,7 @@ StatusModal { size: StatusBaseButton.Size.Tiny text: qsTr("Paste") onClicked: { - d.realChatKey = root.contactsStore.getFromClipboard() + d.realChatKey = ClipboardUtils.text d.showPasteButton = false d.textChanged(d.realChatKey) } diff --git a/ui/app/AppLayouts/Profile/stores/ContactsStore.qml b/ui/app/AppLayouts/Profile/stores/ContactsStore.qml index 93f2db87d9..5d41ad9eae 100644 --- a/ui/app/AppLayouts/Profile/stores/ContactsStore.qml +++ b/ui/app/AppLayouts/Profile/stores/ContactsStore.qml @@ -51,10 +51,6 @@ QtObject { return root.globalUtilsInst.generateAlias(pubKey) } - function getFromClipboard() { - return root.globalUtilsInst.getFromClipboard() - } - function isMyMutualContact(pubKey) { return root.contactsModule.isMyMutualContact(pubKey) } diff --git a/ui/imports/shared/panels/EnterSeedPhrase.qml b/ui/imports/shared/panels/EnterSeedPhrase.qml index f8450ac1a6..9446dd6614 100644 --- a/ui/imports/shared/panels/EnterSeedPhrase.qml +++ b/ui/imports/shared/panels/EnterSeedPhrase.qml @@ -1,6 +1,7 @@ import QtQuick 2.14 import QtQuick.Layouts 1.14 +import StatusQ 0.1 import StatusQ.Core 0.1 import StatusQ.Core.Theme 0.1 import StatusQ.Core.Utils 0.1 @@ -96,7 +97,7 @@ ColumnLayout { } function pasteWords () { - const clipboardText = Utils.getFromClipboard() + const clipboardText = ClipboardUtils.text // Split words separated by commas and or blank spaces (spaces, enters, tabs) const words = clipboardText.trim().split(/[, \s]+/) diff --git a/ui/imports/shared/popups/common/BasePopupStore.qml b/ui/imports/shared/popups/common/BasePopupStore.qml index 6ecd86172f..c3495db2ac 100644 --- a/ui/imports/shared/popups/common/BasePopupStore.qml +++ b/ui/imports/shared/popups/common/BasePopupStore.qml @@ -19,8 +19,4 @@ QtObject { property var submitPopup: function(){} property var changeSeedPhrase: function(){} property var validSeedPhrase: function(){} - - function getFromClipboard() { - return globalUtils.getFromClipboard() - } } diff --git a/ui/imports/shared/popups/common/EnterPrivateKey.qml b/ui/imports/shared/popups/common/EnterPrivateKey.qml index 186553dd1e..21349841c5 100644 --- a/ui/imports/shared/popups/common/EnterPrivateKey.qml +++ b/ui/imports/shared/popups/common/EnterPrivateKey.qml @@ -2,6 +2,7 @@ import QtQuick 2.14 import QtQuick.Controls 2.14 import QtQuick.Layouts 1.14 +import StatusQ 0.1 import StatusQ.Core 0.1 import StatusQ.Core.Theme 0.1 import StatusQ.Controls 0.1 @@ -79,7 +80,7 @@ Item { size: StatusBaseButton.Size.Tiny text: qsTr("Paste") onClicked: { - privKeyInput.text = root.store.getFromClipboard() + privKeyInput.text = ClipboardUtils.text } } } diff --git a/ui/imports/utils/Utils.qml b/ui/imports/utils/Utils.qml index fcb0ef6209..8d0d162bb1 100644 --- a/ui/imports/utils/Utils.qml +++ b/ui/imports/utils/Utils.qml @@ -714,10 +714,6 @@ QtObject { return text } - function getFromClipboard() { - return globalUtilsInst.getFromClipboard() - } - function copyImageToClipboardByUrl(content) { globalUtilsInst.copyImageToClipboardByUrl(content) }