mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-18 11:58:11 +00:00
feat(ui/modules/Linphone/Chat/Message): supports text to speech
This commit is contained in:
parent
33987a9c54
commit
8f886cb993
8 changed files with 24 additions and 22 deletions
|
|
@ -74,7 +74,7 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -DQT_QML_DEBUG -DQT_
|
|||
# Define packages, libs, sources, headers, resources and languages.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
set(QT5_PACKAGES Core Gui Quick Widgets QuickControls2 Svg LinguistTools Concurrent Network)
|
||||
set(QT5_PACKAGES Core Gui Quick Widgets QuickControls2 Svg LinguistTools Concurrent Network TextToSpeech)
|
||||
|
||||
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
|
||||
include("${EP_linphone_CONFIG_DIR}/LinphoneConfig.cmake")
|
||||
|
|
|
|||
|
|
@ -828,12 +828,9 @@ your friend's SIP address or username.</translation>
|
|||
<source>menuCopy</source>
|
||||
<translation>Copy</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MessageMenu</name>
|
||||
<message>
|
||||
<source>copy</source>
|
||||
<translation>Copy</translation>
|
||||
<source>menuPlayMe</source>
|
||||
<translation>Play me!</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
|
|
|||
|
|
@ -827,12 +827,9 @@ un chat ou ajouter un contact.</translation>
|
|||
<source>menuCopy</source>
|
||||
<translation>Copier</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MessageMenu</name>
|
||||
<message>
|
||||
<source>copy</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<source>menuPlayMe</source>
|
||||
<translation>Joue-moi !</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
|
|
|||
|
|
@ -314,7 +314,6 @@
|
|||
<file>ui/modules/Linphone/Chat/FileMessage.qml</file>
|
||||
<file>ui/modules/Linphone/Chat/IncomingMessage.qml</file>
|
||||
<file>ui/modules/Linphone/Chat/Message.js</file>
|
||||
<file>ui/modules/Linphone/Chat/MessageMenu.qml</file>
|
||||
<file>ui/modules/Linphone/Chat/Message.qml</file>
|
||||
<file>ui/modules/Linphone/Chat/OutgoingMessage.qml</file>
|
||||
<file>ui/modules/Linphone/Codecs/CodecAttribute.qml</file>
|
||||
|
|
|
|||
|
|
@ -171,6 +171,9 @@ void App::initContentApp () {
|
|||
mEngine->addImageProvider(AvatarProvider::PROVIDER_ID, new AvatarProvider());
|
||||
mEngine->addImageProvider(ThumbnailProvider::PROVIDER_ID, new ThumbnailProvider());
|
||||
|
||||
mTextToSpeech = new QTextToSpeech(this);
|
||||
QQmlEngine::setObjectOwnership(mTextToSpeech, QQmlEngine::CppOwnership);
|
||||
|
||||
registerTypes();
|
||||
registerSharedTypes();
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include <QCommandLineParser>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQuickWindow>
|
||||
#include <QTextToSpeech>
|
||||
|
||||
#include "../components/notifier/Notifier.hpp"
|
||||
#include "../externals/single-application/SingleApplication.hpp"
|
||||
|
|
@ -44,6 +45,8 @@ class App : public SingleApplication {
|
|||
Q_PROPERTY(QVariantList availableLocales READ getAvailableLocales CONSTANT);
|
||||
Q_PROPERTY(QString qtVersion READ getQtVersion CONSTANT);
|
||||
|
||||
Q_PROPERTY(QTextToSpeech * textToSpeech READ getTextToSpeech CONSTANT);
|
||||
|
||||
public:
|
||||
App (int &argc, char *argv[]);
|
||||
~App ();
|
||||
|
|
@ -86,6 +89,10 @@ signals:
|
|||
void configLocaleChanged (const QString &locale);
|
||||
|
||||
private:
|
||||
QTextToSpeech *getTextToSpeech () const {
|
||||
return mTextToSpeech;
|
||||
}
|
||||
|
||||
void registerTypes ();
|
||||
void registerSharedTypes ();
|
||||
void setTrayIcon ();
|
||||
|
|
@ -111,6 +118,8 @@ private:
|
|||
QVariantList mAvailableLocales;
|
||||
QString mLocale;
|
||||
|
||||
QTextToSpeech *mTextToSpeech = nullptr;
|
||||
|
||||
QQmlApplicationEngine *mEngine = nullptr;
|
||||
|
||||
DefaultTranslator *mTranslator = nullptr;
|
||||
|
|
@ -120,4 +129,6 @@ private:
|
|||
QQuickWindow *mSettingsWindow = nullptr;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(QTextToSpeech *);
|
||||
|
||||
#endif // APP_H_
|
||||
|
|
|
|||
|
|
@ -74,6 +74,11 @@ Item {
|
|||
text: qsTr('menuCopy')
|
||||
onTriggered: Clipboard.text = $chatEntry.content
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
text: qsTr('menuPlayMe')
|
||||
onTriggered: App.textToSpeech.say($chatEntry.content)
|
||||
}
|
||||
}
|
||||
|
||||
// Handle hovered link.
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.1
|
||||
|
||||
// =============================================================================
|
||||
|
||||
Menu {
|
||||
MenuItem {
|
||||
text: qsTr('copy')
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue