mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-15 14:56:42 +00:00
GODT-1910: Fix save button state not being updated after being clicked once.
This commit is contained in:
@ -150,7 +150,7 @@ SettingsView {
|
||||
id: sendButton
|
||||
text: qsTr("Send")
|
||||
colorScheme: root.colorScheme
|
||||
|
||||
enabled: !loading
|
||||
onClicked: {
|
||||
description.validate()
|
||||
address.validate()
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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(
|
||||
|
||||
Reference in New Issue
Block a user