From 6742f35e5dcedc9e2e5a4d501157c0e7fb7635e4 Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Thu, 14 Nov 2024 08:47:05 +0100 Subject: [PATCH] Fix callback invocation in H264 codec download context --- Linphone/view/Control/Tool/Helper/utils.js | 10 +++++++--- .../Page/Layout/Settings/AdvancedSettingsLayout.qml | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Linphone/view/Control/Tool/Helper/utils.js b/Linphone/view/Control/Tool/Helper/utils.js index 0ab1c8048..c1d5159e9 100644 --- a/Linphone/view/Control/Tool/Helper/utils.js +++ b/Linphone/view/Control/Tool/Helper/utils.js @@ -684,25 +684,29 @@ function computeAvatarSize (container, maxSize, ratio) { // ----------------------------------------------------------------------------- -function openCodecOnlineInstallerDialog (mainWindow, coreObject, cancelCallBack, successCallBack) { +function openCodecOnlineInstallerDialog (mainWindow, coreObject, cancelCallBack, successCallBack, errorCallBack) { mainWindow.showConfirmationLambdaPopup("", qsTr("Installation de codec"), qsTr("Télécharger le codec ") + capitalizeFirstLetter(coreObject.mimeType) + " ("+coreObject.encoderDescription+")"+" ?", function (confirmed) { if (confirmed) { coreObject.success.connect(function() { - if (successCallBack) - successCallBack() mainWindow.closeLoadingPopup() mainWindow.showInformationPopup(qsTr("Succès"), qsTr("Le codec a été téléchargé avec succès."), true) + if (successCallBack) + successCallBack() }) coreObject.extractError.connect(function() { mainWindow.closeLoadingPopup() mainWindow.showInformationPopup(qsTr("Erreur"), qsTr("Le codec n'a pas pu être sauvegardé."), true) + if (errorCallBack) + errorCallBack() }) coreObject.downloadError.connect(function() { mainWindow.closeLoadingPopup() mainWindow.showInformationPopup(qsTr("Erreur"), qsTr("Le codec n'a pas pu être téléchargé."), true) + if (errorCallBack) + errorCallBack() }) mainWindow.showLoadingPopup(qsTr("Téléchargement en cours ...")) coreObject.downloadAndExtract() diff --git a/Linphone/view/Page/Layout/Settings/AdvancedSettingsLayout.qml b/Linphone/view/Page/Layout/Settings/AdvancedSettingsLayout.qml index 2ea89bdf0..f4f67381c 100644 --- a/Linphone/view/Page/Layout/Settings/AdvancedSettingsLayout.qml +++ b/Linphone/view/Page/Layout/Settings/AdvancedSettingsLayout.qml @@ -90,6 +90,7 @@ AbstractSettingsLayout { spacing: 20 * DefaultStyle.dp Repeater { model: PayloadTypeProxy { + id: videoPayloadTypeProxy filterType: PayloadTypeProxy.Video | PayloadTypeProxy.NotDownloadable } SwitchSetting { @@ -118,6 +119,9 @@ AbstractSettingsLayout { function successCallBack() { videoPayloadTypeProxy.reload() downloadableVideoPayloadTypeProxy.reload() + }, + function errorCallBack() { + setChecked(false) }) } }