diff --git a/Linphone/core/chat/ChatCore.cpp b/Linphone/core/chat/ChatCore.cpp index 3af0e5d2..5871f683 100644 --- a/Linphone/core/chat/ChatCore.cpp +++ b/Linphone/core/chat/ChatCore.cpp @@ -546,6 +546,14 @@ QVariantList ChatCore::getParticipantsGui() const { return result; } +QStringList ChatCore::getParticipantsAddresses() const { + QStringList result; + for (auto participantCore : mParticipants) { + result.append(participantCore->getSipAddress()); + } + return result; +} + QList> ChatCore::buildParticipants(const std::shared_ptr &chatRoom) const { mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); diff --git a/Linphone/core/chat/ChatCore.hpp b/Linphone/core/chat/ChatCore.hpp index e7573925..323fd05b 100644 --- a/Linphone/core/chat/ChatCore.hpp +++ b/Linphone/core/chat/ChatCore.hpp @@ -128,6 +128,8 @@ public: QList> buildParticipants(const std::shared_ptr &chatRoom) const; QVariantList getParticipantsGui() const; + Q_INVOKABLE QStringList getParticipantsAddresses() const; + signals: // used to close all the notifications when one is clicked diff --git a/Linphone/view/Page/Form/Meeting/MeetingForm.qml b/Linphone/view/Page/Form/Meeting/MeetingForm.qml index bc6c37eb..aa6de003 100644 --- a/Linphone/view/Page/Form/Meeting/MeetingForm.qml +++ b/Linphone/view/Page/Form/Meeting/MeetingForm.qml @@ -69,7 +69,7 @@ FocusScope { Layout.fillWidth: true //: "Ajouter un titre" property string defaultText: qsTr("meeting_schedule_subject_hint") - text: defaultText + text: conferenceInfoGui.core.subject ? conferenceInfoGui.core.subject : defaultText color: DefaultStyle.main2_600 font { pixelSize: Math.round(20 * DefaultStyle.dp) diff --git a/Linphone/view/Page/Layout/Chat/GroupConversationInfos.qml b/Linphone/view/Page/Layout/Chat/GroupConversationInfos.qml index 2743c29a..c721dc56 100644 --- a/Linphone/view/Page/Layout/Chat/GroupConversationInfos.qml +++ b/Linphone/view/Page/Layout/Chat/GroupConversationInfos.qml @@ -120,6 +120,7 @@ ColumnLayout { } } LabelButton { + visible: !SettingsCpp.disableMeetingsFeature width: Math.round(56 * DefaultStyle.dp) height: Math.round(56 * DefaultStyle.dp) button.icon.width: Math.round(24 * DefaultStyle.dp) @@ -130,6 +131,7 @@ ColumnLayout { button.onClicked: parentView.groupCall() } LabelButton { + visible: !SettingsCpp.disableMeetingsFeature width: Math.round(56 * DefaultStyle.dp) height: Math.round(56 * DefaultStyle.dp) button.icon.width: Math.round(24 * DefaultStyle.dp) @@ -138,7 +140,7 @@ ColumnLayout { //: "Réunion" label: qsTr("group_infos_meeting") button.onClicked: { - //TODO + UtilsCpp.getMainWindow().scheduleMeeting(mainItem.chatCore.title, mainItem.chatCore.getParticipantsAddresses()) } } } diff --git a/Linphone/view/Page/Layout/Main/MainLayout.qml b/Linphone/view/Page/Layout/Main/MainLayout.qml index c7547415..c262a10d 100644 --- a/Linphone/view/Page/Layout/Main/MainLayout.qml +++ b/Linphone/view/Page/Layout/Main/MainLayout.qml @@ -29,6 +29,7 @@ Item { signal displayChatRequested(string contactAddress) signal openChatRequested(ChatGui chat) signal createContactRequested(string name, string address) + signal scheduleMeetingRequested(string subject, list addresses) signal accountRemoved function goToNewCall() { @@ -51,11 +52,14 @@ Item { tabbar.currentIndex = 2 mainItem.openChatRequested(chat) } - function createContact(name, address) { tabbar.currentIndex = 1 mainItem.createContactRequested(name, address) } + function scheduleMeeting(subject, addresses) { + tabbar.currentIndex = 3 + mainItem.scheduleMeetingRequested(subject, addresses) + } function openContextualMenuComponent(component) { if (mainItem.contextualMenuOpenedComponent @@ -647,7 +651,15 @@ Item { } } } - MeetingPage {} + MeetingPage { + id: meetingPage + Connections { + target: mainItem + function onScheduleMeetingRequested(subject, addresses) { + meetingPage.createPreFilledMeeting(subject, addresses) + } + } + } } } Component { diff --git a/Linphone/view/Page/Main/Meeting/MeetingPage.qml b/Linphone/view/Page/Main/Meeting/MeetingPage.qml index 506946af..1602ed7f 100644 --- a/Linphone/view/Page/Main/Meeting/MeetingPage.qml +++ b/Linphone/view/Page/Main/Meeting/MeetingPage.qml @@ -23,6 +23,17 @@ AbstractMainPage { showDefaultItem: leftPanelStackView.currentItem?.objectName === "listLayout" && meetingListCount === 0 + function createPreFilledMeeting(subject, addresses) { + mainItem.selectedConference = Qt.createQmlObject('import Linphone + ConferenceInfoGui{ + }', mainItem) + mainItem.selectedConference.core.resetParticipants(addresses) + mainItem.selectedConference.core.subject = subject + var item = leftPanelStackView.push(createConf, {"conferenceInfoGui": mainItem.selectedConference, "isCreation": true}) + item.forceActiveFocus() + } + + function editConference(confInfoGui = null) { var isCreation = !confInfoGui var item diff --git a/Linphone/view/Page/Window/Main/MainWindow.qml b/Linphone/view/Page/Window/Main/MainWindow.qml index 5e90c5dd..4fb57e01 100644 --- a/Linphone/view/Page/Window/Main/MainWindow.qml +++ b/Linphone/view/Page/Window/Main/MainWindow.qml @@ -91,6 +91,11 @@ AbstractWindow { mainWindowStackView.replace(loginPage) } + function scheduleMeeting(subject, addresses) { + openMainPage() + mainWindowStackView.currentItem.scheduleMeeting(subject, addresses) + } + property bool authenticationPopupOpened: false Component { id: authenticationPopupComp