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
26171f84
Commit
26171f84
authored
Apr 20, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/views/App/Settings/SettingsNetwork): supports tcp/udp ports
parent
90663b34
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
11 deletions
+65
-11
SettingsModel.cpp
linphone-desktop/src/components/settings/SettingsModel.cpp
+28
-4
SettingsModel.hpp
linphone-desktop/src/components/settings/SettingsModel.hpp
+9
-4
SettingsNetwork.qml
linphone-desktop/ui/views/App/Settings/SettingsNetwork.qml
+28
-3
No files found.
linphone-desktop/src/components/settings/SettingsModel.cpp
View file @
26171f84
...
...
@@ -408,11 +408,35 @@ void SettingsModel::setAdaptiveRateControlEnabled (bool status) {
// -----------------------------------------------------------------------------
// bool SettingsModel::getTcpPortEnabled () const {}
int
SettingsModel
::
getTcpPort
()
const
{
return
CoreManager
::
getInstance
()
->
getCore
()
->
getTransports
()
->
getTcpPort
();
}
void
SettingsModel
::
setTcpPort
(
int
port
)
{
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
shared_ptr
<
linphone
::
Transports
>
transports
=
core
->
getTransports
();
transports
->
setTcpPort
(
port
);
core
->
setTransports
(
transports
);
emit
tcpPortChanged
(
port
);
}
// -----------------------------------------------------------------------------
int
SettingsModel
::
getUdpPort
()
const
{
return
CoreManager
::
getInstance
()
->
getCore
()
->
getTransports
()
->
getUdpPort
();
}
// void SettingsModel::setTcpPortEnabled (bool status) {
// emit tcpPortEnabledChanged(status);
// }
void
SettingsModel
::
setUdpPort
(
int
port
)
{
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
shared_ptr
<
linphone
::
Transports
>
transports
=
core
->
getTransports
();
transports
->
setUdpPort
(
port
);
core
->
setTransports
(
transports
);
emit
udpPortChanged
(
port
);
}
// -----------------------------------------------------------------------------
...
...
linphone-desktop/src/components/settings/SettingsModel.hpp
View file @
26171f84
...
...
@@ -90,7 +90,8 @@ class SettingsModel : public QObject {
NOTIFY
adaptiveRateControlEnabledChanged
);
// Q_PROPERTY(bool tcpPortEnabled READ getTcpPortEnabled WRITE setTcpPortEnabled NOTIFY tcpPortEnabledChanged);
Q_PROPERTY
(
int
tcpPort
READ
getTcpPort
WRITE
setTcpPort
NOTIFY
tcpPortChanged
);
Q_PROPERTY
(
int
udpPort
READ
getUdpPort
WRITE
setUdpPort
NOTIFY
udpPortChanged
);
Q_PROPERTY
(
QList
<
int
>
audioPortRange
READ
getAudioPortRange
WRITE
setAudioPortRange
NOTIFY
audioPortRangeChanged
);
Q_PROPERTY
(
QList
<
int
>
videoPortRange
READ
getVideoPortRange
WRITE
setVideoPortRange
NOTIFY
videoPortRangeChanged
);
...
...
@@ -213,8 +214,11 @@ public:
bool
getAdaptiveRateControlEnabled
()
const
;
void
setAdaptiveRateControlEnabled
(
bool
status
);
// bool getTcpPortEnabled () const;
// void setTcpPortEnabled (bool status);
int
getTcpPort
()
const
;
void
setTcpPort
(
int
port
);
int
getUdpPort
()
const
;
void
setUdpPort
(
int
port
);
QList
<
int
>
getAudioPortRange
()
const
;
void
setAudioPortRange
(
const
QList
<
int
>
&
range
);
...
...
@@ -303,7 +307,8 @@ signals:
bool
adaptiveRateControlEnabledChanged
(
bool
status
);
// void tcpPortEnabledChanged (bool status);
void
tcpPortChanged
(
int
port
);
void
udpPortChanged
(
int
port
);
void
audioPortRangeChanged
(
int
a
,
int
b
);
void
videoPortRangeChanged
(
int
a
,
int
b
);
...
...
linphone-desktop/ui/views/App/Settings/SettingsNetwork.qml
View file @
26171f84
...
...
@@ -116,9 +116,13 @@ TabContainer {
FormTableEntry
{
NumericField
{
minValue
:
0
minValue
:
1
maxValue
:
65535
readOnly
:
randomSipUdpPort
.
checked
||
!
enableSipUdpPort
.
checked
text
:
SettingsModel
.
udpPort
onEditingFinished
:
SettingsModel
.
udpPort
=
text
}
}
...
...
@@ -126,13 +130,22 @@ TabContainer {
Switch
{
id
:
randomSipUdpPort
readonly
property
int
defaultPort
:
5060
checked
:
SettingsModel
.
udpPort
===
-
1
enabled
:
enableSipUdpPort
.
checked
onClicked
:
SettingsModel
.
udpPort
=
checked
?
defaultPort
:
-
1
}
}
FormTableEntry
{
Switch
{
id
:
enableSipUdpPort
checked
:
SettingsModel
.
udpPort
!==
0
onClicked
:
SettingsModel
.
udpPort
=
checked
?
0
:
-
1
}
}
}
...
...
@@ -142,10 +155,13 @@ TabContainer {
FormTableEntry
{
NumericField
{
minValue
:
0
minValue
:
1
maxValue
:
65535
readOnly
:
randomSipTcpPort
.
checked
||
!
enableSipTcpPort
.
checked
text
:
SettingsModel
.
tcpPort
onEditingFinished
:
SettingsModel
.
tcpPort
=
text
}
}
...
...
@@ -153,13 +169,22 @@ TabContainer {
Switch
{
id
:
randomSipTcpPort
readonly
property
int
defaultPort
:
5060
checked
:
SettingsModel
.
tcpPort
===
-
1
enabled
:
enableSipTcpPort
.
checked
onClicked
:
SettingsModel
.
tcpPort
=
checked
?
defaultPort
:
-
1
}
}
FormTableEntry
{
Switch
{
id
:
enableSipTcpPort
checked
:
SettingsModel
.
tcpPort
!==
0
onClicked
:
SettingsModel
.
tcpPort
=
checked
?
0
:
-
1
}
}
}
...
...
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