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,15 +70,24 @@ 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{
givenName.errorMessage = qsTr("Veuillez saisir un prénom") id: saveDelay
return interval: 200
} else if (addressesList.count === 0 && phoneNumberList.count === 0) { onTriggered:{
addressesErrorText.setText(qsTr("Veuillez saisir une adresse ou un numéro de téléphone")) if (mainItem.contact.core.givenName.length === 0) {
return givenName.errorMessage = qsTr("Veuillez saisir un prénom")
return
} else if (addressesList.count === 0 && phoneNumberList.count === 0) {
addressesErrorText.setText(qsTr("Veuillez saisir une adresse ou un numéro de téléphone"))
return
}
mainItem.contact.core.save()
} }
mainItem.contact.core.save() }
button.onClicked: {
button.forceActiveFocus()
saveDelay.restart()
} }
bannerContent: [ bannerContent: [
IconLabelButton { IconLabelButton {
@ -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
} }