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