Commit c1645184 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/Settings/SettingsSipAccounts): supports passwords deletion

parent c7ed899f
...@@ -894,6 +894,10 @@ Server url not configured.</translation> ...@@ -894,6 +894,10 @@ Server url not configured.</translation>
<source>deleteAccountDescription</source> <source>deleteAccountDescription</source>
<translation>Are you sure you want to delete this account?</translation> <translation>Are you sure you want to delete this account?</translation>
</message> </message>
<message>
<source>eraseAllPasswordsDescription</source>
<translation>Are you sure you want to erase all passwords?</translation>
</message>
</context> </context>
<context> <context>
<name>SettingsSipAccountsEdit</name> <name>SettingsSipAccountsEdit</name>
......
...@@ -894,6 +894,10 @@ Url du serveur non configurée.</translation> ...@@ -894,6 +894,10 @@ Url du serveur non configurée.</translation>
<source>deleteAccountDescription</source> <source>deleteAccountDescription</source>
<translation>Êtes-vous sûr de vouloir supprimer ce compte ?</translation> <translation>Êtes-vous sûr de vouloir supprimer ce compte ?</translation>
</message> </message>
<message>
<source>eraseAllPasswordsDescription</source>
<translation>Êtes-vous sûr de vouloir supprimer tous vos mots de passe ?</translation>
</message>
</context> </context>
<context> <context>
<name>SettingsSipAccountsEdit</name> <name>SettingsSipAccountsEdit</name>
......
...@@ -171,6 +171,10 @@ shared_ptr<linphone::ProxyConfig> AccountSettingsModel::createProxyConfig () { ...@@ -171,6 +171,10 @@ shared_ptr<linphone::ProxyConfig> AccountSettingsModel::createProxyConfig () {
return CoreManager::getInstance()->getCore()->createProxyConfig(); return CoreManager::getInstance()->getCore()->createProxyConfig();
} }
void AccountSettingsModel::eraseAllPasswords () {
CoreManager::getInstance()->getCore()->clearAllAuthInfo();
}
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString AccountSettingsModel::getUsername () const { QString AccountSettingsModel::getUsername () const {
......
...@@ -66,6 +66,8 @@ public: ...@@ -66,6 +66,8 @@ public:
Q_INVOKABLE std::shared_ptr<linphone::ProxyConfig> createProxyConfig (); Q_INVOKABLE std::shared_ptr<linphone::ProxyConfig> createProxyConfig ();
Q_INVOKABLE void eraseAllPasswords ();
signals: signals:
void accountSettingsUpdated (); void accountSettingsUpdated ();
......
...@@ -9,13 +9,19 @@ import Common.Styles 1.0 ...@@ -9,13 +9,19 @@ import Common.Styles 1.0
// ============================================================================= // =============================================================================
Rectangle { Rectangle {
id: dialog
property alias buttons: buttons.data // Optionnal. property alias buttons: buttons.data // Optionnal.
property alias descriptionText: description.text // Optionnal. property alias descriptionText: description.text // Optionnal.
property bool centeredButtons: false property bool centeredButtons: false
default property alias _content: content.data // Required. default property alias _content: content.data
property bool _disableExitStatus property bool _disableExitStatus
readonly property bool contentIsEmpty: {
return _content == null || !_content.length
}
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
signal exitStatus (int status) signal exitStatus (int status)
...@@ -54,13 +60,14 @@ Rectangle { ...@@ -54,13 +60,14 @@ Rectangle {
DialogDescription { DialogDescription {
id: description id: description
Layout.fillHeight: dialog.contentIsEmpty
Layout.fillWidth: true Layout.fillWidth: true
} }
Item { Item {
id: content id: content
Layout.fillHeight: true Layout.fillHeight: !dialog.contentIsEmpty
Layout.fillWidth: true Layout.fillWidth: true
} }
......
...@@ -23,3 +23,13 @@ function deleteAccount (account) { ...@@ -23,3 +23,13 @@ function deleteAccount (account) {
} }
}) })
} }
function eraseAllPasswords () {
window.attachVirtualWindow(Utils.buildDialogUri('ConfirmDialog'), {
descriptionText: qsTr('eraseAllPasswordsDescription'),
}, function (status) {
if (status) {
Linphone.AccountSettingsModel.eraseAllPasswords()
}
})
}
...@@ -112,6 +112,8 @@ TabContainer { ...@@ -112,6 +112,8 @@ TabContainer {
TextButtonB { TextButtonB {
text: qsTr('eraseAllPasswords') text: qsTr('eraseAllPasswords')
onClicked: Logic.eraseAllPasswords()
} }
TextButtonB { TextButtonB {
......
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