Commit 6184e435 authored by Sylvain Berfini's avatar Sylvain Berfini

Added leaver/enter conference button in conference view

parent 2b093cb6
...@@ -40,6 +40,7 @@ ConferenceModel::ConferenceModel (QObject *parent) : QSortFilterProxyModel(paren ...@@ -40,6 +40,7 @@ ConferenceModel::ConferenceModel (QObject *parent) : QSortFilterProxyModel(paren
}); });
setSourceModel(CoreManager::getInstance()->getCallsListModel()); setSourceModel(CoreManager::getInstance()->getCallsListModel());
emit conferenceChanged(true);
} }
bool ConferenceModel::filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const { bool ConferenceModel::filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const {
...@@ -114,3 +115,20 @@ void ConferenceModel::setMicroMuted (bool status) { ...@@ -114,3 +115,20 @@ void ConferenceModel::setMicroMuted (bool status) {
bool ConferenceModel::getRecording () const { bool ConferenceModel::getRecording () const {
return mRecording; return mRecording;
} }
void ConferenceModel::leave() {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
core->leaveConference();
emit conferenceChanged(false);
}
void ConferenceModel::join() {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
core->enterConference();
emit conferenceChanged(true);
}
bool ConferenceModel::isInConference () const {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
return core->isInConference();
}
\ No newline at end of file
...@@ -36,6 +36,7 @@ class ConferenceModel : public QSortFilterProxyModel { ...@@ -36,6 +36,7 @@ class ConferenceModel : public QSortFilterProxyModel {
Q_PROPERTY(bool microMuted READ getMicroMuted WRITE setMicroMuted NOTIFY microMutedChanged); Q_PROPERTY(bool microMuted READ getMicroMuted WRITE setMicroMuted NOTIFY microMutedChanged);
Q_PROPERTY(bool recording READ getRecording NOTIFY recordingChanged); Q_PROPERTY(bool recording READ getRecording NOTIFY recordingChanged);
Q_PROPERTY(bool isInConf READ isInConference NOTIFY conferenceChanged);
public: public:
ConferenceModel (QObject *parent = Q_NULLPTR); ConferenceModel (QObject *parent = Q_NULLPTR);
...@@ -49,11 +50,15 @@ protected: ...@@ -49,11 +50,15 @@ protected:
Q_INVOKABLE void startRecording (); Q_INVOKABLE void startRecording ();
Q_INVOKABLE void stopRecording (); Q_INVOKABLE void stopRecording ();
Q_INVOKABLE void join ();
Q_INVOKABLE void leave ();
signals: signals:
void countChanged (int count); void countChanged (int count);
void microMutedChanged (bool status); void microMutedChanged (bool status);
void recordingChanged (bool status); void recordingChanged (bool status);
void conferenceChanged(bool status);
private: private:
int getCount () const { int getCount () const {
...@@ -63,6 +68,8 @@ private: ...@@ -63,6 +68,8 @@ private:
bool getMicroMuted () const; bool getMicroMuted () const;
void setMicroMuted (bool status); void setMicroMuted (bool status);
bool isInConference () const;
bool getRecording () const; bool getRecording () const;
bool mRecording = false; bool mRecording = false;
......
...@@ -207,6 +207,14 @@ Rectangle { ...@@ -207,6 +207,14 @@ Rectangle {
} }
iconSize: CallStyle.actionArea.iconSize iconSize: CallStyle.actionArea.iconSize
ActionSwitch {
icon: 'pause'
onClicked: {
conference.conferenceModel.isInConf ? conference.conferenceModel.leave() : conference.conferenceModel.join()
}
}
ActionButton { ActionButton {
icon: 'hangup' icon: 'hangup'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment