From 311ad15a685af50e85ee39c9d0f71a102aaf4569 Mon Sep 17 00:00:00 2001 From: gaelle Date: Tue, 25 Feb 2025 12:00:08 +0100 Subject: [PATCH] fix #LINQT-1658 hide meeting tab when empty videoconffactoryuri --- Linphone/core/account/AccountCore.cpp | 3 ++ Linphone/model/setting/SettingsModel.cpp | 5 +++ .../view/Control/Container/VerticalTabBar.qml | 39 ++++++++++++------- .../Display/Contact/AllContactListView.qml | 1 - .../AccountSettingsParametersLayout.qml | 3 +- 5 files changed, 34 insertions(+), 17 deletions(-) diff --git a/Linphone/core/account/AccountCore.cpp b/Linphone/core/account/AccountCore.cpp index a4440200..45bb4dc4 100644 --- a/Linphone/core/account/AccountCore.cpp +++ b/Linphone/core/account/AccountCore.cpp @@ -714,6 +714,9 @@ void AccountCore::onAudioVideoConferenceFactoryAddressChanged(QString value) { mAudioVideoConferenceFactoryAddress = value; emit audioVideoConferenceFactoryAddressChanged(); } + if (mIsDefaultAccount) { + SettingsModel::getInstance()->setDisableMeetingsFeature(value.isEmpty()); + } } void AccountCore::onLimeServerUrlChanged(QString value) { diff --git a/Linphone/model/setting/SettingsModel.cpp b/Linphone/model/setting/SettingsModel.cpp index fcdf4631..9da32d22 100644 --- a/Linphone/model/setting/SettingsModel.cpp +++ b/Linphone/model/setting/SettingsModel.cpp @@ -62,6 +62,11 @@ SettingsModel::SettingsModel() { notifyConfigReady(); } }); + QObject::connect(CoreModel::getInstance().get(), &CoreModel::defaultAccountChanged, this, + [this](const std::shared_ptr &core, const std::shared_ptr account) { + mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); + setDisableMeetingsFeature(!account->getParams()->getAudioVideoConferenceFactoryAddress()); + }); // Media cards must not be used twice (capture card + call) else we will get latencies issues and bad echo // calibrations in call. QObject::connect(CoreModel::getInstance().get(), &CoreModel::firstCallStarted, this, diff --git a/Linphone/view/Control/Container/VerticalTabBar.qml b/Linphone/view/Control/Container/VerticalTabBar.qml index 495ff9eb..c6cbb025 100644 --- a/Linphone/view/Control/Container/VerticalTabBar.qml +++ b/Linphone/view/Control/Container/VerticalTabBar.qml @@ -4,6 +4,7 @@ import QtQuick.Controls.Basic as Control import QtQuick.Effects import Linphone +import SettingsCpp Control.TabBar { id: mainItem @@ -24,6 +25,16 @@ Control.TabBar { if (defaultAccount) defaultAccount.core?.lRefreshNotifications() } + Connections { + target: SettingsCpp + function onDisableMeetingsFeatureChanged() { + initButtons() + } + function onDisableChatFeatureChanged() { + initButtons() + } + } + component UnreadNotification: Rectangle { id: unreadNotifications property int unread: 0 @@ -44,21 +55,21 @@ Control.TabBar { } } - contentItem: ListView { - model: mainItem.contentModel - currentIndex: mainItem.currentIndex + contentItem: ListView { + model: mainItem.contentModel + currentIndex: mainItem.currentIndex - spacing: mainItem.spacing - orientation: ListView.Vertical - // boundsBehavior: Flickable.StopAtBounds - flickableDirection: Flickable.AutoFlickIfNeeded - // snapMode: ListView.SnapToItem + spacing: mainItem.spacing + orientation: ListView.Vertical + // boundsBehavior: Flickable.StopAtBounds + flickableDirection: Flickable.AutoFlickIfNeeded + // snapMode: ListView.SnapToItem - // highlightMoveDuration: 0 - // highlightRangeMode: ListView.ApplyRange - // preferredHighlightBegin: 40 - // preferredHighlightEnd: width - 40 - } + // highlightMoveDuration: 0 + // highlightRangeMode: ListView.ApplyRange + // preferredHighlightBegin: 40 + // preferredHighlightEnd: width - 40 + } background: Item { id: background @@ -84,7 +95,7 @@ Control.TabBar { } } - Repeater { + Repeater { id: actionsRepeater Control.TabButton { id: tabButton diff --git a/Linphone/view/Control/Display/Contact/AllContactListView.qml b/Linphone/view/Control/Display/Contact/AllContactListView.qml index efe3c9b9..1c0db015 100644 --- a/Linphone/view/Control/Display/Contact/AllContactListView.qml +++ b/Linphone/view/Control/Display/Contact/AllContactListView.qml @@ -184,7 +184,6 @@ Flickable { } onResultsProcessed: { - console.log("result processed list view") mainItem.loading = false mainItem.contentY = 0 } diff --git a/Linphone/view/Page/Layout/Settings/AccountSettingsParametersLayout.qml b/Linphone/view/Page/Layout/Settings/AccountSettingsParametersLayout.qml index 4631a08c..d12724ef 100644 --- a/Linphone/view/Page/Layout/Settings/AccountSettingsParametersLayout.qml +++ b/Linphone/view/Page/Layout/Settings/AccountSettingsParametersLayout.qml @@ -138,8 +138,7 @@ AbstractSettingsLayout { title: qsTr("URI de l’usine à réunions") propertyName: "audioVideoConferenceFactoryAddress" propertyOwnerGui: account - visible: !SettingsCpp.disableMeetingsFeature - toValidate: true + toValidate: true } DecoratedTextField { Layout.fillWidth: true