Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
e5667ff2
Commit
e5667ff2
authored
May 31, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/modules/Linphone/Chat/Message): disable `play me` action if text to speech not available
parent
8c674a7f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
4 deletions
+31
-4
TextToSpeech.cpp
...ne-desktop/src/components/text-to-speech/TextToSpeech.cpp
+8
-0
TextToSpeech.hpp
...ne-desktop/src/components/text-to-speech/TextToSpeech.hpp
+4
-0
MenuItem.qml
linphone-desktop/ui/modules/Common/Menus/MenuItem.qml
+12
-3
MenuItemStyle.qml
...-desktop/ui/modules/Common/Styles/Menus/MenuItemStyle.qml
+5
-1
Message.qml
linphone-desktop/ui/modules/Linphone/Chat/Message.qml
+2
-0
No files found.
linphone-desktop/src/components/text-to-speech/TextToSpeech.cpp
View file @
e5667ff2
...
...
@@ -37,9 +37,17 @@
mQtTextToSpeech
->
say
(
text
);
}
bool
TextToSpeech
::
available
()
const
{
return
true
;
}
#else
TextToSpeech
::
TextToSpeech
(
QObject
*
parent
)
:
QObject
(
parent
)
{}
void
TextToSpeech
::
say
(
const
QString
&
)
{}
bool
TextToSpeech
::
available
()
const
{
return
false
;
}
#endif // ifdef TEXTTOSPEECH_ENABLED
linphone-desktop/src/components/text-to-speech/TextToSpeech.hpp
View file @
e5667ff2
...
...
@@ -32,6 +32,8 @@ class QTextToSpeech;
class
TextToSpeech
:
public
QObject
{
Q_OBJECT
;
Q_PROPERTY
(
bool
available
READ
available
CONSTANT
);
public:
TextToSpeech
(
QObject
*
parent
=
Q_NULLPTR
);
~
TextToSpeech
()
=
default
;
...
...
@@ -39,6 +41,8 @@ public:
Q_INVOKABLE
void
say
(
const
QString
&
text
);
private:
bool
available
()
const
;
QTextToSpeech
*
mQtTextToSpeech
=
nullptr
;
};
...
...
linphone-desktop/ui/modules/Common/Menus/MenuItem.qml
View file @
e5667ff2
...
...
@@ -18,11 +18,19 @@ MenuItem {
)
implicitHeight
:
MenuItemStyle
.
background
.
height
}
contentItem
:
Text
{
color
:
MenuItemStyle
.
text
.
color
color
:
button
.
enabled
?
MenuItemStyle
.
text
.
color
.
enabled
:
MenuItemStyle
.
text
.
color
.
disabled
elide
:
Text
.
ElideRight
font.bold
:
true
font.pointSize
:
MenuItemStyle
.
text
.
fontSize
font
{
bold
:
true
pointSize
:
MenuItemStyle
.
text
.
fontSize
}
text
:
button
.
text
leftPadding
:
MenuItemStyle
.
leftPadding
...
...
@@ -30,5 +38,6 @@ MenuItem {
verticalAlignment
:
Text
.
AlignVCenter
}
hoverEnabled
:
true
}
linphone-desktop/ui/modules/Common/Styles/Menus/MenuItemStyle.qml
View file @
e5667ff2
...
...
@@ -20,7 +20,11 @@ QtObject {
}
property
QtObject
text
:
QtObject
{
property
color
color
:
Colors
.
j
property
int
fontSize
:
10
property
QtObject
color
:
QtObject
{
property
color
enabled
:
Colors
.
j
property
color
disabled
:
Colors
.
l50
}
}
}
linphone-desktop/ui/modules/Linphone/Chat/Message.qml
View file @
e5667ff2
...
...
@@ -76,7 +76,9 @@ Item {
}
MenuItem
{
enabled
:
TextToSpeech
.
available
text
:
qsTr
(
'
menuPlayMe
'
)
onTriggered
:
TextToSpeech
.
say
(
$chatEntry
.
content
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment