From 6184e4353187d2ef63b8ddbfa71a05f63916a59b Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 7 Jun 2017 15:29:56 +0200 Subject: [PATCH] Added leaver/enter conference button in conference view --- .../components/conference/ConferenceModel.cpp | 18 ++++++++++++++++++ .../components/conference/ConferenceModel.hpp | 7 +++++++ .../ui/views/App/Calls/Conference.qml | 8 ++++++++ 3 files changed, 33 insertions(+) diff --git a/linphone-desktop/src/components/conference/ConferenceModel.cpp b/linphone-desktop/src/components/conference/ConferenceModel.cpp index 953412257..5d7dc64aa 100644 --- a/linphone-desktop/src/components/conference/ConferenceModel.cpp +++ b/linphone-desktop/src/components/conference/ConferenceModel.cpp @@ -40,6 +40,7 @@ ConferenceModel::ConferenceModel (QObject *parent) : QSortFilterProxyModel(paren }); setSourceModel(CoreManager::getInstance()->getCallsListModel()); + emit conferenceChanged(true); } bool ConferenceModel::filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const { @@ -114,3 +115,20 @@ void ConferenceModel::setMicroMuted (bool status) { bool ConferenceModel::getRecording () const { return mRecording; } + +void ConferenceModel::leave() { + shared_ptr core = CoreManager::getInstance()->getCore(); + core->leaveConference(); + emit conferenceChanged(false); +} + +void ConferenceModel::join() { + shared_ptr core = CoreManager::getInstance()->getCore(); + core->enterConference(); + emit conferenceChanged(true); +} + +bool ConferenceModel::isInConference () const { + shared_ptr core = CoreManager::getInstance()->getCore(); + return core->isInConference(); +} \ No newline at end of file diff --git a/linphone-desktop/src/components/conference/ConferenceModel.hpp b/linphone-desktop/src/components/conference/ConferenceModel.hpp index 288c37979..6d0bb5ca6 100644 --- a/linphone-desktop/src/components/conference/ConferenceModel.hpp +++ b/linphone-desktop/src/components/conference/ConferenceModel.hpp @@ -36,6 +36,7 @@ class ConferenceModel : public QSortFilterProxyModel { Q_PROPERTY(bool microMuted READ getMicroMuted WRITE setMicroMuted NOTIFY microMutedChanged); Q_PROPERTY(bool recording READ getRecording NOTIFY recordingChanged); + Q_PROPERTY(bool isInConf READ isInConference NOTIFY conferenceChanged); public: ConferenceModel (QObject *parent = Q_NULLPTR); @@ -48,12 +49,16 @@ protected: Q_INVOKABLE void startRecording (); Q_INVOKABLE void stopRecording (); + + Q_INVOKABLE void join (); + Q_INVOKABLE void leave (); signals: void countChanged (int count); void microMutedChanged (bool status); void recordingChanged (bool status); + void conferenceChanged(bool status); private: int getCount () const { @@ -63,6 +68,8 @@ private: bool getMicroMuted () const; void setMicroMuted (bool status); + bool isInConference () const; + bool getRecording () const; bool mRecording = false; diff --git a/linphone-desktop/ui/views/App/Calls/Conference.qml b/linphone-desktop/ui/views/App/Calls/Conference.qml index 133e2d140..7ca0b5e94 100644 --- a/linphone-desktop/ui/views/App/Calls/Conference.qml +++ b/linphone-desktop/ui/views/App/Calls/Conference.qml @@ -207,6 +207,14 @@ Rectangle { } iconSize: CallStyle.actionArea.iconSize + ActionSwitch { + icon: 'pause' + + onClicked: { + conference.conferenceModel.isInConf ? conference.conferenceModel.leave() : conference.conferenceModel.join() + } + } + ActionButton { icon: 'hangup'