Added leaver/enter conference button in conference view

This commit is contained in:
Sylvain Berfini 2017-06-07 15:29:56 +02:00
parent 2b093cb604
commit 6184e43531
3 changed files with 33 additions and 0 deletions

View file

@ -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<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();
}

View file

@ -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;

View file

@ -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'