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
5d018bc6
Commit
5d018bc6
authored
Feb 28, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/views/App/Settings/SettingsNetwork): supports DSCP fields
parent
b69e5bda
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
168 additions
and
48 deletions
+168
-48
resources.qrc
linphone-desktop/resources.qrc
+1
-0
SettingsModel.cpp
linphone-desktop/src/components/settings/SettingsModel.cpp
+37
-0
SettingsModel.hpp
linphone-desktop/src/components/settings/SettingsModel.hpp
+24
-0
HexField.qml
linphone-desktop/ui/modules/Common/Form/Fields/HexField.qml
+50
-0
PortField.qml
linphone-desktop/ui/modules/Common/Form/Fields/PortField.qml
+2
-2
qmldir
linphone-desktop/ui/modules/Common/qmldir
+1
-0
SettingsNetwork.qml
linphone-desktop/ui/views/App/Settings/SettingsNetwork.qml
+53
-46
No files found.
linphone-desktop/resources.qrc
View file @
5d018bc6
...
...
@@ -186,6 +186,7 @@
<file>
ui/modules/Common/Form/CheckBoxText.qml
</file>
<file>
ui/modules/Common/Form/ComboBox.qml
</file>
<file>
ui/modules/Common/Form/DroppableTextArea.qml
</file>
<file>
ui/modules/Common/Form/Fields/HexField.qml
</file>
<file>
ui/modules/Common/Form/Fields/NumericField.qml
</file>
<file>
ui/modules/Common/Form/Fields/PortField.qml
</file>
<file>
ui/modules/Common/Form/Fields/TextAreaField.qml
</file>
...
...
linphone-desktop/src/components/settings/SettingsModel.cpp
View file @
5d018bc6
...
...
@@ -42,6 +42,14 @@ SettingsModel::SettingsModel (QObject *parent) : QObject(parent) {
// Network.
// =============================================================================
// bool SettingsModel::getTcpPortEnabled () const {}
// void SettingsModel::setTcpPortEnabled (bool status) {
// emit tcpPortEnabledChanged(status);
// }
// -----------------------------------------------------------------------------
QList
<
int
>
SettingsModel
::
getAudioPortRange
()
const
{
int
a
,
b
;
CoreManager
::
getInstance
()
->
getCore
()
->
getAudioPortRange
(
a
,
b
);
...
...
@@ -133,6 +141,35 @@ void SettingsModel::setIpv6Enabled (bool status) {
emit
ipv6EnabledChanged
(
status
);
}
// -----------------------------------------------------------------------------
int
SettingsModel
::
getDscpSip
()
const
{
return
CoreManager
::
getInstance
()
->
getCore
()
->
getSipDscp
();
}
void
SettingsModel
::
setDscpSip
(
int
dscp
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
setSipDscp
(
dscp
);
emit
dscpSipChanged
(
dscp
);
}
int
SettingsModel
::
getDscpAudio
()
const
{
return
CoreManager
::
getInstance
()
->
getCore
()
->
getAudioDscp
();
}
void
SettingsModel
::
setDscpAudio
(
int
dscp
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
setAudioDscp
(
dscp
);
emit
dscpAudioChanged
(
dscp
);
}
int
SettingsModel
::
getDscpVideo
()
const
{
return
CoreManager
::
getInstance
()
->
getCore
()
->
getVideoDscp
();
}
void
SettingsModel
::
setDscpVideo
(
int
dscp
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
setVideoDscp
(
dscp
);
emit
dscpVideoChanged
(
dscp
);
}
// =============================================================================
// Misc.
// =============================================================================
...
...
linphone-desktop/src/components/settings/SettingsModel.hpp
View file @
5d018bc6
...
...
@@ -31,6 +31,8 @@
class
SettingsModel
:
public
QObject
{
Q_OBJECT
;
// Q_PROPERTY(bool tcpPortEnabled READ getTcpPortEnabled WRITE setTcpPortEnabled NOTIFY tcpPortEnabledChanged);
Q_PROPERTY
(
QList
<
int
>
audioPortRange
READ
getAudioPortRange
WRITE
setAudioPortRange
NOTIFY
audioPortRangeChanged
);
Q_PROPERTY
(
QList
<
int
>
videoPortRange
READ
getVideoPortRange
WRITE
setVideoPortRange
NOTIFY
videoPortRangeChanged
);
...
...
@@ -39,6 +41,10 @@ class SettingsModel : public QObject {
Q_PROPERTY
(
bool
ipv6Enabled
READ
getIpv6Enabled
WRITE
setIpv6Enabled
NOTIFY
ipv6EnabledChanged
);
Q_PROPERTY
(
int
dscpSip
READ
getDscpSip
WRITE
setDscpSip
NOTIFY
dscpSipChanged
);
Q_PROPERTY
(
int
dscpAudio
READ
getDscpAudio
WRITE
setDscpAudio
NOTIFY
dscpAudioChanged
);
Q_PROPERTY
(
int
dscpVideo
READ
getDscpVideo
WRITE
setDscpVideo
NOTIFY
dscpVideoChanged
);
Q_PROPERTY
(
bool
autoAnswerStatus
READ
getAutoAnswerStatus
WRITE
setAutoAnswerStatus
NOTIFY
autoAnswerStatusChanged
);
Q_PROPERTY
(
QString
fileTransferUrl
READ
getFileTransferUrl
WRITE
setFileTransferUrl
NOTIFY
fileTransferUrlChanged
);
...
...
@@ -50,6 +56,9 @@ public:
// Network. ------------------------------------------------------------------
// bool getTcpPortEnabled () const;
// void setTcpPortEnabled (bool status);
QList
<
int
>
getAudioPortRange
()
const
;
void
setAudioPortRange
(
const
QList
<
int
>
&
range
);
...
...
@@ -65,6 +74,15 @@ public:
bool
getIpv6Enabled
()
const
;
void
setIpv6Enabled
(
bool
status
);
int
getDscpSip
()
const
;
void
setDscpSip
(
int
dscp
);
int
getDscpAudio
()
const
;
void
setDscpAudio
(
int
dscp
);
int
getDscpVideo
()
const
;
void
setDscpVideo
(
int
dscp
);
// Misc. ---------------------------------------------------------------------
bool
getAutoAnswerStatus
()
const
;
...
...
@@ -84,6 +102,8 @@ public:
static
const
std
::
string
UI_SECTION
;
signals:
// void tcpPortEnabledChanged (bool status);
void
audioPortRangeChanged
(
int
a
,
int
b
);
void
videoPortRangeChanged
(
int
a
,
int
b
);
...
...
@@ -91,6 +111,10 @@ signals:
void
ipv6EnabledChanged
(
bool
status
);
void
dscpSipChanged
(
int
dscp
);
void
dscpAudioChanged
(
int
dscp
);
void
dscpVideoChanged
(
int
dscp
);
void
autoAnswerStatusChanged
(
bool
status
);
void
fileTransferUrlChanged
(
const
QString
&
url
);
...
...
linphone-desktop/ui/modules/Common/Form/Fields/HexField.qml
0 → 100644
View file @
5d018bc6
import
QtQuick
2.7
// =============================================================================
Item
{
id
:
wrapper
// ---------------------------------------------------------------------------
property
alias
readOnly
:
textField
.
readOnly
property
string
text
// ---------------------------------------------------------------------------
signal
editingFinished
(
int
value
)
// ---------------------------------------------------------------------------
function
_computeText
(
text
)
{
return
(
+
text
).
toString
(
16
).
toUpperCase
()
}
// ---------------------------------------------------------------------------
implicitHeight
:
textField
.
height
implicitWidth
:
textField
.
width
// ---------------------------------------------------------------------------
Binding
{
property
:
'
text
'
target
:
textField
value
:
_computeText
(
wrapper
.
text
)
}
TextField
{
id
:
textField
validator
:
RegExpValidator
{
regExp
:
/
[
0-9A-F
]
*/
}
onEditingFinished
:
{
text
=
text
.
length
?
parseInt
(
textField
.
text
,
16
)
:
0
wrapper
.
editingFinished
(
text
)
}
}
}
linphone-desktop/ui/modules/Common/Form/Fields/PortField.qml
View file @
5d018bc6
...
...
@@ -46,8 +46,8 @@ Item {
// ---------------------------------------------------------------------------
implicitWidth
:
textField
.
width
implicitHeight
:
textField
.
height
implicitWidth
:
textField
.
width
// ---------------------------------------------------------------------------
...
...
@@ -67,7 +67,7 @@ Item {
}
// Workaround to supports empty string.
Keys.onReturnPressed
:
textField
.
focus
=
false
Keys.onReturnPressed
:
editingFinished
()
onActiveFocusChanged
:
!
activeFocus
&&
editingFinished
()
onEditingFinished
:
{
...
...
linphone-desktop/ui/modules/Common/qmldir
View file @
5d018bc6
...
...
@@ -33,6 +33,7 @@ FileChooserButton 1.0 Form/Buttons/FileChooserButton.qml
TextButtonA 1.0 Form/Buttons/TextButtonA.qml
TextButtonB 1.0 Form/Buttons/TextButtonB.qml
HexField 1.0 Form/Fields/HexField.qml
NumericField 1.0 Form/Fields/NumericField.qml
PortField 1.0 Form/Fields/PortField.qml
TextAreaField 1.0 Form/Fields/TextAreaField.qml
...
...
linphone-desktop/ui/views/App/Settings/SettingsNetwork.qml
View file @
5d018bc6
...
...
@@ -38,12 +38,10 @@ TabContainer {
FormGroup
{
label
:
qsTr
(
'
sipUdpPortLabel
'
)
PortField
{
//readOnly: randomSipUdpPort.checked || !enableSipUdpPort.checked
//supportsRange: true
//text: SettingsModel.videoPortRange.join(':')
//onEditingFinished: SettingsModel.videoPortRange = [ portA, portB ]
NumericField
{
minValue
:
0
maxValue
:
65535
readOnly
:
randomSipUdpPort
.
checked
||
!
enableSipUdpPort
.
checked
}
}
...
...
@@ -194,6 +192,43 @@ TabContainer {
}
}
// -------------------------------------------------------------------------
// Bandwidth control.
// -------------------------------------------------------------------------
Form
{
title
:
qsTr
(
'
bandwidthControlTitle
'
)
width
:
parent
.
width
FormLine
{
FormGroup
{
label
:
qsTr
(
'
downloadSpeedLimitLabel
'
)
NumericField
{
minValue
:
0
maxValue
:
100000
}
}
FormGroup
{
label
:
qsTr
(
'
uploadSpeedLimitLabel
'
)
NumericField
{
minValue
:
0
maxValue
:
100000
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
enableAdaptiveRateControlLabel
'
)
Switch
{}
}
}
}
// -------------------------------------------------------------------------
// DSCP fields.
// -------------------------------------------------------------------------
...
...
@@ -206,7 +241,10 @@ TabContainer {
FormGroup
{
label
:
qsTr
(
'
sipFieldLabel
'
)
TextField
{}
HexField
{
text
:
SettingsModel
.
dscpSip
onEditingFinished
:
SettingsModel
.
dscpSip
=
value
}
}
}
...
...
@@ -214,13 +252,19 @@ TabContainer {
FormGroup
{
label
:
qsTr
(
'
audioRtpStreamFieldLabel
'
)
TextField
{}
HexField
{
text
:
SettingsModel
.
dscpAudio
onEditingFinished
:
SettingsModel
.
dscpAudio
=
value
}
}
FormGroup
{
label
:
qsTr
(
'
videoRtpStreamFieldLabel
'
)
TextField
{}
HexField
{
text
:
SettingsModel
.
dscpVideo
onEditingFinished
:
SettingsModel
.
dscpVideo
=
value
}
}
}
}
...
...
@@ -286,42 +330,5 @@ TabContainer {
}
}
}
// -------------------------------------------------------------------------
// Bandwidth control.
// -------------------------------------------------------------------------
Form
{
title
:
qsTr
(
'
bandwidthControlTitle
'
)
width
:
parent
.
width
FormLine
{
FormGroup
{
label
:
qsTr
(
'
downloadSpeedLimitLabel
'
)
NumericField
{
minValue
:
0
maxValue
:
100000
}
}
FormGroup
{
label
:
qsTr
(
'
uploadSpeedLimitLabel
'
)
NumericField
{
minValue
:
0
maxValue
:
100000
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
enableAdaptiveRateControlLabel
'
)
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