diff --git a/ui/app/AppLayouts/Chat/ChatColumn/ChatInput.qml b/ui/app/AppLayouts/Chat/ChatColumn/ChatInput.qml index b3499d2585..32bf267b2e 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/ChatInput.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/ChatInput.qml @@ -1,6 +1,7 @@ import QtQuick 2.13 import QtQuick.Controls 2.13 import QtQuick.Layouts 1.13 +import QtMultimedia 5.13 import "../components" import "../../../../shared" import "../../../../imports" @@ -10,12 +11,19 @@ Rectangle { visible: chatsModel.activeChannel.chatType != Constants.chatTypePrivateGroupChat || chatsModel.activeChannel.isMember(profileModel.profile.pubKey) + Audio { + id: sendMessageSound + source: "../../../../sounds/send_message.wav" + } + function onEnter(event){ if (event.modifiers == Qt.NoModifier && (event.key == Qt.Key_Enter || event.key == Qt.Key_Return)) { if(txtData.text.trim().length > 0){ chatsModel.sendMessage(txtData.text.trim()); txtData.text = ""; event.accepted = true; + sendMessageSound.stop() + Qt.callLater(sendMessageSound.play); } } } diff --git a/ui/app/AppLayouts/Wallet/AccountSettingsModal.qml b/ui/app/AppLayouts/Wallet/AccountSettingsModal.qml index 3fce2b6405..5f71b231f4 100644 --- a/ui/app/AppLayouts/Wallet/AccountSettingsModal.qml +++ b/ui/app/AppLayouts/Wallet/AccountSettingsModal.qml @@ -4,6 +4,7 @@ import QtQuick.Layouts 1.13 import QtQuick.Dialogs 1.3 import "../../../imports" import "../../../shared" +import "../../../sounds" ModalPopup { property var currentAccount: walletModel.currentAccount @@ -31,6 +32,12 @@ ModalPopup { accountNameInput.forceActiveFocus(Qt.MouseFocusReason) } + Item { + ErrorSound { + id: errorSound + } + } + Input { id: accountNameInput placeholderText: qsTr("Enter an account name...") @@ -126,6 +133,7 @@ ModalPopup { onAccepted: { const error = walletModel.deleteAccount(currentAccount.address); if (error) { + errorSound.play() deleteError.text = error deleteError.open() return @@ -165,6 +173,7 @@ ModalPopup { const error = walletModel.changeAccountSettings(currentAccount.address, accountNameInput.text, selectedColor); if (error) { + errorSound.play() changeError.text = error changeError.open() return diff --git a/ui/app/AppLayouts/Wallet/AddCustomTokenModal.qml b/ui/app/AppLayouts/Wallet/AddCustomTokenModal.qml index 905dc55fc3..ce1c51c2f6 100644 --- a/ui/app/AppLayouts/Wallet/AddCustomTokenModal.qml +++ b/ui/app/AppLayouts/Wallet/AddCustomTokenModal.qml @@ -3,6 +3,7 @@ import QtQuick.Controls 2.13 import QtQuick.Layouts 1.13 import "../../../imports" import "../../../shared" +import "../../../sounds" ModalPopup { id: popup @@ -15,6 +16,12 @@ ModalPopup { accountNameInput.forceActiveFocus(Qt.MouseFocusReason) } + Item { + ErrorSound { + id: errorSound + } + } + Input { id: addressInput placeholderText: qsTr("Enter contract address...") @@ -61,6 +68,7 @@ ModalPopup { const error = walletModel.addCustomToken(addressInput.text, nameInput.text, symbolInput.text, decimalsInput.text); if (error) { + errorSound.play() changeError.text = error changeError.open() return diff --git a/ui/app/AppLayouts/Wallet/components/AddAccountWithPrivateKey.qml b/ui/app/AppLayouts/Wallet/components/AddAccountWithPrivateKey.qml index e3e638c10b..3e7fc387a4 100644 --- a/ui/app/AppLayouts/Wallet/components/AddAccountWithPrivateKey.qml +++ b/ui/app/AppLayouts/Wallet/components/AddAccountWithPrivateKey.qml @@ -2,6 +2,7 @@ import QtQuick 2.13 import QtQuick.Dialogs 1.3 import "../../../../imports" import "../../../../shared" +import "../../../../sounds" ModalPopup { id: popup @@ -46,6 +47,12 @@ ModalPopup { passwordInput.forceActiveFocus(Qt.MouseFocusReason) } + Item { + ErrorSound { + id: errorSound + } + } + Input { id: passwordInput placeholderText: qsTr("Enter your password…") @@ -117,6 +124,7 @@ ModalPopup { const error = walletModel.addAccountsFromPrivateKey(accountPKeyInput.text, passwordInput.text, accountNameInput.text, selectedColor) loading = false if (error) { + errorSound.play() accountError.text = error return accountError.open() } diff --git a/ui/app/AppLayouts/Wallet/components/AddAccountWithSeed.qml b/ui/app/AppLayouts/Wallet/components/AddAccountWithSeed.qml index edd6dd4271..c42e9972eb 100644 --- a/ui/app/AppLayouts/Wallet/components/AddAccountWithSeed.qml +++ b/ui/app/AppLayouts/Wallet/components/AddAccountWithSeed.qml @@ -2,6 +2,7 @@ import QtQuick 2.13 import QtQuick.Dialogs 1.3 import "../../../../imports" import "../../../../shared" +import "../../../../sounds" ModalPopup { id: popup @@ -47,6 +48,12 @@ ModalPopup { title: qsTr("Add account with a seed phrase") + Item { + ErrorSound { + id: errorSound + } + } + Input { id: passwordInput placeholderText: qsTr("Enter your password…") @@ -112,12 +119,14 @@ ModalPopup { // TODO the loaidng doesn't work because the function freezes th eview. Might need to use threads loading = true if (!validate()) { + errorSound.play() return loading = false } const error = walletModel.addAccountsFromSeed(accountSeedInput.text, passwordInput.text, accountNameInput.text, selectedColor) loading = false if (error) { + errorSound.play() accountError.text = error return accountError.open() } diff --git a/ui/app/AppLayouts/Wallet/components/AddWatchOnlyAccount.qml b/ui/app/AppLayouts/Wallet/components/AddWatchOnlyAccount.qml index 885f8eea4b..7a9b2abe90 100644 --- a/ui/app/AppLayouts/Wallet/components/AddWatchOnlyAccount.qml +++ b/ui/app/AppLayouts/Wallet/components/AddWatchOnlyAccount.qml @@ -2,6 +2,7 @@ import QtQuick 2.13 import QtQuick.Dialogs 1.3 import "../../../../imports" import "../../../../shared" +import "../../../../sounds" ModalPopup { id: popup @@ -36,6 +37,12 @@ ModalPopup { addressInput.forceActiveFocus(Qt.MouseFocusReason) } + Item { + ErrorSound { + id: errorSound + } + } + Input { id: addressInput // TODO add QR code reader for the address @@ -90,12 +97,14 @@ ModalPopup { // TODO the loaidng doesn't work because the function freezes th eview. Might need to use threads loading = true if (!validate()) { + errorSound.play() return loading = false } const error = walletModel.addWatchOnlyAccount(addressInput.text, accountNameInput.text, selectedColor); loading = false if (error) { + errorSound.play() accountError.text = error return accountError.open() } diff --git a/ui/app/AppLayouts/Wallet/components/GenerateAccountModal.qml b/ui/app/AppLayouts/Wallet/components/GenerateAccountModal.qml index 6abb9a5a52..5fd5923827 100644 --- a/ui/app/AppLayouts/Wallet/components/GenerateAccountModal.qml +++ b/ui/app/AppLayouts/Wallet/components/GenerateAccountModal.qml @@ -2,6 +2,7 @@ import QtQuick 2.13 import QtQuick.Dialogs 1.3 import "../../../../imports" import "../../../../shared" +import "../../../../sounds" ModalPopup { id: popup @@ -36,6 +37,12 @@ ModalPopup { passwordInput.forceActiveFocus(Qt.MouseFocusReason) } + Item { + ErrorSound { + id: errorSound + } + } + Input { id: passwordInput placeholderText: qsTr("Enter your password…") @@ -90,12 +97,14 @@ ModalPopup { // TODO the loaidng doesn't work because the function freezes th eview. Might need to use threads loading = true if (!validate()) { + errorSound.play() return loading = false } const error = walletModel.generateNewAccount(passwordInput.text, accountNameInput.text, selectedColor) loading = false if (error) { + errorSound.play() accountError.text = error return accountError.open() } diff --git a/ui/nim-status-client.pro b/ui/nim-status-client.pro index c2584d3caf..a21e853b92 100644 --- a/ui/nim-status-client.pro +++ b/ui/nim-status-client.pro @@ -224,4 +224,5 @@ DISTFILES += \ shared/TextWithLabel.qml \ shared/img/close.svg \ shared/img/status-logo.png \ - shared/qmldir + shared/qmldir \ + sounds/ErrorSound.qml diff --git a/ui/onboarding/CreatePasswordModal.qml b/ui/onboarding/CreatePasswordModal.qml index 36dfa5b7de..012aa5def6 100644 --- a/ui/onboarding/CreatePasswordModal.qml +++ b/ui/onboarding/CreatePasswordModal.qml @@ -3,6 +3,7 @@ import QtQuick.Controls 2.13 import QtQuick.Dialogs 1.3 import "../imports" import "../shared" +import "../sounds" ModalPopup { property bool loading: false @@ -38,6 +39,12 @@ ModalPopup { firstPasswordField.forceActiveFocus(Qt.MouseFocusReason) } + Item { + ErrorSound { + id: errorSound + } + } + Input { id: firstPasswordField anchors.rightMargin: 56 @@ -143,6 +150,7 @@ ModalPopup { ignoreUnknownSignals: true onLoginResponseChanged: { if (error) { + errorSound.play() loading = false importLoginError.open() } @@ -151,6 +159,7 @@ ModalPopup { onClicked: { if (!validate()) { + errorSound.play() return } // TODO this doesn't seem to work because the function freezes the view @@ -160,6 +169,7 @@ ModalPopup { const result = onboardingModel.storeDerivedAndLogin(repeatPasswordField.text); const error = JSON.parse(result).error if (error) { + errorSound.play() importError.text += error return importError.open() } diff --git a/ui/onboarding/ExistingKey.qml b/ui/onboarding/ExistingKey.qml index c7153e42a4..e77657c19d 100644 --- a/ui/onboarding/ExistingKey.qml +++ b/ui/onboarding/ExistingKey.qml @@ -1,5 +1,6 @@ import QtQuick 2.13 import QtQuick.Controls 2.13 +import "../sounds" Item { property var onClosed: function () {} @@ -10,12 +11,17 @@ Item { enterSeedPhraseModal.open() } + ErrorSound { + id: errorSound + } + EnterSeedPhraseModal { property bool wentNext: false id: enterSeedPhraseModal onConfirmSeedClick: function (mnemonic) { let error = onboardingModel.validateMnemonic(mnemonic) if (error != "") { + errorSound.play() invalidSeedPhraseModal.error = error invalidSeedPhraseModal.open() } else { diff --git a/ui/onboarding/Login.qml b/ui/onboarding/Login.qml index 8c7f8a5d67..1ded868c90 100644 --- a/ui/onboarding/Login.qml +++ b/ui/onboarding/Login.qml @@ -5,6 +5,7 @@ import QtQuick.Dialogs 1.3 import QtGraphicalEffects 1.13 import "../shared" import "../imports" +import "../sounds" import "./Login" Item { @@ -23,6 +24,11 @@ Item { Component.onCompleted: { txtPassword.forceActiveFocus(Qt.MouseFocusReason) } + + ErrorSound { + id: errorSound + } + Item { id: element width: 360 @@ -216,6 +222,7 @@ Item { ignoreUnknownSignals: true onLoginResponseChanged: { if (error) { + errorSound.play() loginError.open() } } diff --git a/ui/sounds/ErrorSound.qml b/ui/sounds/ErrorSound.qml new file mode 100644 index 0000000000..b7e26ede44 --- /dev/null +++ b/ui/sounds/ErrorSound.qml @@ -0,0 +1,13 @@ +import QtQuick 2.13 +import QtMultimedia 5.13 + +Audio { + id: errorSound + source: "./error.mp3" +} + +/*##^## +Designer { + D{i:0;autoSize:true;height:480;width:640} +} +##^##*/ diff --git a/ui/sounds/error.mp3 b/ui/sounds/error.mp3 new file mode 100644 index 0000000000..fb25b92372 Binary files /dev/null and b/ui/sounds/error.mp3 differ diff --git a/ui/sounds/notification.wav b/ui/sounds/notification.wav new file mode 100644 index 0000000000..13c9628295 Binary files /dev/null and b/ui/sounds/notification.wav differ diff --git a/ui/sounds/qmldir b/ui/sounds/qmldir new file mode 100644 index 0000000000..b164a19b21 --- /dev/null +++ b/ui/sounds/qmldir @@ -0,0 +1 @@ +ErrorSound 1.0 ErrorSound.qml diff --git a/ui/sounds/send_message.wav b/ui/sounds/send_message.wav new file mode 100644 index 0000000000..d429f98e3d Binary files /dev/null and b/ui/sounds/send_message.wav differ