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
aabbcf39
Commit
aabbcf39
authored
Feb 24, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/views/App/Settings): transport settings working
parent
47e70789
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
108 additions
and
29 deletions
+108
-29
en.ts
linphone-desktop/assets/languages/en.ts
+3
-3
fr.ts
linphone-desktop/assets/languages/fr.ts
+3
-3
SettingsModel.cpp
linphone-desktop/src/components/settings/SettingsModel.cpp
+58
-2
SettingsModel.hpp
linphone-desktop/src/components/settings/SettingsModel.hpp
+24
-0
Switch.qml
linphone-desktop/ui/modules/Common/Form/Switch.qml
+5
-1
SettingsNetwork.qml
linphone-desktop/ui/views/App/Settings/SettingsNetwork.qml
+15
-20
No files found.
linphone-desktop/assets/languages/en.ts
View file @
aabbcf39
...
...
@@ -706,15 +706,15 @@ Server url not configured.</translation>
<
name
>
SettingsNetwork
<
/name
>
<
message
>
<
source
>
forceMtuLabel
<
/source
>
<
translation
>
Forcer
MTU
<
/translation
>
<
translation
type
=
"
vanished
"
>
Forcer
MTU
<
/translation
>
<
/message
>
<
message
>
<
source
>
mtuLabel
<
/source
>
<
translation
>
MTU
<
/translation
>
<
translation
type
=
"
vanished
"
>
MTU
<
/translation
>
<
/message
>
<
message
>
<
source
>
sendDtmfsLabel
<
/source
>
<
translation
>
Send
DTMFs
as
SIP
info
<
/translation
>
<
translation
>
DTMFs
send
method
<
/translation
>
<
/message
>
<
message
>
<
source
>
allowIpV6Label
<
/source
>
...
...
linphone-desktop/assets/languages/fr.ts
View file @
aabbcf39
...
...
@@ -716,15 +716,15 @@ Url du serveur non configurée.</translation>
<
name
>
SettingsNetwork
<
/name
>
<
message
>
<
source
>
forceMtuLabel
<
/source
>
<
translation
>
Forcer
MTU
<
/translation
>
<
translation
type
=
"
vanished
"
>
Forcer
MTU
<
/translation
>
<
/message
>
<
message
>
<
source
>
mtuLabel
<
/source
>
<
translation
>
MTU
<
/translation
>
<
translation
type
=
"
vanished
"
>
MTU
<
/translation
>
<
/message
>
<
message
>
<
source
>
sendDtmfsLabel
<
/source
>
<
translation
>
Envoyer
DTMFs
en
SIP
info
<
/translation
>
<
translation
>
M
é
thode
d
&
apos
;
envoi
des
DTMFs
<
/translation
>
<
/message
>
<
message
>
<
source
>
allowIpV6Label
<
/source
>
...
...
linphone-desktop/src/components/settings/SettingsModel.cpp
View file @
aabbcf39
...
...
@@ -20,12 +20,12 @@
* Author: Ronan Abhamon
*/
#include <QDir>
#include "../../app/Paths.hpp"
#include "../../utils.hpp"
#include "../core/CoreManager.hpp"
#include <QDir>
#include "SettingsModel.hpp"
using
namespace
std
;
...
...
@@ -38,8 +38,63 @@ SettingsModel::SettingsModel (QObject *parent) : QObject(parent) {
m_config
=
CoreManager
::
getInstance
()
->
getCore
()
->
getConfig
();
}
// =============================================================================
// Network.
// =============================================================================
bool
SettingsModel
::
getUseRfc2833ForDtmfs
()
const
{
return
CoreManager
::
getInstance
()
->
getCore
()
->
getUseRfc2833ForDtmf
();
}
void
SettingsModel
::
setUseRfc2833ForDtmfs
(
bool
status
)
{
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
if
(
status
)
{
core
->
setUseInfoForDtmf
(
false
);
core
->
setUseRfc2833ForDtmf
(
true
);
}
else
{
core
->
setUseRfc2833ForDtmf
(
false
);
core
->
setUseInfoForDtmf
(
true
);
}
emit
dtmfsProtocolChanged
();
}
// -----------------------------------------------------------------------------
bool
SettingsModel
::
getUseSipInfoForDtmfs
()
const
{
return
CoreManager
::
getInstance
()
->
getCore
()
->
getUseInfoForDtmf
();
}
void
SettingsModel
::
setUseSipInfoForDtmfs
(
bool
status
)
{
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
if
(
status
)
{
core
->
setUseRfc2833ForDtmf
(
false
);
core
->
setUseInfoForDtmf
(
true
);
}
else
{
core
->
setUseInfoForDtmf
(
false
);
core
->
setUseRfc2833ForDtmf
(
true
);
}
emit
dtmfsProtocolChanged
();
}
// -----------------------------------------------------------------------------
bool
SettingsModel
::
getIpv6Enabled
()
const
{
return
CoreManager
::
getInstance
()
->
getCore
()
->
ipv6Enabled
();
}
void
SettingsModel
::
setIpv6Enabled
(
bool
status
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
enableIpv6
(
status
);
emit
ipv6EnabledChanged
(
status
);
}
// =============================================================================
// Misc.
// =============================================================================
bool
SettingsModel
::
getAutoAnswerStatus
()
const
{
return
!!
m_config
->
getInt
(
UI_SECTION
,
"auto_answer"
,
0
);
}
...
...
@@ -61,6 +116,7 @@ void SettingsModel::setFileTransferUrl (const QString &url) {
CoreManager
::
getInstance
()
->
getCore
()
->
setFileTransferServer
(
::
Utils
::
qStringToLinphoneString
(
url
)
);
emit
fileTransferUrlChanged
(
url
);
}
// -----------------------------------------------------------------------------
...
...
linphone-desktop/src/components/settings/SettingsModel.hpp
View file @
aabbcf39
...
...
@@ -31,6 +31,11 @@
class
SettingsModel
:
public
QObject
{
Q_OBJECT
;
Q_PROPERTY
(
bool
useSipInfoForDtmfs
READ
getUseSipInfoForDtmfs
WRITE
setUseSipInfoForDtmfs
NOTIFY
dtmfsProtocolChanged
);
Q_PROPERTY
(
bool
useRfc2833ForDtmfs
READ
getUseRfc2833ForDtmfs
WRITE
setUseRfc2833ForDtmfs
NOTIFY
dtmfsProtocolChanged
);
Q_PROPERTY
(
bool
ipv6Enabled
READ
getIpv6Enabled
WRITE
setIpv6Enabled
NOTIFY
ipv6EnabledChanged
);
Q_PROPERTY
(
bool
autoAnswerStatus
READ
getAutoAnswerStatus
WRITE
setAutoAnswerStatus
NOTIFY
autoAnswerStatusChanged
);
Q_PROPERTY
(
QString
fileTransferUrl
READ
getFileTransferUrl
WRITE
setFileTransferUrl
NOTIFY
fileTransferUrlChanged
);
...
...
@@ -40,6 +45,19 @@ class SettingsModel : public QObject {
public:
SettingsModel
(
QObject
*
parent
=
Q_NULLPTR
);
// Network. ------------------------------------------------------------------
bool
getUseSipInfoForDtmfs
()
const
;
void
setUseSipInfoForDtmfs
(
bool
status
);
bool
getUseRfc2833ForDtmfs
()
const
;
void
setUseRfc2833ForDtmfs
(
bool
status
);
bool
getIpv6Enabled
()
const
;
void
setIpv6Enabled
(
bool
status
);
// Misc. ---------------------------------------------------------------------
bool
getAutoAnswerStatus
()
const
;
void
setAutoAnswerStatus
(
bool
status
);
...
...
@@ -52,9 +70,15 @@ public:
QString
getSavedVideosFolder
()
const
;
void
setSavedVideosFolder
(
const
QString
&
folder
);
// ---------------------------------------------------------------------------
static
const
std
::
string
UI_SECTION
;
signals:
void
dtmfsProtocolChanged
();
void
ipv6EnabledChanged
(
bool
status
);
void
autoAnswerStatusChanged
(
bool
status
);
void
fileTransferUrlChanged
(
const
QString
&
url
);
...
...
linphone-desktop/ui/modules/Common/Form/Switch.qml
View file @
aabbcf39
...
...
@@ -14,6 +14,10 @@ Switch {
// ---------------------------------------------------------------------------
signal
clicked
// ---------------------------------------------------------------------------
checked
:
false
indicator
:
Rectangle
{
...
...
@@ -94,6 +98,6 @@ Switch {
MouseArea
{
anchors.fill
:
parent
onClicked
:
control
.
enabled
&&
control
.
toggle
()
onClicked
:
control
.
enabled
&&
control
.
clicked
()
}
}
linphone-desktop/ui/views/App/Settings/SettingsNetwork.qml
View file @
aabbcf39
import
QtQuick
2.7
import
Common
1.0
import
Linphone
1.0
import
App
.
Styles
1.0
...
...
@@ -21,35 +22,29 @@ TabContainer {
FormLine
{
FormGroup
{
label
:
qsTr
(
'
forceMtu
Label
'
)
label
:
qsTr
(
'
sendDtmfs
Label
'
)
Switch
{
id
:
forceMtu
ExclusiveButtons
{
selectedButton
:
Number
(
!
SettingsModel
.
useSipInfoForDtmfs
)
texts
:
[
'
SIP INFO
'
,
'
RFC 2833
'
]
onClicked
:
SettingsModel
.
useSipInfoForDtmfs
=
!
button
}
}
FormGroup
{
label
:
qsTr
(
'
mtu
Label
'
)
label
:
qsTr
(
'
allowIpV6
Label
'
)
NumericField
{
minValue
:
500
maxValue
:
3001
readOnly
:
!
forceMtu
.
checked
Switch
{
checked
:
SettingsModel
.
ipv6Enabled
onClicked
:
SettingsModel
.
ipv6Enabled
=
!
checked
}
}
}
FormGroup
{
label
:
qsTr
(
'
sendDtmfsLabel
'
)
Switch
{}
}
FormGroup
{
label
:
qsTr
(
'
allowIpV6Label
'
)
Switch
{}
}
}
// -------------------------------------------------------------------------
...
...
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