This commit is contained in:
Gaelle Braud 2024-07-09 14:24:22 +02:00
parent 4927a02c93
commit f97ca67a56
21 changed files with 64 additions and 70 deletions

View file

@ -76,10 +76,10 @@ bool ConferenceInfoProxy::filterAcceptsRow(int sourceRow, const QModelIndex &sou
if (ciCore) {
bool searchTextInSubject = false;
bool searchTextInParticipant = false;
if (ciCore->getSubject().toLower().contains(mSearchText.toLower())) searchTextInSubject = true;
if (ciCore->getSubject().contains(mSearchText, Qt::CaseInsensitive)) searchTextInSubject = true;
for (auto &contact : ciCore->getParticipants()) {
auto infos = contact.toMap();
if (infos["displayName"].toString().toLower().contains(mSearchText.toLower())) {
if (infos["displayName"].toString().contains(mSearchText, Qt::CaseInsensitive)) {
searchTextInParticipant = true;
break;
}

View file

@ -176,15 +176,15 @@ QVariant MagicSearchList::data(const QModelIndex &index, int role) const {
int MagicSearchList::findFriendIndexByAddress(const QString &address) {
int i = 0;
qDebug() << "LOOKING FOR ADDRESS" << address;
qDebug() << "[MagicSearchList] LOOKING FOR ADDRESS" << address;
for (auto &item : mList) {
qDebug() << "item" << item;
auto isFriendCore = item.objectCast<FriendCore>();
if (!isFriendCore) continue;
qDebug() << "SEARCH IN FRIEND" << isFriendCore->getDisplayName();
qDebug() << "[MagicSearchList] SEARCH IN FRIEND" << isFriendCore->getDisplayName();
for (auto &friendAddress : isFriendCore->getAllAddresses()) {
auto map = friendAddress.toMap();
qDebug() << "COMPARE" << map["address"].toString();
// qDebug() << "COMPARE" << map["address"].toString();
if (map["address"].toString() == address) {
return i;
}

View file

@ -130,7 +130,7 @@ bool ToolModel::createCall(const QString &sipAddress,
}
for (auto &account : core->getAccountList()) {
if (account->getContactAddress() && account->getContactAddress()->weakEqual(address)) {
if (errorMessage) *errorMessage = "The calling address is a connected account.";
if (errorMessage) *errorMessage = tr("The calling address is a connected account.");
lDebug() << "[" + QString(gClassName) + "]" + *errorMessage;
return false;
}

View file

@ -115,8 +115,8 @@ AppWindow {
Connections {
enabled: !!call
target: call && call.core
onRemoteVideoEnabledChanged: console.log("remote video enabled", call.core.remoteVideoEnabled)
onSecurityUpdated: {
function onRemoteVideoEnabledChanged() { console.log("remote video enabled", call.core.remoteVideoEnabled)}
function onSecurityUpdated() {
if (call.core.encryption != LinphoneEnums.MediaEncryption.Zrtp || call.core.tokenVerified) {
zrtpValidation.close()
}
@ -693,9 +693,6 @@ AppWindow {
? modelData.core.conference.core.subject
: remoteAddress ? remoteAddress.value : ""
Layout.leftMargin: 8 * DefaultStyle.dp
Connections {
target: modelData.core
}
}
Item {
Layout.fillHeight: true
@ -823,7 +820,7 @@ AppWindow {
Connections {
target: rightPanel
onReturnRequested: participantsStack.pop()
function onReturnRequested(){ participantsStack.pop()}
}
Component {
@ -866,13 +863,13 @@ AppWindow {
}
Connections {
target: participantsStack
onCurrentItemChanged: {
function onCurrentItemChanged() {
if (participantsStack.currentItem == participantList) rightPanel.headerTitleText = qsTr("Participants (%1)").arg(participantList.count)
}
}
Connections {
target: rightPanel
onValidateRequested: {
function onValidateRequested() {
participantList.model.addAddresses(participantsStack.selectedParticipants)
participantsStack.pop()
participantsStack.participantAdded()
@ -892,7 +889,7 @@ AppWindow {
}
Connections {
target: participantsStack
onCurrentItemChanged: {
function onCurrentItemChanged() {
if (participantsStack.currentItem == addParticipantLayout) {
rightPanel.headerTitleText = qsTr("Ajouter des participants")
rightPanel.headerSubtitleText = qsTr("%1 participant%2 sélectionné%2").arg(addParticipantLayout.selectedParticipants.length).arg(addParticipantLayout.selectedParticipants.length > 1 ? "s" : "")
@ -1155,11 +1152,11 @@ AppWindow {
}
Connections {
target: rightPanel
onVisibleChanged: if (!visible) waitingRoomIn.settingsButtonChecked = false
function onVisibleChanged(){ if (!visible) waitingRoomIn.settingsButtonChecked = false}
}
Connections {
target:mainWindow
onSetUpConferenceRequested: (conferenceInfo) => {
function onSetUpConferenceRequested(conferenceInfo) {
waitingRoomIn.conferenceInfo = conferenceInfo
}
}
@ -1204,8 +1201,8 @@ AppWindow {
Connections {
target: mainWindow
onCallStateChanged: bottomButtonsLayout.refreshLayout()
onCallChanged: bottomButtonsLayout.refreshLayout()
function onCallStateChanged(){ bottomButtonsLayout.refreshLayout()}
function onCallChanged(){ bottomButtonsLayout.refreshLayout()}
}
function setButtonsEnabled(enabled) {
for(var i=0; i < children.length; ++i) {
@ -1285,7 +1282,7 @@ AppWindow {
}
Connections {
target: rightPanel
onVisibleChanged: if(!rightPanel.visible) transferCallButton.checked = false
function onVisibleChanged(){ if(!rightPanel.visible) transferCallButton.checked = false}
}
}
CheckableButton {
@ -1404,7 +1401,7 @@ AppWindow {
popup.x: width/2
Connections {
target: moreOptionsButton.popup
onOpened: {
function onOpened() {
moreOptionsButton.popup.y = - moreOptionsButton.popup.height - moreOptionsButton.popup.padding
}
}

View file

@ -379,8 +379,8 @@ Item {
id: callPage
Connections {
target: mainItem
onOpenNewCall: callPage.goToNewCall()
onOpenCallHistory: callPage.goToCallHistory()
function onOpenNewCall(){ callPage.goToNewCall()}
function onOpenCallHistory(){ callPage.goToCallHistory()}
}
onCreateContactRequested: (name, address) => {
mainItem.createContact(name, address)
@ -390,10 +390,10 @@ Item {
id: contactPage
Connections {
target: mainItem
onCreateContactRequested: (name, address) => {
function onCreateContactRequested (name, address) {
contactPage.createContact(name, address)
}
onDisplayContact: (contactAddress) => {
function onDisplayContact (contactAddress) {
contactPage.displayContact(contactAddress)
}
}

View file

@ -233,7 +233,7 @@ GenericSettingsLayout {
}
Connections {
target: SettingsCpp
onMicVolumeChanged: volume => audioTestSlider.value = volume
function onMicVolumeChanged(volume) { audioTestSlider.value = volume}
}
Component.onCompleted: {
SettingsCpp.accessCallSettings()

View file

@ -73,7 +73,7 @@ GenericSettingsLayout {
}
Connections {
target: SettingsCpp
onLogsUploadTerminated: {
function onLogsUploadTerminated() {
UtilsCpp.getMainWindow().closeLoadingPopup()
if (status) {
mainItem.logsUrl = url

View file

@ -104,14 +104,14 @@ AppWindow {
onBrowserValidationRequested: mainWindow.showLoadingPopup(qsTr("Veuillez valider le captcha sur la page web"), true)
Connections {
target: RegisterPageCpp
onNewAccountCreationSucceed: (withEmail, address, sipIdentityAddress) => {
function onNewAccountCreationSucceed(withEmail, address, sipIdentityAddress) {
mainWindowStackView.push(checkingPage, {"registerWithEmail": withEmail, "address": address, "sipIdentityAddress": sipIdentityAddress})
}
onRegisterNewAccountFailed: (errorMessage) => {
function onRegisterNewAccountFailed(errorMessage) {
mainWindow.showInformationPopup(qsTr("Erreur lors de la création"), errorMessage, false)
mainWindow.closeLoadingPopup()
}
onTokenConversionSucceed: mainWindow.closeLoadingPopup()
function onTokenConversionSucceed(){ mainWindow.closeLoadingPopup()}
}
}
}
@ -124,11 +124,11 @@ AppWindow {
}
Connections {
target: RegisterPageCpp
onLinkingNewAccountWithCodeSucceed: {
function onLinkingNewAccountWithCodeSucceed() {
mainWindowStackView.replace(loginPage)
mainWindow.showInformationPopup(qsTr("Compte créé"), qsTr("Le compte a été créé avec succès. Vous pouvez maintenant vous connecter"), true)
}
onLinkingNewAccountWithCodeFailed: (errorMessage) => {
function onLinkingNewAccountWithCodeFailed(errorMessage) {
if (errorMessage.length === 0) errorMessage = qsTr("Erreur dans le code de validation")
mainWindow.showInformationPopup(qsTr("Erreur"), errorMessage, false)
}

View file

@ -14,7 +14,7 @@ RightPanelLayout {
property FriendGui contact
Connections {
target: contact.core
onIsSavedChanged: {
function onIsSavedChanged() {
if (contact.core.isSaved) {
var mainWin = UtilsCpp.getMainWindow()
UtilsCpp.smartShowWindow(mainWin)
@ -305,12 +305,9 @@ RightPanelLayout {
topPadding: 11 * DefaultStyle.dp
bottomPadding: 11 * DefaultStyle.dp
onClicked: {
if (givenNameEdit.text.length === 0) {
givenName.errorMessage = qsTr("Veuillez saisir un prénom")
return
}
if (addressesList.count === 0) {
addressesErrorText.text = qsTr("Veuillez saisir une adresse ou un numéro de téléphone")
if (givenNameEdit.text.length === 0 || addressesList.count === 0) {
if (givenNameEdit.text.length === 0) givenName.errorMessage = qsTr("Veuillez saisir un prénom")
if (addressesList.count === 0) addressesErrorText.text = qsTr("Veuillez saisir une adresse ou un numéro de téléphone")
return
}
mainItem.contact.core.save()

View file

@ -51,7 +51,7 @@ ListView {
console.log("select", address)
var index = magicSearchProxy.findFriendIndexByAddress(address)
console.log("index in selection", index)
if (index == -1) {
if (index != -1) {
mainItem.currentIndex = index
}
}
@ -102,7 +102,7 @@ ListView {
Connections {
enabled: modelData.core
target: modelData.core
onStarredChanged: mainItem.contactStarredChanged()
function onStarredChanged() { mainItem.contactStarredChanged()}
}
Text {
id: initial
@ -151,7 +151,7 @@ ListView {
Connections {
target: mainItem
// onParticipantsChanged: isSelectedCheck.visible = mainItem.confInfoGui.core.getParticipantIndex(modelData.core.defaultAddress) != -1
onSelectedContactCountChanged: isSelectedCheck.visible = (mainItem.selectedContacts.indexOf(modelData.core.defaultAddress) != -1)
function onSelectedContactCountChanged(){ isSelectedCheck.visible = (mainItem.selectedContacts.indexOf(modelData.core.defaultAddress) != -1)}
}
}
}

View file

@ -42,7 +42,7 @@ Text {
Connections {
target: mainItem
onTextChanged: {
function onTextChanged() {
if (mainItem.text.length > 0) {
mainItem.state = "Visible"
} else {

View file

@ -64,10 +64,10 @@ ColumnLayout {
anchors.top: password.bottom
Connections {
target: LoginPageCpp
onErrorMessageChanged: {
function onErrorMessageChanged() {
errorText.text = LoginPageCpp.errorMessage
}
onRegistrationStateChanged: {
function onRegistrationStateChanged() {
if (LoginPageCpp.registrationState === LinphoneEnums.RegistrationState.Ok) {
mainItem.connectionSucceed()
}
@ -107,13 +107,13 @@ ColumnLayout {
}
Connections {
target: LoginPageCpp
onRegistrationStateChanged: {
function onRegistrationStateChanged() {
if (LoginPageCpp.registrationState != LinphoneEnums.RegistrationState.Progress) {
connectionButton.enabled = true
connectionButtonContent.currentIndex = 0
}
}
onErrorMessageChanged: {
function onErrorMessageChanged() {
connectionButton.enabled = true
connectionButtonContent.currentIndex = 0
}

View file

@ -17,7 +17,7 @@ ColumnLayout {
Connections {
target: mainItem.conferenceInfoGui.core
onSchedulerStateChanged: {
function onSchedulerStateChanged() {
if (mainItem.conferenceInfoGui.core.schedulerState == LinphoneEnums.ConferenceSchedulerState.Ready) {
mainItem.saveSucceed(isCreation)
}

View file

@ -27,12 +27,12 @@ Rectangle {
Connections {
enabled: numericPad != undefined
target: numericPad ? numericPad : null
onAboutToHide: { mainItem.numericPadButton.checked = false }
onAboutToShow: { mainItem.numericPadButton.checked = true }
onButtonPressed: (text) => {
function onAboutToHide() { mainItem.numericPadButton.checked = false }
function onAboutToShow() { mainItem.numericPadButton.checked = true }
function onButtonPressed(text) {
textField.text += text
}
onWipe: textField.text = textField.text.slice(0, -1)
function onWipe(){ textField.text = textField.text.slice(0, -1)}
}

View file

@ -27,14 +27,14 @@ Dialog {
enabled: call != undefined && call != null
target: call && call.core
onStatusChanged: if (status === CallModel.CallStatusEnded) close()
onSecurityUpdated: {
function onSecurityUpdated() {
if (mainItem.isTokenVerified) {
close()
// mainItem.securityError = true
// } else close()
}
}
onTokenVerified: {
function onTokenVerified() {
if (!mainItem.isTokenVerified) {
mainItem.securityError = true
} else close()

View file

@ -15,7 +15,7 @@ LoginLayout {
Connections {
target: RegisterPageCpp
onErrorInField: (field, errorMessage) => {
function onErrorInField(field, errorMessage) {
if (field == "username") usernameItem.errorMessage = errorMessage
else if (field == "password") pwdItem.errorMessage = errorMessage
else if (field == "phone") phoneNumberInput.errorMessage = errorMessage

View file

@ -190,7 +190,7 @@ LoginLayout {
id: errorText
Connections {
target: LoginPageCpp
onRegistrationStateChanged: {
function onRegistrationStateChanged() {
if (LoginPageCpp.registrationState === LinphoneEnums.RegistrationState.Failed) {
errorText.text = qsTr("Connection has failed. Please verify your credentials")
} else if (LoginPageCpp.registrationState === LinphoneEnums.RegistrationState.Ok) {

View file

@ -29,7 +29,7 @@ AbstractMainPage {
Connections {
enabled: confInfoGui
target: confInfoGui ? confInfoGui.core : null
onConferenceSchedulerStateChanged: {
function onConferenceSchedulerStateChanged() {
if (confInfoGui.core.schedulerState === LinphoneEnums.ConferenceSchedulerState.Ready) {
listStackView.pop()
}
@ -215,7 +215,7 @@ AbstractMainPage {
Connections {
target: deleteHistoryPopup
onAccepted: {
function onAccepted() {
historyListView.model.removeAllEntries()
}
}
@ -358,7 +358,7 @@ AbstractMainPage {
Connections {
target: mainItem
onListViewUpdated: {
function onListViewUpdated() {
historyListView.model.updateView()
}
}
@ -426,7 +426,7 @@ AbstractMainPage {
}
Connections {
target: mainItem
onCreateCallFromSearchBarRequested: UtilsCpp.createCall(callContactsList.searchBar.text)
function onCreateCallFromSearchBarRequested(){ UtilsCpp.createCall(callContactsList.searchBar.text)}
}
}
}
@ -497,7 +497,7 @@ AbstractMainPage {
nameGroupCall: true
Connections {
target: mainItem
onStartGroupCallRequested: {
function onStartGroupCallRequested() {
if (groupName.length === 0) {
UtilsCpp.showInformationPopup(qsTr("Erreur"), qsTr("Un nom doit être donné à l'appel de groupe"), false)
} else if(!mainItem.isRegistered) {
@ -591,7 +591,7 @@ AbstractMainPage {
}
Connections {
target: deleteForUserPopup
onAccepted: {
function onAccepted() {
detailListView.model.removeEntriesWithFilter()
mainItem.listViewUpdated()
}

View file

@ -320,7 +320,7 @@ AbstractMainPage {
model: allFriends
Connections {
target: allFriends
onFriendCreated: (index) => {
function onFriendCreated(index) {
contactList.currentIndex = index
}
}

View file

@ -283,7 +283,7 @@ AbstractMainPage {
Layout.rightMargin: 35 * DefaultStyle.dp
Connections {
target: meetingSetup.conferenceInfoGui ? meetingSetup.conferenceInfoGui.core : null
onConferenceSchedulerStateChanged: {
function onConferenceSchedulerStateChanged() {
var mainWin = UtilsCpp.getMainWindow()
if (meetingSetup.conferenceInfoGui.core.schedulerState == LinphoneEnums.ConferenceSchedulerState.AllocationPending
|| meetingSetup.conferenceInfoGui.core.schedulerState == LinphoneEnums.ConferenceSchedulerState.Updating) {
@ -307,7 +307,7 @@ AbstractMainPage {
}
Connections {
target: mainItem
onAddParticipantsValidated: (selectedParticipants) => {
function onAddParticipantsValidated(selectedParticipants) {
meetingSetup.conferenceInfoGui.core.resetParticipants(selectedParticipants)
leftPanelStackView.pop()
}
@ -384,14 +384,14 @@ AbstractMainPage {
}
Connections {
target: mainItem
onAddParticipantsValidated: (selectedParticipants) => {
function onAddParticipantsValidated(selectedParticipants) {
conferenceEdit.conferenceInfoGui.core.resetParticipants(selectedParticipants)
overridenRightPanelStackView.pop()
}
}
Connections {
target: conferenceEdit.conferenceInfoGui ? conferenceEdit.conferenceInfoGui.core : null
onConferenceSchedulerStateChanged: {
function onConferenceSchedulerStateChanged() {
var mainWin = UtilsCpp.getMainWindow()
if (conferenceEdit.conferenceInfoGui.core.schedulerState == LinphoneEnums.ConferenceSchedulerState.Error) {
UtilsCpp.showInformationPopup(qsTr("Erreur"), qsTr("L'édition de la conférence a échoué"), false)
@ -535,10 +535,10 @@ AbstractMainPage {
}
Connections {
target: cancelAndDeleteConfDialog
onCancelRequested: {
function onCancelRequested() {
mainItem.selectedConference.core.lCancelConferenceInfo()
}
onAccepted: {
function onAccepted() {
mainItem.selectedConference.core.lDeleteConferenceInfo()
}
}

View file

@ -27,7 +27,7 @@ Window {
Component.onDestruction: gc()
Connections{
target: call && call.core || null
onLastErrorMessageChanged: if(mainItem.call) errorMessageText.text=mainItem.call.core.lastErrorMessage
function onLastErrorMessageChanged() { if(mainItem.call) errorMessageText.text=mainItem.call.core.lastErrorMessage}
}
RowLayout{
anchors.fill: parent