GODT-1910: Fix save button state not being updated after being clicked once.

This commit is contained in:
Xavier Michelon
2022-11-28 16:50:03 +01:00
parent d4b8f3e1c2
commit 9881011043
5 changed files with 4 additions and 14 deletions

View File

@ -150,7 +150,7 @@ SettingsView {
id: sendButton
text: qsTr("Send")
colorScheme: root.colorScheme
enabled: !loading
onClicked: {
description.validate()
address.validate()

View File

@ -117,7 +117,7 @@ SettingsView {
root.submit()
}
enabled: (imapSSLButton.checked !== Backend.useSSLForIMAP) || (smtpSSLButton.checked !== Backend.useSSLForSMTP)
enabled: (!loading) && ((imapSSLButton.checked !== Backend.useSSLForIMAP) || (smtpSSLButton.checked !== Backend.useSSLForSMTP))
}
Button {

View File

@ -33,7 +33,7 @@ SettingsView {
function refresh() {
diskCacheSetting.description = Backend.nativePath(root.diskCachePath)
submitButton.enabled = !Backend.areSameFileOrFolder(Backend.diskCachePath, root.diskCachePath)
submitButton.enabled = (!submitButton.loading) && !Backend.areSameFileOrFolder(Backend.diskCachePath, root.diskCachePath)
}
Label {

View File

@ -84,7 +84,7 @@ SettingsView {
id: submitButton
colorScheme: root.colorScheme
text: qsTr("Save")
enabled: root._valuesChanged
enabled: (!loading) && root._valuesChanged
onClicked: {
// removing error here because we may have set it manually (port occupied)
imapField.error = false

View File

@ -38,16 +38,6 @@ T.Button {
property alias textVerticalAlignment: label.verticalAlignment
property alias textHorizontalAlignment: label.horizontalAlignment
// TODO: store previous enabled state and restore it?
// For now assuming that only enabled buttons could have loading state
onLoadingChanged: {
if (loading) {
enabled = false
} else {
enabled = true
}
}
id: control
implicitWidth: Math.max(