diff --git a/Linphone/core/conference/ConferenceInfoList.cpp b/Linphone/core/conference/ConferenceInfoList.cpp index b41c15bf9..8daf632bb 100644 --- a/Linphone/core/conference/ConferenceInfoList.cpp +++ b/Linphone/core/conference/ConferenceInfoList.cpp @@ -23,6 +23,7 @@ #include "ConferenceInfoGui.hpp" #include "core/App.hpp" #include "model/object/VariantObject.hpp" +#include "model/setting/SettingsModel.hpp" #include "model/tool/ToolModel.hpp" #include "tool/Utils.hpp" #include @@ -163,6 +164,11 @@ void ConferenceInfoList::setSelf(QSharedPointer me) { } }); }); + + mSettingsModelConnection = + SafeConnection::create(me, SettingsModel::getInstance()); + mSettingsModelConnection->makeConnectToModel(&SettingsModel::showPastMeetingsChanged, &ConferenceInfoList::lUpdate); + emit lUpdate(); } diff --git a/Linphone/core/conference/ConferenceInfoList.hpp b/Linphone/core/conference/ConferenceInfoList.hpp index ca0b2796c..1453ff155 100644 --- a/Linphone/core/conference/ConferenceInfoList.hpp +++ b/Linphone/core/conference/ConferenceInfoList.hpp @@ -27,6 +27,7 @@ #include class CoreModel; +class SettingsModel; class ConferenceInfoCore; class AccountCore; @@ -74,6 +75,7 @@ signals: private: QSharedPointer> mCoreModelConnection; + QSharedPointer> mSettingsModelConnection; QSharedPointer mCurrentAccountCore; bool mHaveCurrentDate = false; bool mAccountConnected = false; diff --git a/Linphone/core/setting/SettingsCore.cpp b/Linphone/core/setting/SettingsCore.cpp index 22745a990..ebf888920 100644 --- a/Linphone/core/setting/SettingsCore.cpp +++ b/Linphone/core/setting/SettingsCore.cpp @@ -1230,6 +1230,14 @@ bool SettingsCore::getShowPastMeetings() const { return mShowPastMeetings; } +void SettingsCore::setShowPastMeetings(bool show) { + if (mShowPastMeetings != show) { + mShowPastMeetings = show; + emit showPastMeetingsChanged(); + setIsSaved(false); + } +} + bool SettingsCore::getExitOnClose() const { return mExitOnClose; } diff --git a/Linphone/core/setting/SettingsCore.hpp b/Linphone/core/setting/SettingsCore.hpp index e1c58b2b6..57f6ae7bc 100644 --- a/Linphone/core/setting/SettingsCore.hpp +++ b/Linphone/core/setting/SettingsCore.hpp @@ -40,6 +40,7 @@ public: Q_PROPERTY(bool videoEnabled READ getVideoEnabled WRITE setVideoEnabled NOTIFY videoEnabledChanged) Q_PROPERTY(bool echoCancellationEnabled READ getEchoCancellationEnabled WRITE setEchoCancellationEnabled NOTIFY echoCancellationEnabledChanged) + Q_PROPERTY(bool showPastMeetings READ getShowPastMeetings WRITE setShowPastMeetings NOTIFY showPastMeetingsChanged) Q_PROPERTY(bool autoDownloadReceivedFiles READ getAutoDownloadReceivedFiles WRITE setAutoDownloadReceivedFiles NOTIFY autoDownloadReceivedFilesChanged) Q_PROPERTY(QString downloadFolder READ getDownloadFolder WRITE setDownloadFolder NOTIFY downloadFolderChanged) @@ -168,6 +169,9 @@ public: } void setAutomaticallyRecordCallsEnabled(bool enabled); + bool getShowPastMeetings() const; + void setShowPastMeetings(bool show); + float getPlaybackGain() const; void setPlaybackGain(float gain); void setPlaybackGainFromModel(float gain); @@ -279,7 +283,6 @@ public: DECLARE_CORE_GETSET_MEMBER(bool, disableChatFeature, DisableChatFeature) DECLARE_CORE_GETSET_MEMBER(bool, disableMeetingsFeature, DisableMeetingsFeature) - DECLARE_CORE_GETSET(bool, showPastMeetings, ShowPastMeetings) DECLARE_CORE_GETSET_MEMBER(bool, disableBroadcastFeature, DisableBroadcastFeature) DECLARE_CORE_GETSET_MEMBER(bool, hideSettings, HideSettings) DECLARE_CORE_GETSET_MEMBER(bool, hideAccountSettings, HideAccountSettings) @@ -323,6 +326,8 @@ signals: void downloadFolderChanged(); void displayNotificationContentChanged(); + void showPastMeetingsChanged(); + void automaticallyRecordCallsEnabledChanged(); void captureGraphRunningChanged(bool running); @@ -423,6 +428,8 @@ private: bool mDisplayNotificationContent; bool mAutomaticallyRecordCallsEnabled; + bool mShowPastMeetings; + // Audio QVariantList mCaptureDevices; QVariantList mPlaybackDevices; diff --git a/Linphone/view/Page/Layout/Settings/MeetingsSettingsLayout.qml b/Linphone/view/Page/Layout/Settings/MeetingsSettingsLayout.qml index ab6d50df5..83d07327e 100644 --- a/Linphone/view/Page/Layout/Settings/MeetingsSettingsLayout.qml +++ b/Linphone/view/Page/Layout/Settings/MeetingsSettingsLayout.qml @@ -28,31 +28,42 @@ AbstractSettingsLayout { Component { id: confDisplayParametersComponent ColumnLayout { - spacing: Utils.getSizeWithScreenRatio(5) - Text { - //: "Mode d’affichage par défaut" - text: qsTr("settings_meetings_default_layout_title") - font { - pixelSize: Typography.p2l.pixelSize - weight: Typography.p2l.weight + spacing: Utils.getSizeWithScreenRatio(20) + ColumnLayout { + spacing: Utils.getSizeWithScreenRatio(5) + Text { + //: "Mode d’affichage par défaut" + text: qsTr("settings_meetings_default_layout_title") + font { + pixelSize: Typography.p2l.pixelSize + weight: Typography.p2l.weight + } + } + Text { + //: "Le mode d’affichage des participants en réunions" + text: qsTr("settings_meetings_default_layout_subtitle") + font { + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight + } + } + ComboSetting { + Layout.fillWidth: true + Layout.topMargin: Utils.getSizeWithScreenRatio(12) + Layout.preferredWidth: parent.width + entries: SettingsCpp.conferenceLayouts + propertyName: "conferenceLayout" + propertyOwner: SettingsCpp + textRole: 'display_name' } } - Text { - //: "Le mode d’affichage des participants en réunions" - text: qsTr("settings_meetings_default_layout_subtitle") - font { - pixelSize: Typography.p1.pixelSize - weight: Typography.p1.weight - } - } - ComboSetting { - Layout.fillWidth: true - Layout.topMargin: Utils.getSizeWithScreenRatio(12) - Layout.preferredWidth: parent.width - entries: SettingsCpp.conferenceLayouts - propertyName: "conferenceLayout" + SwitchSetting { + //: Show past meetings + titleText: qsTr("settings_meetings_show_past_meetings_title") + //: Display past meetings in the meeting list + subTitleText: qsTr("settings_meetings_show_past_meetings_subtitle") + propertyName: "showPastMeetings" propertyOwner: SettingsCpp - textRole: 'display_name' } } }