mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-26 00:08:13 +00:00
Update pause button to reflect conference state
This commit is contained in:
parent
e7eb5d6a4f
commit
8a888707d5
5 changed files with 40 additions and 4 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue