Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
06ff2410
Commit
06ff2410
authored
May 23, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/views/App/Calls/ConferenceManager): in progress
parent
6dc58b7b
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
148 additions
and
10 deletions
+148
-10
CMakeLists.txt
linphone-desktop/CMakeLists.txt
+2
-0
App.cpp
linphone-desktop/src/app/App.cpp
+1
-0
CallModel.cpp
linphone-desktop/src/components/call/CallModel.cpp
+3
-1
CallModel.hpp
linphone-desktop/src/components/call/CallModel.hpp
+2
-1
ConferenceAddModel.cpp
...-desktop/src/components/conference/ConferenceAddModel.cpp
+35
-5
ConferenceAddModel.hpp
...-desktop/src/components/conference/ConferenceAddModel.hpp
+6
-1
ConferenceHelperModel.hpp
...sktop/src/components/conference/ConferenceHelperModel.hpp
+3
-0
ConferenceModel.cpp
...one-desktop/src/components/conference/ConferenceModel.cpp
+49
-0
ConferenceModel.hpp
...one-desktop/src/components/conference/ConferenceModel.hpp
+44
-0
Calls.qml
linphone-desktop/ui/modules/Linphone/Calls/Calls.qml
+1
-1
CallsWindow.qml
linphone-desktop/ui/views/App/Calls/CallsWindow.qml
+2
-1
No files found.
linphone-desktop/CMakeLists.txt
View file @
06ff2410
...
...
@@ -109,6 +109,7 @@ set(SOURCES
src/components/codecs/VideoCodecsModel.cpp
src/components/conference/ConferenceAddModel.cpp
src/components/conference/ConferenceHelperModel.cpp
src/components/conference/ConferenceModel.cpp
src/components/contact/ContactModel.cpp
src/components/contact/VcardModel.cpp
src/components/contacts/ContactsListModel.cpp
...
...
@@ -153,6 +154,7 @@ set(HEADERS
src/components/Components.hpp
src/components/conference/ConferenceAddModel.hpp
src/components/conference/ConferenceHelperModel.hpp
src/components/conference/ConferenceModel.hpp
src/components/contact/ContactModel.hpp
src/components/contact/VcardModel.hpp
src/components/contacts/ContactsListModel.hpp
...
...
linphone-desktop/src/app/App.cpp
View file @
06ff2410
...
...
@@ -349,6 +349,7 @@ void App::registerTypes () {
registerType
<
ChatModel
>
(
"ChatModel"
);
registerType
<
ChatProxyModel
>
(
"ChatProxyModel"
);
registerType
<
ConferenceHelperModel
>
(
"ConferenceHelperModel"
);
registerType
<
ConferenceModel
>
(
"ConferenceModel"
);
registerType
<
ContactsListProxyModel
>
(
"ContactsListProxyModel"
);
registerType
<
SipAddressesProxyModel
>
(
"SipAddressesProxyModel"
);
registerType
<
SoundPlayer
>
(
"SoundPlayer"
);
...
...
linphone-desktop/src/components/call/CallModel.cpp
View file @
06ff2410
...
...
@@ -41,6 +41,8 @@ CallModel::CallModel (shared_ptr<linphone::Call> call) {
mCall
=
call
;
mCall
->
setData
(
"call-model"
,
*
this
);
updateIsInConference
();
// Deal with auto-answer.
{
SettingsModel
*
settings
=
CoreManager
::
getInstance
()
->
getSettingsModel
();
...
...
@@ -254,7 +256,7 @@ void CallModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call,
// -----------------------------------------------------------------------------
void
CallModel
::
updateIsInConference
()
{
if
(
mIsInConference
!=
!!
mCall
->
getConferenc
e
())
{
if
(
mIsInConference
!=
mCall
->
getParams
()
->
getLocalConferenceMod
e
())
{
mIsInConference
=
!
mIsInConference
;
emit
isInConferenceChanged
(
mIsInConference
);
}
...
...
linphone-desktop/src/components/call/CallModel.hpp
View file @
06ff2410
...
...
@@ -25,7 +25,7 @@
#include <linphone++/linphone.hh>
#include <QObject>
#include <QDebug>
// =============================================================================
class
CallModel
:
public
QObject
{
...
...
@@ -115,6 +115,7 @@ private:
}
bool
isInConference
()
const
{
qDebug
()
<<
"toto"
<<
mIsInConference
;
return
mIsInConference
;
}
...
...
linphone-desktop/src/components/conference/ConferenceAddModel.cpp
View file @
06ff2410
...
...
@@ -40,8 +40,10 @@ ConferenceHelperModel::ConferenceAddModel::ConferenceAddModel (QObject *parent)
this
,
&
ConferenceAddModel
::
handleDataChanged
);
for
(
auto
&
participant
:
coreManager
->
getCore
()
->
getConference
()
->
getParticipants
())
addToConference
(
participant
);
for
(
const
auto
&
call
:
coreManager
->
getCore
()
->
getCalls
())
{
if
(
call
->
getParams
()
->
getLocalConferenceMode
())
addToConference
(
call
->
getRemoteAddress
());
}
}
int
ConferenceHelperModel
::
ConferenceAddModel
::
rowCount
(
const
QModelIndex
&
)
const
{
...
...
@@ -68,6 +70,22 @@ QVariant ConferenceHelperModel::ConferenceAddModel::data (const QModelIndex &ind
// -----------------------------------------------------------------------------
bool
ConferenceHelperModel
::
ConferenceAddModel
::
addToConference
(
const
shared_ptr
<
const
linphone
::
Address
>
&
linphoneAddress
)
{
const
QString
&
sipAddress
=
::
Utils
::
linphoneStringToQString
(
linphoneAddress
->
asStringUriOnly
());
if
(
mSipAddresses
.
contains
(
sipAddress
))
return
false
;
int
row
=
rowCount
();
beginInsertRows
(
QModelIndex
(),
row
,
row
);
addToConferencePrivate
(
linphoneAddress
->
clone
());
endInsertRows
();
mConferenceHelperModel
->
invalidate
();
return
true
;
}
bool
ConferenceHelperModel
::
ConferenceAddModel
::
addToConference
(
const
QString
&
sipAddress
)
{
if
(
mSipAddresses
.
contains
(
sipAddress
))
return
false
;
...
...
@@ -80,7 +98,7 @@ bool ConferenceHelperModel::ConferenceAddModel::addToConference (const QString &
shared_ptr
<
linphone
::
Address
>
linphoneAddress
=
CoreManager
::
getInstance
()
->
getCore
()
->
interpretUrl
(
::
Utils
::
qStringToLinphoneString
(
sipAddress
)
);
addToConference
(
linphoneAddress
);
addToConference
Private
(
linphoneAddress
);
endInsertRows
();
...
...
@@ -120,7 +138,19 @@ void ConferenceHelperModel::ConferenceAddModel::update () {
linphoneAddresses
.
push_back
(
linphoneAddress
);
}
mConferenceHelperModel
->
mConference
->
inviteParticipants
(
shared_ptr
<
linphone
::
Conference
>
conference
=
mConferenceHelperModel
->
mConference
;
// Remove sip addresses if necessary.
for
(
const
auto
&
call
:
CoreManager
::
getInstance
()
->
getCore
()
->
getCalls
())
{
if
(
!
call
->
getParams
()
->
getLocalConferenceMode
())
continue
;
const
QString
&
sipAddress
=
::
Utils
::
linphoneStringToQString
(
call
->
getRemoteAddress
()
->
asStringUriOnly
());
if
(
!
mSipAddresses
.
contains
(
sipAddress
))
call
->
terminate
();
}
conference
->
inviteParticipants
(
linphoneAddresses
,
CoreManager
::
getInstance
()
->
getCore
()
->
createCallParams
(
nullptr
)
);
...
...
@@ -128,7 +158,7 @@ void ConferenceHelperModel::ConferenceAddModel::update () {
// -----------------------------------------------------------------------------
void
ConferenceHelperModel
::
ConferenceAddModel
::
addToConference
(
const
shared_ptr
<
linphone
::
Address
>
&
linphoneAddress
)
{
void
ConferenceHelperModel
::
ConferenceAddModel
::
addToConference
Private
(
const
shared_ptr
<
linphone
::
Address
>
&
linphoneAddress
)
{
QString
sipAddress
=
::
Utils
::
linphoneStringToQString
(
linphoneAddress
->
asStringUriOnly
());
QVariantMap
map
=
CoreManager
::
getInstance
()
->
getSipAddressesModel
()
->
find
(
sipAddress
);
...
...
linphone-desktop/src/components/conference/ConferenceAddModel.hpp
View file @
06ff2410
...
...
@@ -26,7 +26,10 @@
#include <memory>
#include "ConferenceHelperModel.hpp"
#include "ConferenceModel.hpp"
// =============================================================================
// Sip addresses list to add to conference.
// =============================================================================
namespace
linphone
{
...
...
@@ -45,6 +48,8 @@ public:
QHash
<
int
,
QByteArray
>
roleNames
()
const
override
;
QVariant
data
(
const
QModelIndex
&
index
,
int
role
=
Qt
::
DisplayRole
)
const
override
;
bool
addToConference
(
const
std
::
shared_ptr
<
const
linphone
::
Address
>
&
linphoneAddress
);
Q_INVOKABLE
bool
addToConference
(
const
QString
&
sipAddress
);
Q_INVOKABLE
bool
removeFromConference
(
const
QString
&
sipAddress
);
...
...
@@ -55,7 +60,7 @@ public:
}
private:
void
addToConference
(
const
std
::
shared_ptr
<
linphone
::
Address
>
&
linphoneAddress
);
void
addToConference
Private
(
const
std
::
shared_ptr
<
linphone
::
Address
>
&
linphoneAddress
);
void
handleDataChanged
(
const
QModelIndex
&
topLeft
,
...
...
linphone-desktop/src/components/conference/ConferenceHelperModel.hpp
View file @
06ff2410
...
...
@@ -27,6 +27,9 @@
#include <QSortFilterProxyModel>
// =============================================================================
// Sip addresses not in conference.
// Can filter the sip addresses with a pattern.
// =============================================================================
class
CallModel
;
...
...
linphone-desktop/src/components/conference/ConferenceModel.cpp
0 → 100644
View file @
06ff2410
/*
* ConferenceModel.cpp
* Copyright (C) 2017 Belledonne Communications, Grenoble, France
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Created on: May 23, 2017
* Author: Ronan Abhamon
*/
#include "ConferenceModel.hpp"
// =============================================================================
ConferenceModel
::
ConferenceModel
(
QObject
*
parent
)
:
QAbstractListModel
(
parent
)
{}
int
ConferenceModel
::
rowCount
(
const
QModelIndex
&
index
)
const
{
return
mSipAddresses
.
count
();
}
QHash
<
int
,
QByteArray
>
ConferenceModel
::
roleNames
()
const
{
QHash
<
int
,
QByteArray
>
roles
;
roles
[
Qt
::
DisplayRole
]
=
"$sipAddress"
;
return
roles
;
}
QVariant
ConferenceModel
::
data
(
const
QModelIndex
&
index
,
int
role
)
const
{
int
row
=
index
.
row
();
if
(
!
index
.
isValid
()
||
row
<
0
||
row
>=
mSipAddresses
.
count
())
return
QVariant
();
if
(
role
==
Qt
::
DisplayRole
)
return
mSipAddresses
[
row
];
return
QVariant
();
}
linphone-desktop/src/components/conference/ConferenceModel.hpp
0 → 100644
View file @
06ff2410
/*
* ConferenceModel.hpp
* Copyright (C) 2017 Belledonne Communications, Grenoble, France
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Created on: May 23, 2017
* Author: Ronan Abhamon
*/
#ifndef CONFERENCE_MODEL_H_
#define CONFERENCE_MODEL_H_
#include <QAbstractListModel>
// =============================================================================
class
ConferenceModel
:
public
QAbstractListModel
{
public:
ConferenceModel
(
QObject
*
parent
=
Q_NULLPTR
);
~
ConferenceModel
()
=
default
;
int
rowCount
(
const
QModelIndex
&
index
=
QModelIndex
())
const
override
;
QHash
<
int
,
QByteArray
>
roleNames
()
const
override
;
QVariant
data
(
const
QModelIndex
&
index
,
int
role
=
Qt
::
DisplayRole
)
const
override
;
private:
QStringList
mSipAddresses
;
};
#endif // CONFERENCE_MODEL_H_
linphone-desktop/ui/modules/Linphone/Calls/Calls.qml
View file @
06ff2410
...
...
@@ -136,7 +136,7 @@ ListView {
readonly
property
var
params
:
Logic
.
getParams
(
$call
)
anchors.centerIn
:
parent
sourceComponent
:
params
.
component
sourceComponent
:
params
?
params
.
component
:
null
}
SequentialAnimation
on
color
{
...
...
linphone-desktop/ui/views/App/Calls/CallsWindow.qml
View file @
06ff2410
...
...
@@ -19,9 +19,10 @@ Window {
// `{}` is a workaround to avoid `TypeError: Cannot read property...`.
property
var
call
:
calls
.
selectedCall
||
({
callError
:
''
,
isOutgoing
:
true
,
sipAddress
:
''
,
recording
:
false
,
sipAddress
:
''
,
updating
:
true
,
videoEnabled
:
false
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment