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
11b12e2d
Commit
11b12e2d
authored
Mar 01, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/views/App/Settings/SettingsCallsChat): supports media encryption
parent
dfafcb3b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
4 deletions
+70
-4
SettingsModel.cpp
linphone-desktop/src/components/settings/SettingsModel.cpp
+17
-0
SettingsModel.hpp
linphone-desktop/src/components/settings/SettingsModel.hpp
+22
-0
utils.js
linphone-desktop/ui/scripts/Utils/utils.js
+12
-0
SettingsCallsChat.qml
linphone-desktop/ui/views/App/Settings/SettingsCallsChat.qml
+19
-4
No files found.
linphone-desktop/src/components/settings/SettingsModel.cpp
View file @
11b12e2d
...
...
@@ -38,6 +38,23 @@ SettingsModel::SettingsModel (QObject *parent) : QObject(parent) {
m_config
=
CoreManager
::
getInstance
()
->
getCore
()
->
getConfig
();
}
// =============================================================================
// Chat & calls.
// =============================================================================
SettingsModel
::
MediaEncryption
SettingsModel
::
getMediaEncryption
()
const
{
return
static_cast
<
SettingsModel
::
MediaEncryption
>
(
CoreManager
::
getInstance
()
->
getCore
()
->
getMediaEncryption
()
);
}
void
SettingsModel
::
setMediaEncryption
(
MediaEncryption
encryption
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
setMediaEncryption
(
static_cast
<
linphone
::
MediaEncryption
>
(
encryption
)
);
emit
mediaEncryptionChanged
(
encryption
);
}
// =============================================================================
// Network.
// =============================================================================
...
...
linphone-desktop/src/components/settings/SettingsModel.hpp
View file @
11b12e2d
...
...
@@ -35,6 +35,10 @@ class SettingsModel : public QObject {
// PROPERTIES.
// ===========================================================================
// Chat & calls. -------------------------------------------------------------
Q_PROPERTY
(
MediaEncryption
mediaEncryption
READ
getMediaEncryption
WRITE
setMediaEncryption
NOTIFY
mediaEncryptionChanged
);
// Network. ------------------------------------------------------------------
Q_PROPERTY
(
bool
useSipInfoForDtmfs
READ
getUseSipInfoForDtmfs
WRITE
setUseSipInfoForDtmfs
NOTIFY
dtmfsProtocolChanged
);
...
...
@@ -78,12 +82,26 @@ class SettingsModel : public QObject {
Q_PROPERTY
(
QString
savedVideosFolder
READ
getSavedVideosFolder
WRITE
setSavedVideosFolder
NOTIFY
savedVideosFolderChanged
);
public:
enum
MediaEncryption
{
MediaEncryptionDtls
=
linphone
::
MediaEncryptionDTLS
,
MediaEncryptionNone
=
linphone
::
MediaEncryptionNone
,
MediaEncryptionSrtp
=
linphone
::
MediaEncryptionSRTP
,
MediaEncryptionZrtp
=
linphone
::
MediaEncryptionZRTP
};
Q_ENUM
(
MediaEncryption
);
SettingsModel
(
QObject
*
parent
=
Q_NULLPTR
);
// ===========================================================================
// METHODS.
// ===========================================================================
// Chat & calls. -------------------------------------------------------------
MediaEncryption
getMediaEncryption
()
const
;
void
setMediaEncryption
(
MediaEncryption
encryption
);
// Network. ------------------------------------------------------------------
bool
getUseSipInfoForDtmfs
()
const
;
...
...
@@ -160,6 +178,10 @@ public:
// ===========================================================================
signals:
// Chat & calls. -------------------------------------------------------------
void
mediaEncryptionChanged
(
MediaEncryption
encryption
);
// Network. ------------------------------------------------------------------
void
dtmfsProtocolChanged
();
...
...
linphone-desktop/ui/scripts/Utils/utils.js
View file @
11b12e2d
...
...
@@ -486,6 +486,18 @@ function includes (obj, value, startIndex) {
// -----------------------------------------------------------------------------
function
invert
(
obj
)
{
var
out
=
{}
for
(
var
key
in
obj
)
{
out
[
key
]
=
obj
[
key
]
}
return
out
}
// -----------------------------------------------------------------------------
function
isArray
(
array
)
{
return
(
array
instanceof
Array
)
}
...
...
linphone-desktop/ui/views/App/Settings/SettingsCallsChat.qml
View file @
11b12e2d
import
QtQuick
2.7
import
Common
1.0
import
Linphone
1.0
import
Utils
1.0
import
App
.
Styles
1.0
...
...
@@ -20,12 +22,25 @@ TabContainer {
label
:
qsTr
(
'
encryptionLabel
'
)
ExclusiveButtons
{
property
var
_resolveButton
texts
:
[
qsTr
(
'
noEncryption
'
),
'
SRTP
'
,
'
ZRTP
'
,
'
DTLS
'
qsTr
(
'
noEncryption
'
),
// 0.
'
SRTP
'
,
// 1.
'
ZRTP
'
,
// 2.
'
DTLS
'
// 3.
]
Component.onCompleted
:
{
var
map
=
_resolveButton
=
{}
map
[
SettingsModel
.
MediaEncryptionNone
]
=
0
map
[
SettingsModel
.
MediaEncryptionSrtp
]
=
1
map
[
SettingsModel
.
MediaEncryptionZrtp
]
=
2
map
[
SettingsModel
.
MediaEncryptionDtls
]
=
3
selectedButton
=
Utils
.
invert
(
map
)[
SettingsModel
.
mediaEncryption
]
}
onClicked
:
SettingsModel
.
mediaEncryption
=
_resolveButton
[
button
]
}
}
}
...
...
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