Commit 8a888707 authored by Sylvain Berfini's avatar Sylvain Berfini

Update pause button to reflect conference state

parent e7eb5d6a
......@@ -443,6 +443,14 @@ Server url not configured.</translation>
<source>conferenceTitle</source>
<translation>CONFERENCE</translation>
</message>
<message>
<source>leaveConf</source>
<translation>Temporarily leave the conference</translation>
</message>
<message>
<source>joinBackConf</source>
<translation>Join back the conference</translation>
</message>
</context>
<context>
<name>ConferenceControls</name>
......
......@@ -443,6 +443,14 @@ Url du serveur non configurée.</translation>
<source>conferenceTitle</source>
<translation>CONFÉRENCE</translation>
</message>
<message>
<source>leaveConf</source>
<translation>Quitter temporairement la conférence</translation>
</message>
<message>
<source>joinBackConf</source>
<translation>Rejoindre la conférence</translation>
</message>
</context>
<context>
<name>ConferenceControls</name>
......
......@@ -40,7 +40,12 @@ ConferenceModel::ConferenceModel (QObject *parent) : QSortFilterProxyModel(paren
});
setSourceModel(CoreManager::getInstance()->getCallsListModel());
emit conferenceChanged(true);
emit conferenceChanged();
QObject::connect(
CoreManager::getInstance()->getHandlers().get(), &CoreHandlers::callStateChanged,
this, &ConferenceModel::handleCallStateChanged
);
}
bool ConferenceModel::filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const {
......@@ -143,16 +148,23 @@ float ConferenceModel::getMicroVu () const {
void ConferenceModel::leave() {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
core->leaveConference();
emit conferenceChanged(false);
emit conferenceChanged();
}
void ConferenceModel::join() {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
core->enterConference();
emit conferenceChanged(true);
emit conferenceChanged();
}
bool ConferenceModel::isInConference () const {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
qInfo() << QStringLiteral("Is in conf:") << core->isInConference();
return core->isInConference();
}
// -----------------------------------------------------------------------------
void ConferenceModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call, linphone::CallState state) {
emit conferenceChanged();
}
\ No newline at end of file
......@@ -60,9 +60,11 @@ signals:
void microMutedChanged (bool status);
void recordingChanged (bool status);
void conferenceChanged(bool status);
void conferenceChanged();
private:
void handleCallStateChanged (const std::shared_ptr<linphone::Call> &call, linphone::CallState state);
int getCount () const {
return rowCount();
}
......
......@@ -216,6 +216,7 @@ Rectangle {
ActionSwitch {
id: micro
enabled: !conference.conferenceModel.microMuted
icon: 'micro'
iconSize: CallStyle.actionArea.iconSize
......@@ -235,10 +236,15 @@ Rectangle {
ActionSwitch {
icon: 'pause'
enabled: conference.conferenceModel.isInConf
onClicked: {
conference.conferenceModel.isInConf ? conference.conferenceModel.leave() : conference.conferenceModel.join()
}
TooltipArea {
text: conference.conferenceModel.isInConf ? qsTr('leaveConf') : qsTr('joinBackConf')
}
}
ActionButton {
......
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