mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 03:18:07 +00:00
merge calls
This commit is contained in:
parent
305c969bbb
commit
9e8b1d5dd9
7 changed files with 84 additions and 4 deletions
|
|
@ -78,6 +78,49 @@ void CallList::setSelf(QSharedPointer<CallList> me) {
|
|||
});
|
||||
});
|
||||
});
|
||||
mModelConnection->makeConnectToCore(&CallList::lMergeAll, [this]() {
|
||||
mModelConnection->invokeToModel([this]() {
|
||||
auto core = CoreModel::getInstance()->getCore();
|
||||
auto currentCalls = CoreModel::getInstance()->getCore()->getCalls();
|
||||
std::shared_ptr<linphone::Conference> conference = nullptr;
|
||||
|
||||
// Search a managable conference from calls
|
||||
for (auto call : currentCalls) {
|
||||
auto dbConference = call->getConference();
|
||||
if (dbConference && dbConference->getMe()->isAdmin()) {
|
||||
conference = dbConference;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
auto currentCall = CoreModel::getInstance()->getCore()->getCurrentCall();
|
||||
bool enablingVideo = false;
|
||||
if (currentCall) enablingVideo = currentCall->getCurrentParams()->videoEnabled();
|
||||
if (!conference) {
|
||||
auto parameters = core->createConferenceParams(conference);
|
||||
parameters->enableVideo(enablingVideo);
|
||||
parameters->setSubject("Meeting");
|
||||
conference = core->createConferenceWithParams(parameters);
|
||||
}
|
||||
|
||||
std::list<std::shared_ptr<linphone::Address>> allLinphoneAddresses;
|
||||
std::list<std::shared_ptr<linphone::Address>> newCalls;
|
||||
std::list<std::shared_ptr<linphone::Call>> runningCallsToAdd;
|
||||
|
||||
for (auto call : currentCalls) {
|
||||
if (!call->getConference()) {
|
||||
runningCallsToAdd.push_back(call);
|
||||
}
|
||||
}
|
||||
|
||||
// 1) Add running calls
|
||||
if (runningCallsToAdd.size() > 0) {
|
||||
conference->addParticipants(runningCallsToAdd);
|
||||
}
|
||||
|
||||
// emit lUpdate();
|
||||
});
|
||||
});
|
||||
|
||||
mModelConnection->makeConnectToModel(&CoreModel::firstCallStarted,
|
||||
[this]() { mModelConnection->invokeToCore([this]() { setHaveCall(true); }); });
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ public:
|
|||
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
signals:
|
||||
void lUpdate();
|
||||
void lMergeAll();
|
||||
void haveCallChanged();
|
||||
void currentCallChanged();
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ CallProxy::CallProxy(QObject *parent) : SortFilterProxy(parent) {
|
|||
mList = CallList::create();
|
||||
connect(mList.get(), &CallList::currentCallChanged, this, &CallProxy::resetCurrentCall);
|
||||
connect(mList.get(), &CallList::haveCallChanged, this, &CallProxy::haveCallChanged);
|
||||
connect(this, &CallProxy::lMergeAll, mList.get(), &CallList::lMergeAll);
|
||||
setSourceModel(mList.get());
|
||||
sort(0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ public:
|
|||
bool getHaveCall() const;
|
||||
|
||||
signals:
|
||||
void lMergeAll();
|
||||
void filterTextChanged();
|
||||
void currentCallChanged();
|
||||
void haveCallChanged();
|
||||
|
|
|
|||
|
|
@ -556,8 +556,38 @@ AppWindow {
|
|||
Component {
|
||||
id: callsListPanel
|
||||
ColumnLayout {
|
||||
Control.StackView.onActivated: rightPanel.headerTitleText = qsTr("Liste d'appel")
|
||||
Control.StackView.onActivated: {
|
||||
rightPanel.headerTitleText = qsTr("Liste d'appel")
|
||||
rightPanel.customHeaderButtons = mergeCallPopupButton.createObject(rightPanel)
|
||||
}
|
||||
spacing: 0
|
||||
Component {
|
||||
id: mergeCallPopupButton
|
||||
PopupButton {
|
||||
visible: callsModel.count >= 2
|
||||
id: popupbutton
|
||||
popup.contentItem: Button {
|
||||
background: Item{}
|
||||
contentItem: RowLayout {
|
||||
spacing: 5 * DefaultStyle.dp
|
||||
EffectImage {
|
||||
colorizationColor: DefaultStyle.main2_600
|
||||
imageSource: AppIcons.arrowsMerge
|
||||
Layout.preferredWidth: 32 * DefaultStyle.dp
|
||||
Layout.preferredHeight: 32 * DefaultStyle.dp
|
||||
}
|
||||
Text {
|
||||
text: qsTr("Merger tous les appels")
|
||||
font.pixelSize: 14 * DefaultStyle.dp
|
||||
}
|
||||
}
|
||||
onClicked: {
|
||||
callsModel.lMergeAll()
|
||||
popupbutton.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
RoundedBackgroundControl {
|
||||
Layout.fillWidth: true
|
||||
Layout.maximumHeight: rightPanel.height
|
||||
|
|
@ -598,7 +628,9 @@ AppWindow {
|
|||
Text {
|
||||
id: delegateName
|
||||
property var remoteAddress: UtilsCpp.getDisplayName(modelData.core.peerAddress)
|
||||
text: remoteAddress ? remoteAddress.value : ""
|
||||
text: modelData.core.isConference
|
||||
? modelData.core.conference.core.subject
|
||||
: remoteAddress ? remoteAddress.value : ""
|
||||
Layout.leftMargin: 8 * DefaultStyle.dp
|
||||
Connections {
|
||||
target: modelData.core
|
||||
|
|
@ -758,10 +790,11 @@ AppWindow {
|
|||
}
|
||||
Control.StackView.onActivated: {
|
||||
rightPanel.customHeaderButtons = headerbutton.createObject(rightPanel)
|
||||
rightPanel.headerTitleText = qsTr("Participants (%1)").arg(count)
|
||||
}
|
||||
call: mainWindow.call
|
||||
onAddParticipantRequested: participantsStack.push(addParticipantComp)
|
||||
onCountChanged: if (participantsStack.Control.StackView.status === Control.StackView.Active && participantsStack.currentItem == participantListComp) {
|
||||
onCountChanged: {
|
||||
rightPanel.headerTitleText = qsTr("Participants (%1)").arg(count)
|
||||
}
|
||||
Connections {
|
||||
|
|
|
|||
|
|
@ -488,7 +488,7 @@ AbstractMainPage {
|
|||
onStartGroupCallRequested: {
|
||||
if (groupName.length === 0) {
|
||||
UtilsCpp.showInformationPopup(qsTr("Erreur"), qsTr("Un nom doit être donné à l'appel de groupe"), false)
|
||||
} if(!mainItem.isRegistered) {
|
||||
} else if(!mainItem.isRegistered) {
|
||||
UtilsCpp.showInformationPopup(qsTr("Erreur"), qsTr("Vous n'etes pas connecté"), false)
|
||||
} else {
|
||||
mainItem.confInfoGui = Qt.createQmlObject('import Linphone
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ QtObject {
|
|||
property string rightArrow: "image://internal/caret-right.svg"
|
||||
property string upArrow: "image://internal/caret-up.svg"
|
||||
property string reloadArrow: "image://internal/arrow-clockwise.svg"
|
||||
property string arrowsMerge: "image://internal/arrows-merge.svg"
|
||||
property string info: "image://internal/info.svg"
|
||||
property string loginImage: "image://internal/login_image.svg"
|
||||
property string belledonne: "image://internal/belledonne.svg"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue