From df1df5605fc5b2a18b1acf7555594e2a217e9d0d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 30 Mar 2017 17:11:45 +0200 Subject: [PATCH] feat(ui/views/App/Settings/SettingsSipAccounts): in progress --- linphone-desktop/assets/images/file.png | Bin 596 -> 0 bytes linphone-desktop/assets/languages/en.ts | 43 +++++++ linphone-desktop/assets/languages/fr.ts | 43 +++++++ linphone-desktop/resources.qrc | 2 + .../settings/AccountSettingsModel.cpp | 5 + .../settings/AccountSettingsModel.hpp | 1 + .../views/App/Settings/SettingsSipAccounts.js | 25 ++++ .../App/Settings/SettingsSipAccounts.qml | 8 +- .../App/Settings/SettingsSipAccountsEdit.qml | 117 ++++++++++++++++++ .../Styles/Settings/SettingsWindowStyle.qml | 1 + submodules/belle-sip | 2 +- 11 files changed, 245 insertions(+), 2 deletions(-) delete mode 100644 linphone-desktop/assets/images/file.png create mode 100644 linphone-desktop/ui/views/App/Settings/SettingsSipAccounts.js create mode 100644 linphone-desktop/ui/views/App/Settings/SettingsSipAccountsEdit.qml diff --git a/linphone-desktop/assets/images/file.png b/linphone-desktop/assets/images/file.png deleted file mode 100644 index 188c12c144a1fcf583243ff3e60bfce36131f401..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 596 zcmV-a0;~OrP)Ll1)g|Q5400@Be=`iYfN}0R=%RxhNv+gN%v_aw9E; z3JRi~5!9}2t9G>uY!yM9Xi*X5LZpZyEUHC>5kg-w>M)Kojx+yv?`<)oW{pC0;PBwS zch0@sqT|eJ$t)1ui{BdZ(M)Qibq`WXTJcxt@2bCGCW5zzk?yd`XHKS0N zoD-%C#>jZUM!r=mtqVIkN86@mHZ&Tq9^b-?DAW1e+<}qtz}-9dh~v2C$Rfh2Gd--_ z+DK9=;zf+f>;y>&mH5nvBg2<0-l!E1Pv!1~UMxVR2e zP!WoSDaM9BP%h2Pi>m?8a`n2+WDAPV<^%amhFop}%*}sit6s_sGX(=v#Z*yKGNWI~ z<^w)AW2Aq6p`mFNQ54}^l~IIqF=~Q}AW~UF2%thP^Mh deleteHeader Delete + + deleteAccountDescription + + + + + SettingsSipAccountsEdit + + sipAddressLabel + SIP address + + + transportLabel + Transport + + + serverAddressLabel + SIP Server address + + + registrationDurationLabel + Registration duration (sec) + + + routeLabel + Route + + + contactParamsLabel + Contact params + + + registerLabel + Register + + + publishPresenceLabel + Publish presence information + + + enableAvpfLabel + AVPF regular RTCP interval (sec) + SettingsUi diff --git a/linphone-desktop/assets/languages/fr.ts b/linphone-desktop/assets/languages/fr.ts index 543b892ca..ff6b9df95 100644 --- a/linphone-desktop/assets/languages/fr.ts +++ b/linphone-desktop/assets/languages/fr.ts @@ -817,6 +817,49 @@ Url du serveur non configurée. deleteHeader Supprimer + + deleteAccountDescription + + + + + SettingsSipAccountsEdit + + sipAddressLabel + Adresse SIP + + + transportLabel + Transport + + + serverAddressLabel + Adresse serveur SIP + + + registrationDurationLabel + Durée d'enregistrement + + + routeLabel + Route + + + contactParamsLabel + Paramètres de contact + + + registerLabel + S'enregistrer + + + publishPresenceLabel + Publier la présence + + + enableAvpfLabel + Activer AVPF + SettingsUi diff --git a/linphone-desktop/resources.qrc b/linphone-desktop/resources.qrc index 1b3341c90..7a529f5f8 100644 --- a/linphone-desktop/resources.qrc +++ b/linphone-desktop/resources.qrc @@ -340,6 +340,8 @@ ui/views/App/Settings/SettingsAudio.qml ui/views/App/Settings/SettingsCallsChat.qml ui/views/App/Settings/SettingsNetwork.qml + ui/views/App/Settings/SettingsSipAccountsEdit.qml + ui/views/App/Settings/SettingsSipAccounts.js ui/views/App/Settings/SettingsSipAccounts.qml ui/views/App/Settings/SettingsUi.qml ui/views/App/Settings/SettingsVideo.qml diff --git a/linphone-desktop/src/components/settings/AccountSettingsModel.cpp b/linphone-desktop/src/components/settings/AccountSettingsModel.cpp index 5fb3cbe62..28fe87491 100644 --- a/linphone-desktop/src/components/settings/AccountSettingsModel.cpp +++ b/linphone-desktop/src/components/settings/AccountSettingsModel.cpp @@ -34,6 +34,11 @@ void AccountSettingsModel::setDefaultProxyConfig (const shared_ptr &proxy_config) { + CoreManager::getInstance()->getCore()->removeProxyConfig(proxy_config); + emit accountSettingsUpdated(); +} + // ----------------------------------------------------------------------------- QString AccountSettingsModel::getUsername () const { diff --git a/linphone-desktop/src/components/settings/AccountSettingsModel.hpp b/linphone-desktop/src/components/settings/AccountSettingsModel.hpp index 086bf893b..7affddb70 100644 --- a/linphone-desktop/src/components/settings/AccountSettingsModel.hpp +++ b/linphone-desktop/src/components/settings/AccountSettingsModel.hpp @@ -44,6 +44,7 @@ public: AccountSettingsModel (QObject *parent = Q_NULLPTR) : QObject(parent) {} Q_INVOKABLE void setDefaultProxyConfig (const std::shared_ptr &proxy_config); + Q_INVOKABLE void removeProxyConfig (const std::shared_ptr &proxy_config); signals: void accountSettingsUpdated (); diff --git a/linphone-desktop/ui/views/App/Settings/SettingsSipAccounts.js b/linphone-desktop/ui/views/App/Settings/SettingsSipAccounts.js new file mode 100644 index 000000000..98a44bb2b --- /dev/null +++ b/linphone-desktop/ui/views/App/Settings/SettingsSipAccounts.js @@ -0,0 +1,25 @@ +// ============================================================================= +// `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) + } + }) +} diff --git a/linphone-desktop/ui/views/App/Settings/SettingsSipAccounts.qml b/linphone-desktop/ui/views/App/Settings/SettingsSipAccounts.qml index 6ca6c2a3e..b13c5dbcb 100644 --- a/linphone-desktop/ui/views/App/Settings/SettingsSipAccounts.qml +++ b/linphone-desktop/ui/views/App/Settings/SettingsSipAccounts.qml @@ -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) } } } diff --git a/linphone-desktop/ui/views/App/Settings/SettingsSipAccountsEdit.qml b/linphone-desktop/ui/views/App/Settings/SettingsSipAccountsEdit.qml new file mode 100644 index 000000000..eba45d4f2 --- /dev/null +++ b/linphone-desktop/ui/views/App/Settings/SettingsSipAccountsEdit.qml @@ -0,0 +1,117 @@ +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 { + + } + } + } + } +} diff --git a/linphone-desktop/ui/views/App/Styles/Settings/SettingsWindowStyle.qml b/linphone-desktop/ui/views/App/Styles/Settings/SettingsWindowStyle.qml index 3484eec7b..e0d2e9210 100644 --- a/linphone-desktop/ui/views/App/Styles/Settings/SettingsWindowStyle.qml +++ b/linphone-desktop/ui/views/App/Styles/Settings/SettingsWindowStyle.qml @@ -20,5 +20,6 @@ QtObject { property QtObject sipAccounts: QtObject { property int buttonsSpacing: 8 property int iconSize: 20 + property int legendLineWidth: 280 } } diff --git a/submodules/belle-sip b/submodules/belle-sip index 86673fbea..114b5be32 160000 --- a/submodules/belle-sip +++ b/submodules/belle-sip @@ -1 +1 @@ -Subproject commit 86673fbeadb2979540df3c929857faf037fdf39c +Subproject commit 114b5be32a5b63ea68c8cf791230280981d2ec4c