Update meeting title while typing.

Take account sip address on losing focus when saving contact.
This commit is contained in:
Julien Wadel 2025-01-15 19:15:00 +01:00
parent 4181d19631
commit ae82cd0ea6
2 changed files with 20 additions and 11 deletions

View file

@ -70,8 +70,12 @@ MainRightPanel {
contact: mainItem.contact contact: mainItem.contact
button.text: mainItem.saveButtonText button.text: mainItem.saveButtonText
button.onClicked: { // Let some time to GUI to set fields on losing focus.
if (contact.core.givenName.length === 0) { Timer{
id: saveDelay
interval: 200
onTriggered:{
if (mainItem.contact.core.givenName.length === 0) {
givenName.errorMessage = qsTr("Veuillez saisir un prénom") givenName.errorMessage = qsTr("Veuillez saisir un prénom")
return return
} else if (addressesList.count === 0 && phoneNumberList.count === 0) { } else if (addressesList.count === 0 && phoneNumberList.count === 0) {
@ -80,6 +84,11 @@ MainRightPanel {
} }
mainItem.contact.core.save() mainItem.contact.core.save()
} }
}
button.onClicked: {
button.forceActiveFocus()
saveDelay.restart()
}
bannerContent: [ bannerContent: [
IconLabelButton { IconLabelButton {
id: addPictureButton id: addPictureButton
@ -397,7 +406,7 @@ MainRightPanel {
Layout.fillWidth: true Layout.fillWidth: true
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
elide: Text.ElideRight elide: Text.ElideRight
onTextChanged: if(text.length > 0) editionLayout.ensureVisible(this) onTextChanged: if(addressesErrorText.text.length > 0) editionLayout.ensureVisible(this)
} }
Item{Layout.fillHeight: true} Item{Layout.fillHeight: true}
} }

View file

@ -374,7 +374,7 @@ AbstractMainPage {
KeyNavigation.down: conferenceEdit KeyNavigation.down: conferenceEdit
KeyNavigation.up: conferenceEdit KeyNavigation.up: conferenceEdit
onActiveFocusChanged: if(activeFocus==true) selectAll() onActiveFocusChanged: if(activeFocus==true) selectAll()
onEditingFinished: mainItem.selectedConference.core.subject = text onTextEdited: mainItem.selectedConference.core.subject = text
Component.onCompleted: { Component.onCompleted: {
text = mainItem.selectedConference.core.subject text = mainItem.selectedConference.core.subject
} }