forked from Silverfish/proton-bridge
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
|
id: sendButton
|
||||||
text: qsTr("Send")
|
text: qsTr("Send")
|
||||||
colorScheme: root.colorScheme
|
colorScheme: root.colorScheme
|
||||||
|
enabled: !loading
|
||||||
onClicked: {
|
onClicked: {
|
||||||
description.validate()
|
description.validate()
|
||||||
address.validate()
|
address.validate()
|
||||||
|
|||||||
@ -117,7 +117,7 @@ SettingsView {
|
|||||||
root.submit()
|
root.submit()
|
||||||
}
|
}
|
||||||
|
|
||||||
enabled: (imapSSLButton.checked !== Backend.useSSLForIMAP) || (smtpSSLButton.checked !== Backend.useSSLForSMTP)
|
enabled: (!loading) && ((imapSSLButton.checked !== Backend.useSSLForIMAP) || (smtpSSLButton.checked !== Backend.useSSLForSMTP))
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
|||||||
@ -33,7 +33,7 @@ SettingsView {
|
|||||||
|
|
||||||
function refresh() {
|
function refresh() {
|
||||||
diskCacheSetting.description = Backend.nativePath(root.diskCachePath)
|
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 {
|
Label {
|
||||||
|
|||||||
@ -84,7 +84,7 @@ SettingsView {
|
|||||||
id: submitButton
|
id: submitButton
|
||||||
colorScheme: root.colorScheme
|
colorScheme: root.colorScheme
|
||||||
text: qsTr("Save")
|
text: qsTr("Save")
|
||||||
enabled: root._valuesChanged
|
enabled: (!loading) && root._valuesChanged
|
||||||
onClicked: {
|
onClicked: {
|
||||||
// removing error here because we may have set it manually (port occupied)
|
// removing error here because we may have set it manually (port occupied)
|
||||||
imapField.error = false
|
imapField.error = false
|
||||||
|
|||||||
@ -38,16 +38,6 @@ T.Button {
|
|||||||
property alias textVerticalAlignment: label.verticalAlignment
|
property alias textVerticalAlignment: label.verticalAlignment
|
||||||
property alias textHorizontalAlignment: label.horizontalAlignment
|
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
|
id: control
|
||||||
|
|
||||||
implicitWidth: Math.max(
|
implicitWidth: Math.max(
|
||||||
|
|||||||
Reference in New Issue
Block a user