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
22db039c
Commit
22db039c
authored
May 30, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/views/App/Calls/CallsWindow): supports call transfer
parent
9dda95aa
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
238 additions
and
18 deletions
+238
-18
en.ts
linphone-desktop/assets/languages/en.ts
+11
-0
fr.ts
linphone-desktop/assets/languages/fr.ts
+11
-0
resources.qrc
linphone-desktop/resources.qrc
+2
-0
CallModel.cpp
linphone-desktop/src/components/call/CallModel.cpp
+11
-0
CallModel.hpp
linphone-desktop/src/components/call/CallModel.hpp
+2
-0
CallsListModel.cpp
linphone-desktop/src/components/calls/CallsListModel.cpp
+16
-14
CallsListModel.hpp
linphone-desktop/src/components/calls/CallsListModel.hpp
+1
-0
CoreHandlers.cpp
linphone-desktop/src/components/core/CoreHandlers.cpp
+51
-2
CoreHandlers.hpp
linphone-desktop/src/components/core/CoreHandlers.hpp
+8
-0
CallsWindow.js
linphone-desktop/ui/views/App/Calls/CallsWindow.js
+9
-2
CallTransfer.qml
linphone-desktop/ui/views/App/Calls/Dialogs/CallTransfer.qml
+102
-0
CallTransferStyle.qml
...p/ui/views/App/Styles/Calls/Dialogs/CallTransferStyle.qml
+12
-0
qmldir
linphone-desktop/ui/views/App/Styles/qmldir
+2
-0
No files found.
linphone-desktop/assets/languages/en.ts
View file @
22db039c
...
...
@@ -280,6 +280,17 @@
<
translation
>
Video
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
CallTransfer
<
/name
>
<
message
>
<
source
>
cancel
<
/source
>
<
translation
>
CANCEL
<
/translation
>
<
/message
>
<
message
>
<
source
>
callTransferDescription
<
/source
>
<
translation
>
Do
you
want
to
transfer
this
call
?
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
Calls
<
/name
>
<
message
>
...
...
linphone-desktop/assets/languages/fr.ts
View file @
22db039c
...
...
@@ -280,6 +280,17 @@
<
translation
>
Vid
é
o
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
CallTransfer
<
/name
>
<
message
>
<
source
>
cancel
<
/source
>
<
translation
>
ANNULER
<
/translation
>
<
/message
>
<
message
>
<
source
>
callTransferDescription
<
/source
>
<
translation
>
Voulez
-
vous
transf
é
rer
cet
appel
?
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
Calls
<
/name
>
<
message
>
...
...
linphone-desktop/resources.qrc
View file @
22db039c
...
...
@@ -358,6 +358,7 @@
<file>
ui/views/App/Calls/CallsWindow.qml
</file>
<file>
ui/views/App/Calls/ConferenceManager.qml
</file>
<file>
ui/views/App/Calls/Conference.qml
</file>
<file>
ui/views/App/Calls/Dialogs/CallTransfer.qml
</file>
<file>
ui/views/App/Calls/EndedCall.qml
</file>
<file>
ui/views/App/Calls/IncallFullscreenWindow.qml
</file>
<file>
ui/views/App/Calls/Incall.js
</file>
...
...
@@ -408,6 +409,7 @@
<file>
ui/views/App/Styles/Calls/CallsWindowStyle.qml
</file>
<file>
ui/views/App/Styles/Calls/ConferenceManagerStyle.qml
</file>
<file>
ui/views/App/Styles/Calls/ConferenceStyle.qml
</file>
<file>
ui/views/App/Styles/Calls/Dialogs/CallTransferStyle.qml
</file>
<file>
ui/views/App/Styles/Main/AboutStyle.qml
</file>
<file>
ui/views/App/Styles/Main/Assistant/ActivateLinphoneSipAccountWithEmailStyle.qml
</file>
<file>
ui/views/App/Styles/Main/Assistant/AssistantAbstractViewStyle.qml
</file>
...
...
linphone-desktop/src/components/call/CallModel.cpp
View file @
22db039c
...
...
@@ -135,10 +135,21 @@ void CallModel::terminate () {
core
->
unlockVideoRender
();
}
// -----------------------------------------------------------------------------
void
CallModel
::
askForTransfer
()
{
CoreManager
::
getInstance
()
->
getCallsListModel
()
->
askForTransfer
(
this
);
}
bool
CallModel
::
transferTo
(
const
QString
&
sipAddress
)
{
bool
status
=
!!
mCall
->
transfer
(
::
Utils
::
qStringToLinphoneString
(
sipAddress
));
if
(
status
)
qWarning
()
<<
QStringLiteral
(
"Unable to transfer: `%1`."
).
arg
(
sipAddress
);
return
status
;
}
// -----------------------------------------------------------------------------
void
CallModel
::
acceptVideoRequest
()
{
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
shared_ptr
<
linphone
::
CallParams
>
params
=
core
->
createCallParams
(
mCall
);
...
...
linphone-desktop/src/components/call/CallModel.hpp
View file @
22db039c
...
...
@@ -86,7 +86,9 @@ public:
Q_INVOKABLE
void
accept
();
Q_INVOKABLE
void
acceptWithVideo
();
Q_INVOKABLE
void
terminate
();
Q_INVOKABLE
void
askForTransfer
();
Q_INVOKABLE
bool
transferTo
(
const
QString
&
sipAddress
);
Q_INVOKABLE
void
acceptVideoRequest
();
Q_INVOKABLE
void
rejectVideoRequest
();
...
...
linphone-desktop/src/components/calls/CallsListModel.cpp
View file @
22db039c
...
...
@@ -212,18 +212,20 @@ void CallsListModel::removeCall (const shared_ptr<linphone::Call> &call) {
return
;
}
QTimer
::
singleShot
(
DELAY_BEFORE_REMOVE_CALL
,
this
,
[
this
,
callModel
]()
{
qInfo
()
<<
QStringLiteral
(
"Removing call:"
)
<<
callModel
;
int
index
=
mList
.
indexOf
(
callModel
);
if
(
index
==
-
1
||
!
removeRow
(
index
))
qWarning
()
<<
QStringLiteral
(
"Unable to remove call:"
)
<<
callModel
;
if
(
mList
.
empty
()
&&
ConferenceHelperModel
::
getInstancesNumber
()
==
0
)
{
qInfo
()
<<
QStringLiteral
(
"Last call terminated, close calls window."
);
App
::
getInstance
()
->
getCallsWindow
()
->
close
();
}
}
);
QTimer
::
singleShot
(
DELAY_BEFORE_REMOVE_CALL
,
this
,
[
this
,
callModel
]
{
removeCallCb
(
callModel
);
});
}
void
CallsListModel
::
removeCallCb
(
CallModel
*
callModel
)
{
qInfo
()
<<
QStringLiteral
(
"Removing call:"
)
<<
callModel
;
int
index
=
mList
.
indexOf
(
callModel
);
if
(
index
==
-
1
||
!
removeRow
(
index
))
qWarning
()
<<
QStringLiteral
(
"Unable to remove call:"
)
<<
callModel
;
if
(
mList
.
empty
()
&&
ConferenceHelperModel
::
getInstancesNumber
()
==
0
)
{
qInfo
()
<<
QStringLiteral
(
"Last call terminated, close calls window."
);
App
::
getInstance
()
->
getCallsWindow
()
->
close
();
}
}
linphone-desktop/src/components/calls/CallsListModel.hpp
View file @
22db039c
...
...
@@ -64,6 +64,7 @@ private:
void
addCall
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
);
void
removeCall
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
);
void
removeCallCb
(
CallModel
*
callModel
);
QList
<
CallModel
*>
mList
;
...
...
linphone-desktop/src/components/core/CoreHandlers.cpp
View file @
22db039c
...
...
@@ -38,9 +38,9 @@ using namespace std;
// Schedule a function in app context.
void
scheduleFunctionInApp
(
function
<
void
()
>
func
)
{
App
*
app
=
App
::
getInstance
();
if
(
QThread
::
currentThread
()
!=
app
->
thread
())
{
if
(
QThread
::
currentThread
()
!=
app
->
thread
())
QTimer
::
singleShot
(
0
,
app
,
func
);
}
else
else
func
();
}
...
...
@@ -168,3 +168,52 @@ void CoreHandlers::onRegistrationStateChanged (
)
{
emit
registrationStateChanged
(
proxyConfig
,
state
);
}
void
CoreHandlers
::
onTransferStateChanged
(
const
shared_ptr
<
linphone
::
Core
>
&
,
const
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
)
{
switch
(
state
)
{
case
linphone
:
:
CallStateEarlyUpdatedByRemote
:
case
linphone
:
:
CallStateEarlyUpdating
:
case
linphone
:
:
CallStateIdle
:
case
linphone
:
:
CallStateIncomingEarlyMedia
:
case
linphone
:
:
CallStateIncomingReceived
:
case
linphone
:
:
CallStateOutgoingEarlyMedia
:
case
linphone
:
:
CallStateOutgoingRinging
:
case
linphone
:
:
CallStatePaused
:
case
linphone
:
:
CallStatePausedByRemote
:
case
linphone
:
:
CallStatePausing
:
case
linphone
:
:
CallStateRefered
:
case
linphone
:
:
CallStateReleased
:
case
linphone
:
:
CallStateResuming
:
case
linphone
:
:
CallStateStreamsRunning
:
case
linphone
:
:
CallStateUpdatedByRemote
:
case
linphone
:
:
CallStateUpdating
:
break
;
// Nothing.
// 1. Init.
case
linphone
:
:
CallStateOutgoingInit
:
qInfo
()
<<
QStringLiteral
(
"Call transfer init."
);
break
;
// 2. In progress.
case
linphone
:
:
CallStateOutgoingProgress
:
qInfo
()
<<
QStringLiteral
(
"Call transfer in progress."
);
break
;
// 3. Done.
case
linphone
:
:
CallStateConnected
:
qInfo
()
<<
QStringLiteral
(
"Call transfer succeeded."
);
emit
callTransferSucceeded
(
call
);
break
;
// 4. Error.
case
linphone
:
:
CallStateEnd
:
case
linphone
:
:
CallStateError
:
qWarning
()
<<
QStringLiteral
(
"Call transfer failed."
);
emit
callTransferFailed
(
call
);
break
;
}
}
linphone-desktop/src/components/core/CoreHandlers.hpp
View file @
22db039c
...
...
@@ -43,6 +43,8 @@ public:
signals:
void
authenticationRequested
(
const
std
::
shared_ptr
<
linphone
::
AuthInfo
>
&
authInfo
);
void
callStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
);
void
callTransferFailed
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
);
void
callTransferSucceeded
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
);
void
coreStarted
();
void
messageReceived
(
const
std
::
shared_ptr
<
linphone
::
ChatMessage
>
&
message
);
void
presenceReceived
(
const
QString
&
sipAddress
,
const
std
::
shared_ptr
<
const
linphone
::
PresenceModel
>
&
presenceModel
);
...
...
@@ -107,6 +109,12 @@ private:
const
std
::
string
&
message
)
override
;
void
onTransferStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Core
>
&
core
,
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
)
override
;
// ---------------------------------------------------------------------------
bool
mCoreCreated
=
false
;
...
...
linphone-desktop/ui/views/App/Calls/CallsWindow.js
View file @
22db039c
...
...
@@ -22,7 +22,7 @@ function handleClosing (close) {
}
window
.
attachVirtualWindow
(
Utils
.
buildDialogUri
(
'
ConfirmDialog
'
),
{
descriptionText
:
qsTr
(
'
acceptClosingDescription
'
)
,
descriptionText
:
qsTr
(
'
acceptClosingDescription
'
)
},
function
(
status
)
{
if
(
status
)
{
forceClose
=
true
...
...
@@ -71,5 +71,12 @@ function getContent () {
// -----------------------------------------------------------------------------
function
handleCallTransferAsked
(
call
)
{
console
.
log
(
'
TODO: handle call transfer
'
)
if
(
!
call
)
{
return
}
window
.
detachVirtualWindow
()
window
.
attachVirtualWindow
(
Qt
.
resolvedUrl
(
'
Dialogs/CallTransfer.qml
'
),
{
call
:
call
})
}
linphone-desktop/ui/views/App/Calls/Dialogs/CallTransfer.qml
0 → 100644
View file @
22db039c
import
QtQuick
2.7
import
QtQuick
.
Layouts
1.3
import
Common
1.0
import
Linphone
1.0
import
App
.
Styles
1.0
// =============================================================================
DialogPlus
{
id
:
callTransfer
// ---------------------------------------------------------------------------
property
var
call
// ---------------------------------------------------------------------------
buttons
:
[
TextButtonA
{
text
:
qsTr
(
'
cancel
'
)
onClicked
:
exit
(
0
)
}
]
centeredButtons
:
true
descriptionText
:
qsTr
(
'
callTransferDescription
'
)
height
:
CallTransferStyle
.
height
width
:
CallTransferStyle
.
width
onCallChanged
:
!
call
&&
exit
(
0
)
// ---------------------------------------------------------------------------
ColumnLayout
{
anchors
{
fill
:
parent
leftMargin
:
CallTransferStyle
.
leftMargin
rightMargin
:
CallTransferStyle
.
rightMargin
}
spacing
:
0
Contact
{
Layout.fillWidth
:
true
entry
:
SipAddressesModel
.
getSipAddressObserver
(
call
?
call
.
sipAddress
:
''
)
}
// -------------------------------------------------------------------------
// Address selector.
// -------------------------------------------------------------------------
Item
{
Layout.fillHeight
:
true
Layout.fillWidth
:
true
ColumnLayout
{
anchors.fill
:
parent
spacing
:
CallTransferStyle
.
spacing
TextField
{
id
:
filter
Layout.fillWidth
:
true
icon
:
'
search
'
onTextChanged
:
sipAddressesModel
.
setFilter
(
text
)
}
ScrollableListViewField
{
Layout.fillHeight
:
true
Layout.fillWidth
:
true
SipAddressesView
{
anchors.fill
:
parent
actions
:
[{
icon
:
'
transfer
'
,
handler
:
function
(
entry
)
{
callTransfer
.
call
.
transferTo
(
entry
.
sipAddress
)
exit
(
1
)
}
}]
genSipAddress
:
filter
.
text
model
:
SipAddressesProxyModel
{
id
:
sipAddressesModel
}
onEntryClicked
:
actions
[
0
].
handler
(
entry
)
}
}
}
}
}
}
linphone-desktop/ui/views/App/Styles/Calls/Dialogs/CallTransferStyle.qml
0 → 100644
View file @
22db039c
pragma
Singleton
import
QtQuick
2.7
// =============================================================================
QtObject
{
property
int
height
:
420
property
int
leftMargin
:
35
property
int
rightMargin
:
35
property
int
spacing
:
10
property
int
width
:
450
}
linphone-desktop/ui/views/App/Styles/qmldir
View file @
22db039c
...
...
@@ -9,6 +9,8 @@ singleton CallsWindowStyle 1.0 Calls/CallsWindowStyle.qm
singleton ConferenceManagerStyle 1.0 Calls/ConferenceManagerStyle.qml
singleton ConferenceStyle 1.0 Calls/ConferenceStyle.qml
singleton CallTransferStyle 1.0 Calls/Dialogs/CallTransferStyle.qml
singleton ActivateLinphoneSipAccountWithEmailStyle 1.0 Main/Assistant/ActivateLinphoneSipAccountWithEmailStyle.qml
singleton AssistantAbstractViewStyle 1.0 Main/Assistant/AssistantAbstractViewStyle.qml
singleton AssistantHomeStyle 1.0 Main/Assistant/AssistantHomeStyle.qml
...
...
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