Commit df1df560 authored by Ronan's avatar Ronan
Browse files

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

parent c08e7749
......@@ -817,6 +817,49 @@ Server url not configured.</translation>
<source>deleteHeader</source>
<translation>Delete</translation>
</message>
<message>
<source>deleteAccountDescription</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsSipAccountsEdit</name>
<message>
<source>sipAddressLabel</source>
<translation>SIP address</translation>
</message>
<message>
<source>transportLabel</source>
<translation>Transport</translation>
</message>
<message>
<source>serverAddressLabel</source>
<translation>SIP Server address</translation>
</message>
<message>
<source>registrationDurationLabel</source>
<translation>Registration duration (sec)</translation>
</message>
<message>
<source>routeLabel</source>
<translation>Route</translation>
</message>
<message>
<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>
<translation>AVPF regular RTCP interval (sec)</translation>
</message>
</context>
<context>
<name>SettingsUi</name>
......
......@@ -817,6 +817,49 @@ Url du serveur non configurée.</translation>
<source>deleteHeader</source>
<translation>Supprimer</translation>
</message>
<message>
<source>deleteAccountDescription</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsSipAccountsEdit</name>
<message>
<source>sipAddressLabel</source>
<translation>Adresse SIP</translation>
</message>
<message>
<source>transportLabel</source>
<translation>Transport</translation>
</message>
<message>
<source>serverAddressLabel</source>
<translation>Adresse serveur SIP</translation>
</message>
<message>
<source>registrationDurationLabel</source>
<translation>Durée d&apos;enregistrement</translation>
</message>
<message>
<source>routeLabel</source>
<translation>Route</translation>
</message>
<message>
<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>
<translation>Activer AVPF</translation>
</message>
</context>
<context>
<name>SettingsUi</name>
......
......@@ -340,6 +340,8 @@
<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.qml</file>
<file>ui/views/App/Settings/SettingsSipAccounts.js</file>
<file>ui/views/App/Settings/SettingsSipAccounts.qml</file>
<file>ui/views/App/Settings/SettingsUi.qml</file>
<file>ui/views/App/Settings/SettingsVideo.qml</file>
......
......@@ -34,6 +34,11 @@ void AccountSettingsModel::setDefaultProxyConfig (const shared_ptr<linphone::Pro
emit accountSettingsUpdated();
}
void AccountSettingsModel::removeProxyConfig (const shared_ptr<linphone::ProxyConfig> &proxy_config) {
CoreManager::getInstance()->getCore()->removeProxyConfig(proxy_config);
emit accountSettingsUpdated();
}
// -----------------------------------------------------------------------------
QString AccountSettingsModel::getUsername () const {
......
......@@ -44,6 +44,7 @@ public:
AccountSettingsModel (QObject *parent = Q_NULLPTR) : QObject(parent) {}
Q_INVOKABLE void setDefaultProxyConfig (const std::shared_ptr<linphone::ProxyConfig> &proxy_config);
Q_INVOKABLE void removeProxyConfig (const std::shared_ptr<linphone::ProxyConfig> &proxy_config);
signals:
void accountSettingsUpdated ();
......
// =============================================================================
// `SettingsSipAccounts.qml` Logic.
// =============================================================================
.import Linphone 1.0 as Linphone
.import 'qrc:/ui/scripts/Utils/utils.js' as Utils
// =============================================================================
function editAccount (account) {
window.attachVirtualWindow(Qt.resolvedUrl('SettingsSipAccountsEdit.qml'), {
account: account
})
}
function deleteAccount (account) {
window.attachVirtualWindow(Utils.buildDialogUri('ConfirmDialog'), {
descriptionText: qsTr('deleteAccountDescription'),
}, function (status) {
if (status) {
Linphone.AccountSettingsModel.removeProxyConfig(account.proxyConfig)
}
})
}
......@@ -6,6 +6,8 @@ import Linphone 1.0
import App.Styles 1.0
import 'SettingsSipAccounts.js' as Logic
// =============================================================================
TabContainer {
......@@ -66,7 +68,7 @@ TabContainer {
width: parent.width
FormTable {
legendLineWidth: 280
legendLineWidth: SettingsWindowStyle.sipAccounts.legendLineWidth
titles: [
qsTr('registerHeader'),
......@@ -88,6 +90,8 @@ TabContainer {
ActionButton {
icon: 'edit'
iconSize: SettingsWindowStyle.sipAccounts.iconSize
onClicked: Logic.editAccount(modelData)
}
}
......@@ -95,6 +99,8 @@ TabContainer {
ActionButton {
icon: 'delete'
iconSize: SettingsWindowStyle.sipAccounts.iconSize
onClicked: Logic.deleteAccount(modelData)
}
}
}
......
import QtQuick 2.7
import Common 1.0
import Linphone 1.0
import Utils 1.0
import App.Styles 1.0
// =============================================================================
ConfirmDialog {
property var account
height: 500
width: 600
// ---------------------------------------------------------------------------
Form {
anchors {
left: parent.left
leftMargin: ManageAccountsStyle.leftMargin
right: parent.right
rightMargin: ManageAccountsStyle.rightMargin
}
FormLine {
FormGroup {
label: qsTr('sipAddressLabel') + '*'
TextField {
}
}
}
FormLine {
FormGroup {
label: qsTr('serverAddressLabel') + '*'
TextField {
}
}
}
FormLine {
FormGroup {
label: qsTr('registrationDurationLabel') + '*'
TextField {
}
}
}
FormLine {
FormGroup {
label: qsTr('transportLabel') + '*'
ComboBox {
model: [ 'TCP', 'UDP', 'TLS' ]
}
}
}
FormLine {
FormGroup {
label: qsTr('routeLabel')
TextField {
}
}
}
FormLine {
FormGroup {
label: qsTr('contactParamsLabel')
TextField {
}
}
}
FormLine {
FormGroup {
label: qsTr('registerLabel')
Switch {
}
}
}
FormLine {
FormGroup {
label: qsTr('publishPresenceLabel')
Switch {
}
}
}
FormLine {
FormGroup {
label: qsTr('enableAvpfLabel')
Switch {
}
}
}
}
}
......@@ -20,5 +20,6 @@ QtObject {
property QtObject sipAccounts: QtObject {
property int buttonsSpacing: 8
property int iconSize: 20
property int legendLineWidth: 280
}
}
belle-sip @ 114b5be3
Subproject commit 86673fbeadb2979540df3c929857faf037fdf39c
Subproject commit 114b5be32a5b63ea68c8cf791230280981d2ec4c
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