Commit 2847cd73 authored by Ronan's avatar Ronan
Browse files

feat(ui/views/App/Settings/SettingsSipAccounts): in progress

parent df1df560
......@@ -487,7 +487,7 @@ Server url not configured.</translation>
</message>
<message>
<source>defaultMessage</source>
<translation type="unfinished"></translation>
<translation type="unfinished></translation>
</message>
<message>
<source>defaultSubject</source>
......@@ -848,18 +848,22 @@ Server url not configured.</translation>
<source>contactParamsLabel</source>
<translation>Contact params</translation>
</message>
<message>
<source>registerLabel</source>
<translation>Register</translation>
</message>
<message>
<source>publishPresenceLabel</source>
<translation>Publish presence information</translation>
</message>
<message>
<source>enableAvpfLabel</source>
<source>avpfIntervalLabel</source>
<translation>AVPF regular RTCP interval (sec)</translation>
</message>
<message>
<source>registerEnabledLabel</source>
<translation>Register</translation>
</message>
<message>
<source>avpfEnabledLabel</source>
<translation>Enable AVPF</translation>
</message>
</context>
<context>
<name>SettingsUi</name>
......
......@@ -848,16 +848,20 @@ Url du serveur non configurée.</translation>
<source>contactParamsLabel</source>
<translation>Paramètres de contact</translation>
</message>
<message>
<source>registerLabel</source>
<translation>S&apos;enregistrer</translation>
</message>
<message>
<source>publishPresenceLabel</source>
<translation>Publier la présence</translation>
</message>
<message>
<source>enableAvpfLabel</source>
<source>avpfIntervalLabel</source>
<translation>Intervalle standard RTCP AVPF (sec)</translation>
</message>
<message>
<source>registerEnabledLabel</source>
<translation>S&apos;enregistrer</translation>
</message>
<message>
<source>avpfEnabledLabel</source>
<translation>Activer AVPF</translation>
</message>
</context>
......
......@@ -340,6 +340,7 @@
<file>ui/views/App/Settings/SettingsAudio.qml</file>
<file>ui/views/App/Settings/SettingsCallsChat.qml</file>
<file>ui/views/App/Settings/SettingsNetwork.qml</file>
<file>ui/views/App/Settings/SettingsSipAccountsEdit.js</file>
<file>ui/views/App/Settings/SettingsSipAccountsEdit.qml</file>
<file>ui/views/App/Settings/SettingsSipAccounts.js</file>
<file>ui/views/App/Settings/SettingsSipAccounts.qml</file>
......@@ -363,6 +364,7 @@
<file>ui/views/App/Styles/Main/MainWindowStyle.qml</file>
<file>ui/views/App/Styles/Main/ManageAccountsStyle.qml</file>
<file>ui/views/App/Styles/qmldir</file>
<file>ui/views/App/Styles/Settings/SettingsSipAccountsEditStyle.qml</file>
<file>ui/views/App/Styles/Settings/SettingsWindowStyle.qml</file>
<file>ui/views/App/Styles/SplashScreen/SplashScreenStyle.qml</file>
</qresource>
......
......@@ -29,6 +29,25 @@
// =============================================================================
QVariantMap AccountSettingsModel::getProxyConfigDescription (const std::shared_ptr<linphone::ProxyConfig> &proxy_config) {
Q_ASSERT(proxy_config != nullptr);
QVariantMap map;
map["sipAddress"] = ::Utils::linphoneStringToQString(proxy_config->getIdentityAddress()->asStringUriOnly());
map["serverAddress"] = ::Utils::linphoneStringToQString(proxy_config->getServerAddr());
map["registrationDuration"] = proxy_config->getPublishExpires();
map["transport"] = ::Utils::linphoneStringToQString(proxy_config->getTransport());
map["route"] = ::Utils::linphoneStringToQString(proxy_config->getRoute());
map["contactParams"] = ::Utils::linphoneStringToQString(proxy_config->getContactParameters());
map["avpfInterval"] = proxy_config->getAvpfRrInterval();
map["registerEnabled"] = proxy_config->registerEnabled();
map["publishPresence"] = proxy_config->publishEnabled();
map["avpfEnabled"] = proxy_config->getAvpfMode() == linphone::AVPFMode::AVPFModeEnabled;
return map;
}
void AccountSettingsModel::setDefaultProxyConfig (const shared_ptr<linphone::ProxyConfig> &proxy_config) {
CoreManager::getInstance()->getCore()->setDefaultProxyConfig(proxy_config);
emit accountSettingsUpdated();
......
......@@ -43,6 +43,7 @@ class AccountSettingsModel : public QObject {
public:
AccountSettingsModel (QObject *parent = Q_NULLPTR) : QObject(parent) {}
Q_INVOKABLE QVariantMap getProxyConfigDescription (const std::shared_ptr<linphone::ProxyConfig> &proxy_config);
Q_INVOKABLE void setDefaultProxyConfig (const std::shared_ptr<linphone::ProxyConfig> &proxy_config);
Q_INVOKABLE void removeProxyConfig (const std::shared_ptr<linphone::ProxyConfig> &proxy_config);
......
......@@ -77,7 +77,7 @@ TabContainer {
]
Repeater {
model: AccountSettingsModel.accounts
model: AccountSettingsModel.accounts.slice(1)
delegate: FormTableLine {
title: modelData.sipAddress
......
// =============================================================================
// `SettingsSipAccounts.qml` Logic.
// =============================================================================
.import Linphone 1.0 as Linphone
.import 'qrc:/ui/scripts/Utils/utils.js' as Utils
// =============================================================================
function initForm (account) {
if (!account) {
return
}
var config = Linphone.AccountSettingsModel.getProxyConfigDescription(account.proxyConfig)
sipAddress.text = config.sipAddress
serverAddress.text = config.serverAddress
registrationDuration.text = config.registrationDuration
var currentTransport = config.transport.toUpperCase()
transport.currentIndex = Utils.findIndex(transport.model, function (value) {
return value === currentTransport
})
route.text = config.route
contactParams.text = config.contactParams
avpfInterval.text = config.avpfInterval
registerEnabled.checked = config.registerEnabled
publishPresence.checked = config.publishPresence
avpfEnabled.checked = config.avpfEnabled
}
......@@ -6,13 +6,19 @@ import Utils 1.0
import App.Styles 1.0
import 'SettingsSipAccountsEdit.js' as Logic
// =============================================================================
ConfirmDialog {
property var account
height: 500
width: 600
height: SettingsSipAccountsEditStyle.height
width: SettingsSipAccountsEditStyle.width
// ---------------------------------------------------------------------------
Component.onCompleted: Logic.initForm(account)
// ---------------------------------------------------------------------------
......@@ -29,7 +35,7 @@ ConfirmDialog {
label: qsTr('sipAddressLabel') + '*'
TextField {
id: sipAddress
}
}
}
......@@ -39,26 +45,28 @@ ConfirmDialog {
label: qsTr('serverAddressLabel') + '*'
TextField {
id: serverAddress
}
}
}
FormLine {
FormGroup {
label: qsTr('registrationDurationLabel') + '*'
TextField {
label: qsTr('registrationDurationLabel')
NumericField {
id: registrationDuration
}
}
}
FormLine {
FormGroup {
label: qsTr('transportLabel') + '*'
label: qsTr('transportLabel')
ComboBox {
id: transport
model: [ 'TCP', 'UDP', 'TLS' ]
}
}
......@@ -69,7 +77,7 @@ ConfirmDialog {
label: qsTr('routeLabel')
TextField {
id: route
}
}
}
......@@ -79,17 +87,27 @@ ConfirmDialog {
label: qsTr('contactParamsLabel')
TextField {
id: contactParams
}
}
}
FormLine {
FormGroup {
label: qsTr('avpfIntervalLabel')
NumericField {
id: avpfInterval
}
}
}
FormLine {
FormGroup {
label: qsTr('registerLabel')
label: qsTr('registerEnabledLabel')
Switch {
id: registerEnabled
}
}
}
......@@ -99,17 +117,17 @@ ConfirmDialog {
label: qsTr('publishPresenceLabel')
Switch {
id: publishPresence
}
}
}
FormLine {
FormGroup {
label: qsTr('enableAvpfLabel')
label: qsTr('avpfEnabledLabel')
Switch {
id: avpfEnabled
}
}
}
......
pragma Singleton
import QtQuick 2.7
// =============================================================================
QtObject {
property int height: 550
property int width: 600
}
......@@ -23,5 +23,5 @@ singleton MainWindowStyle 1.0 Main/MainWindowStyle.qml
singleton ManageAccountsStyle 1.0 Main/ManageAccountsStyle.qml
singleton SettingsWindowStyle 1.0 Settings/SettingsWindowStyle.qml
singleton SettingsSipAccountsEditStyle 1.0 Settings/SettingsSipAccountsEditStyle.qml
singleton SplashScreenStyle 1.0 SplashScreen/SplashScreenStyle.qml
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