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