Commit 1086fdae authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/Settings/SettingsNetwork): supports tls port

parent 26171f84
......@@ -440,6 +440,22 @@ void SettingsModel::setUdpPort (int port) {
// -----------------------------------------------------------------------------
int SettingsModel::getTlsPort () const {
return CoreManager::getInstance()->getCore()->getTransports()->getTlsPort();
}
void SettingsModel::setTlsPort (int port) {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
shared_ptr<linphone::Transports> transports = core->getTransports();
transports->setTlsPort(port);
core->setTransports(transports);
emit tlsPortChanged(port);
}
// -----------------------------------------------------------------------------
QList<int> SettingsModel::getAudioPortRange () const {
shared_ptr<linphone::Range> range = CoreManager::getInstance()->getCore()->getAudioPortsRange();
return QList<int>() << range->getMin() << range->getMax();
......
......@@ -92,6 +92,7 @@ class SettingsModel : public QObject {
Q_PROPERTY(int tcpPort READ getTcpPort WRITE setTcpPort NOTIFY tcpPortChanged);
Q_PROPERTY(int udpPort READ getUdpPort WRITE setUdpPort NOTIFY udpPortChanged);
Q_PROPERTY(int tlsPort READ getTlsPort WRITE setTlsPort NOTIFY tlsPortChanged);
Q_PROPERTY(QList<int> audioPortRange READ getAudioPortRange WRITE setAudioPortRange NOTIFY audioPortRangeChanged);
Q_PROPERTY(QList<int> videoPortRange READ getVideoPortRange WRITE setVideoPortRange NOTIFY videoPortRangeChanged);
......@@ -220,6 +221,9 @@ public:
int getUdpPort () const;
void setUdpPort (int port);
int getTlsPort () const;
void setTlsPort (int port);
QList<int> getAudioPortRange () const;
void setAudioPortRange (const QList<int> &range);
......@@ -309,6 +313,7 @@ signals:
void tcpPortChanged (int port);
void udpPortChanged (int port);
void tlsPortChanged (int port);
void audioPortRangeChanged (int a, int b);
void videoPortRangeChanged (int a, int b);
......
......@@ -256,7 +256,11 @@ TabContainer {
FormGroup {
label: qsTr('enableTlsLabel')
Switch {}
Switch {
checked: SettingsModel.tlsPort !== 0
onClicked: SettingsModel.tlsPort = checked ? 0 : -1
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment