Skip to content
Snippets Groups Projects
Commit 2c854276 authored by Amin Bandali's avatar Amin Bandali
Browse files

deleteaccountdialog: disable delete button when it's clicked

This is so that the user cannot accidentally click Delete again and
delete another account.  Also, show a BusyIndicator spinning wheel
when Delete is clicked, so as to give the user visual feedback that
something is happening.

Also, set the account Id, best name, and whether it's a SIP account
from outside when opening the dialog, so that they don't automatically
change when the next account is selected if the user confirms the
deletion of the current account.

GitLab: #711
Change-Id: I4e93deb4f74257387884edc62d76a5b3cb58d845
parent 92829ad3
No related branches found
No related tags found
No related merge requests found
......@@ -24,19 +24,12 @@ import net.jami.Models 1.1
import net.jami.Adapters 1.1
import net.jami.Constants 1.1
import "../commoncomponents"
BaseModalDialog {
id: root
property bool isSIP: {
switch (CurrentAccount.type) {
case Profile.Type.SIP:
return true;
default:
return false;
}
}
property bool isSIP: false
property string bestName: ""
property string accountId: ""
signal accepted
......@@ -74,7 +67,7 @@ BaseModalDialog {
JamiTheme.preferredMarginSize * 2
color: JamiTheme.textColor
text: CurrentAccount.bestName
text: bestName
font.pointSize: JamiTheme.textFontSize
font.kerning: true
......@@ -93,7 +86,7 @@ BaseModalDialog {
JamiTheme.preferredMarginSize * 2
color: JamiTheme.textColor
text: CurrentAccount.uri
text: accountId
font.pointSize: JamiTheme.textFontSize
font.kerning: true
......@@ -144,10 +137,27 @@ BaseModalDialog {
text: JamiStrings.optionDelete
Connections {
target: root
function onClosed() { btnDelete.enabled = true }
}
onClicked: {
btnDelete.enabled = false
busyInd.running = true
AccountAdapter.deleteCurrentAccount()
accepted()
close()
accepted()
}
}
BusyIndicator {
id: busyInd
running: false
Connections {
target: root
function onClosed() { busyInd.running = false }
}
}
......
......@@ -58,6 +58,9 @@ Rectangle {
}
function delAccountSlot() {
deleteAccountDialog.isSIP = CurrentAccount.type === Profile.Type.SIP
deleteAccountDialog.bestName = CurrentAccount.bestName
deleteAccountDialog.accountId = CurrentAccount.uri
deleteAccountDialog.open()
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment