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
ce2a71ce
Commit
ce2a71ce
authored
Mar 29, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(app): many changes, pass a sip address observer to contact entry when it's possible
parent
0dbb1c36
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
170 additions
and
158 deletions
+170
-158
resources.qrc
linphone-desktop/resources.qrc
+1
-0
AsyncObjectBuilder.cpp
...ne-desktop/src/app/object-builders/AsyncObjectBuilder.cpp
+3
-0
CallControls.qml
linphone-desktop/ui/modules/Linphone/Calls/CallControls.qml
+1
-8
Calls.js
linphone-desktop/ui/modules/Linphone/Calls/Calls.js
+148
-0
Calls.qml
linphone-desktop/ui/modules/Linphone/Calls/Calls.qml
+11
-138
NotificationReceivedCall.qml
...dules/Linphone/Notifications/NotificationReceivedCall.qml
+4
-6
NotificationReceivedMessage.qml
...es/Linphone/Notifications/NotificationReceivedMessage.qml
+1
-6
SmartSearchBar.qml
linphone-desktop/ui/modules/Linphone/SmartSearchBar.qml
+1
-0
No files found.
linphone-desktop/resources.qrc
View file @
ce2a71ce
...
@@ -265,6 +265,7 @@
...
@@ -265,6 +265,7 @@
<file>
ui/modules/Common/Window/Window.qml
</file>
<file>
ui/modules/Common/Window/Window.qml
</file>
<file>
ui/modules/Linphone/Account/AccountStatus.qml
</file>
<file>
ui/modules/Linphone/Account/AccountStatus.qml
</file>
<file>
ui/modules/Linphone/Calls/CallControls.qml
</file>
<file>
ui/modules/Linphone/Calls/CallControls.qml
</file>
<file>
ui/modules/Linphone/Calls/Calls.js
</file>
<file>
ui/modules/Linphone/Calls/Calls.qml
</file>
<file>
ui/modules/Linphone/Calls/Calls.qml
</file>
<file>
ui/modules/Linphone/CardBlock.qml
</file>
<file>
ui/modules/Linphone/CardBlock.qml
</file>
<file>
ui/modules/Linphone/Chat/Chat.js
</file>
<file>
ui/modules/Linphone/Chat/Chat.js
</file>
...
...
linphone-desktop/src/app/object-builders/AsyncObjectBuilder.cpp
View file @
ce2a71ce
...
@@ -92,6 +92,9 @@ void AsyncObjectBuilder::createObject (QQmlEngine *engine, const char *path, Dec
...
@@ -92,6 +92,9 @@ void AsyncObjectBuilder::createObject (QQmlEngine *engine, const char *path, Dec
#ifdef QT_DEBUG
#ifdef QT_DEBUG
Q_ASSERT
(
!
m_block_creation
);
Q_ASSERT
(
!
m_block_creation
);
m_block_creation
=
true
;
m_block_creation
=
true
;
Q_ASSERT
(
engine
!=
nullptr
);
Q_ASSERT
(
path
!=
nullptr
);
#endif // ifdef QT_DEBUG
#endif // ifdef QT_DEBUG
m_component
=
new
QQmlComponent
(
engine
,
QUrl
(
path
),
QQmlComponent
::
Asynchronous
,
this
);
m_component
=
new
QQmlComponent
(
engine
,
QUrl
(
path
),
QQmlComponent
::
Asynchronous
,
this
);
...
...
linphone-desktop/ui/modules/Linphone/Calls/CallControls.qml
View file @
ce2a71ce
...
@@ -21,10 +21,6 @@ Rectangle {
...
@@ -21,10 +21,6 @@ Rectangle {
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
property
var
_sipAddressObserver
:
SipAddressesModel
.
getSipAddressObserver
(
sipAddress
)
// ---------------------------------------------------------------------------
signal
clicked
signal
clicked
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
...
@@ -56,10 +52,7 @@ Rectangle {
...
@@ -56,10 +52,7 @@ Rectangle {
displayUnreadMessagesCount
:
true
displayUnreadMessagesCount
:
true
entry
:
({
entry
:
SipAddressesModel
.
getSipAddressObserver
(
sipAddress
)
contact
:
_sipAddressObserver
.
contact
,
sipAddress
:
callControls
.
sipAddress
})
}
}
Item
{
Item
{
...
...
linphone-desktop/ui/modules/Linphone/Calls/Calls.js
0 → 100644
View file @
ce2a71ce
// =============================================================================
// `Calls.qml` Logic.
// =============================================================================
.
import
Linphone
1.0
as
Linphone
// =============================================================================
var
MAP_STATUS_TO_PARAMS
=
(
function
()
{
var
CallModel
=
Linphone
.
CallModel
var
map
=
{}
map
[
CallModel
.
CallStatusConnected
]
=
(
function
(
call
)
{
return
{
actions
:
[{
handler
:
(
function
()
{
call
.
pausedByUser
=
true
}),
name
:
qsTr
(
'
pauseCall
'
)
},
{
handler
:
(
function
()
{
call
.
transfer
()
}),
name
:
qsTr
(
'
transferCall
'
)
},
{
handler
:
(
function
()
{
call
.
terminate
()
}),
name
:
qsTr
(
'
terminateCall
'
)
}],
component
:
callActions
,
string
:
'
connected
'
}
})
map
[
CallModel
.
CallStatusEnded
]
=
(
function
(
call
)
{
return
{
string
:
'
ended
'
}
})
map
[
CallModel
.
CallStatusIncoming
]
=
(
function
(
call
)
{
return
{
actions
:
[{
name
:
qsTr
(
'
acceptAudioCall
'
),
handler
:
(
function
()
{
call
.
accept
()
})
},
{
name
:
qsTr
(
'
acceptVideoCall
'
),
handler
:
(
function
()
{
call
.
acceptWithVideo
()
})
},
{
name
:
qsTr
(
'
terminateCall
'
),
handler
:
(
function
()
{
call
.
terminate
()
})
}],
component
:
callActions
,
string
:
'
incoming
'
}
})
map
[
CallModel
.
CallStatusOutgoing
]
=
(
function
(
call
)
{
return
{
component
:
callAction
,
handler
:
(
function
()
{
call
.
terminate
()
}),
icon
:
'
hangup
'
,
string
:
'
outgoing
'
}
})
map
[
CallModel
.
CallStatusPaused
]
=
(
function
(
call
)
{
return
{
actions
:
[(
call
.
pausedByUser
?
{
handler
:
(
function
()
{
call
.
pausedByUser
=
false
}),
name
:
qsTr
(
'
resumeCall
'
)
}
:
{
handler
:
(
function
()
{
call
.
pausedByUser
=
true
}),
name
:
qsTr
(
'
pauseCall
'
)
}),
{
handler
:
(
function
()
{
call
.
transfer
()
}),
name
:
qsTr
(
'
transferCall
'
)
},
{
handler
:
(
function
()
{
call
.
terminate
()
}),
name
:
qsTr
(
'
terminateCall
'
)
}],
component
:
callActions
,
string
:
'
paused
'
}
})
return
map
;
})()
// -----------------------------------------------------------------------------
function
getParams
(
call
)
{
if
(
call
)
{
return
MAP_STATUS_TO_PARAMS
[
call
.
status
](
call
)
}
}
// -----------------------------------------------------------------------------
function
handleCallRunning
(
index
,
call
)
{
calls
.
currentIndex
=
index
calls
.
_selectedCall
=
call
}
function
handleRowsAboutToBeRemoved
(
_
,
first
,
last
)
{
var
index
=
calls
.
currentIndex
if
(
index
>=
first
&&
index
<=
last
)
{
// Remove current call.
var
model
=
calls
.
model
if
(
model
.
rowCount
()
-
(
last
-
first
+
1
)
<=
0
)
{
calls
.
_selectedCall
=
null
}
else
{
if
(
first
===
0
)
{
calls
.
_selectedCall
=
model
.
data
(
model
.
index
(
last
+
1
,
0
))
}
else
{
calls
.
_selectedCall
=
model
.
data
(
model
.
index
(
0
,
0
))
}
}
}
}
function
handleRowsRemoved
(
_
,
first
,
last
)
{
var
index
=
calls
.
currentIndex
// The current call has been removed.
if
(
index
>=
first
&&
index
<=
last
)
{
if
(
calls
.
model
.
rowCount
()
===
0
)
{
calls
.
currentIndex
=
-
1
// No calls.
}
else
{
calls
.
currentIndex
=
0
// The first call becomes the selected call.
}
}
// Update the current index of the selected call if it was after the removed calls.
else
if
(
last
<
index
)
{
calls
.
currentIndex
=
index
-
(
last
-
first
+
1
)
}
}
function
handleRowsInserted
(
_
,
first
,
last
)
{
// The last inserted outgoing element become the selected call.
var
model
=
calls
.
model
for
(
var
index
=
last
;
index
>=
first
;
index
--
)
{
var
call
=
model
.
data
(
model
.
index
(
index
,
0
))
if
(
call
.
isOutgoing
)
{
calls
.
currentIndex
=
first
calls
.
_selectedCall
=
model
.
data
(
model
.
index
(
first
,
0
))
}
}
}
linphone-desktop/ui/modules/Linphone/Calls/Calls.qml
View file @
ce2a71ce
...
@@ -4,6 +4,8 @@ import Common 1.0
...
@@ -4,6 +4,8 @@ import Common 1.0
import
Linphone
1.0
import
Linphone
1.0
import
Linphone
.
Styles
1.0
import
Linphone
.
Styles
1.0
import
'
Calls.js
'
as
Logic
// =============================================================================
// =============================================================================
ListView
{
ListView
{
...
@@ -13,153 +15,23 @@ ListView {
...
@@ -13,153 +15,23 @@ ListView {
readonly
property
var
selectedCall
:
_selectedCall
readonly
property
var
selectedCall
:
_selectedCall
property
var
_mapStatusToParams
property
var
_selectedCall
property
var
_selectedCall
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
function
_getParams
(
call
)
{
if
(
call
)
{
return
_mapStatusToParams
[
call
.
status
](
call
)
}
}
// ---------------------------------------------------------------------------
boundsBehavior
:
Flickable
.
StopAtBounds
boundsBehavior
:
Flickable
.
StopAtBounds
clip
:
true
clip
:
true
spacing
:
0
spacing
:
0
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
Component.onCompleted
:
{
_mapStatusToParams
=
{}
_mapStatusToParams
[
CallModel
.
CallStatusConnected
]
=
(
function
(
call
)
{
return
{
actions
:
[{
handler
:
(
function
()
{
call
.
pausedByUser
=
true
}),
name
:
qsTr
(
'
pauseCall
'
)
},
{
handler
:
(
function
()
{
call
.
transfer
()
}),
name
:
qsTr
(
'
transferCall
'
)
},
{
handler
:
(
function
()
{
call
.
terminate
()
}),
name
:
qsTr
(
'
terminateCall
'
)
}],
component
:
callActions
,
string
:
'
connected
'
}
})
_mapStatusToParams
[
CallModel
.
CallStatusEnded
]
=
(
function
(
call
)
{
return
{
string
:
'
ended
'
}
})
_mapStatusToParams
[
CallModel
.
CallStatusIncoming
]
=
(
function
(
call
)
{
return
{
actions
:
[{
name
:
qsTr
(
'
acceptAudioCall
'
),
handler
:
(
function
()
{
call
.
accept
()
})
},
{
name
:
qsTr
(
'
acceptVideoCall
'
),
handler
:
(
function
()
{
call
.
acceptWithVideo
()
})
},
{
name
:
qsTr
(
'
terminateCall
'
),
handler
:
(
function
()
{
call
.
terminate
()
})
}],
component
:
callActions
,
string
:
'
incoming
'
}
})
_mapStatusToParams
[
CallModel
.
CallStatusOutgoing
]
=
(
function
(
call
)
{
return
{
component
:
callAction
,
handler
:
(
function
()
{
call
.
terminate
()
}),
icon
:
'
hangup
'
,
string
:
'
outgoing
'
}
})
_mapStatusToParams
[
CallModel
.
CallStatusPaused
]
=
(
function
(
call
)
{
return
{
actions
:
[(
call
.
pausedByUser
?
{
handler
:
(
function
()
{
call
.
pausedByUser
=
false
}),
name
:
qsTr
(
'
resumeCall
'
)
}
:
{
handler
:
(
function
()
{
call
.
pausedByUser
=
true
}),
name
:
qsTr
(
'
pauseCall
'
)
}),
{
handler
:
(
function
()
{
call
.
transfer
()
}),
name
:
qsTr
(
'
transferCall
'
)
},
{
handler
:
(
function
()
{
call
.
terminate
()
}),
name
:
qsTr
(
'
terminateCall
'
)
}],
component
:
callActions
,
string
:
'
paused
'
}
})
}
// ---------------------------------------------------------------------------
Connections
{
Connections
{
target
:
model
target
:
model
onRowsAboutToBeRemoved
:
{
onCallRunning
:
Logic
.
handleCallRunning
(
index
,
call
)
var
index
=
calls
.
currentIndex
onRowsAboutToBeRemoved
:
Logic
.
handleRowsAboutToBeRemoved
(
parent
,
first
,
last
)
onRowsInserted
:
Logic
.
handleRowsInserted
(
parent
,
first
,
last
)
if
(
index
>=
first
&&
index
<=
last
)
{
// Remove current call.
onRowsRemoved
:
Logic
.
handleRowsRemoved
(
parent
,
first
,
last
)
if
(
model
.
rowCount
()
-
(
last
-
first
+
1
)
<=
0
)
{
_selectedCall
=
null
}
else
{
if
(
first
===
0
)
{
_selectedCall
=
model
.
data
(
model
.
index
(
last
+
1
,
0
))
}
else
{
_selectedCall
=
model
.
data
(
model
.
index
(
0
,
0
))
}
}
}
}
onRowsRemoved
:
{
var
index
=
calls
.
currentIndex
// The current call has been removed.
if
(
index
>=
first
&&
index
<=
last
)
{
if
(
model
.
rowCount
()
===
0
)
{
calls
.
currentIndex
=
-
1
// No calls.
}
else
{
calls
.
currentIndex
=
0
// The first call becomes the selected call.
}
}
// Update the current index of the selected call if it was after the removed calls.
else
if
(
last
<
index
)
{
calls
.
currentIndex
=
index
-
(
last
-
first
+
1
)
}
}
// The last inserted outgoing element become the selected call.
onRowsInserted
:
{
for
(
var
index
=
last
;
index
>=
first
;
index
--
)
{
var
call
=
model
.
data
(
model
.
index
(
index
,
0
))
if
(
call
.
isOutgoing
)
{
calls
.
currentIndex
=
first
_selectedCall
=
model
.
data
(
model
.
index
(
first
,
0
))
}
}
}
onCallRunning
:
{
calls
.
currentIndex
=
index
_selectedCall
=
call
}
}
}
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
...
@@ -260,10 +132,11 @@ ListView {
...
@@ -260,10 +132,11 @@ ListView {
Loader
{
Loader
{
id
:
loader
id
:
loader
property
int
callId
:
index
readonly
property
int
callId
:
index
property
var
call
:
$call
property
var
callControls
:
_callControls
readonly
property
var
call
:
$call
property
var
params
:
_getParams
(
$call
)
readonly
property
var
callControls
:
_callControls
readonly
property
var
params
:
Logic
.
getParams
(
$call
)
anchors.centerIn
:
parent
anchors.centerIn
:
parent
sourceComponent
:
params
.
component
sourceComponent
:
params
.
component
...
...
linphone-desktop/ui/modules/Linphone/Notifications/NotificationReceivedCall.qml
View file @
ce2a71ce
...
@@ -13,8 +13,6 @@ Notification {
...
@@ -13,8 +13,6 @@ Notification {
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
property
var
_call
:
notificationData
&&
notificationData
.
call
property
var
_call
:
notificationData
&&
notificationData
.
call
property
var
_contact
:
_sipAddressObserver
.
contact
property
var
_sipAddressObserver
:
SipAddressesModel
.
getSipAddressObserver
(
_call
?
_call
.
sipAddress
:
''
)
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
...
@@ -49,10 +47,10 @@ Notification {
...
@@ -49,10 +47,10 @@ Notification {
Contact
{
Contact
{
Layout.fillWidth
:
true
Layout.fillWidth
:
true
entry
:
(
{
entry
:
{
contact
:
notification
.
_contact
,
var
call
=
notification
.
_call
sipAddress
:
notification
.
_sipAddressObserver
.
sipAddress
return
SipAddressesModel
.
getSipAddressObserver
(
call
?
call
.
sipAddress
:
''
)
}
)
}
}
}
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
...
...
linphone-desktop/ui/modules/Linphone/Notifications/NotificationReceivedMessage.qml
View file @
ce2a71ce
...
@@ -13,8 +13,6 @@ Notification {
...
@@ -13,8 +13,6 @@ Notification {
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
property
string
_sipAddress
:
notificationData
&&
notificationData
.
sipAddress
||
''
property
string
_sipAddress
:
notificationData
&&
notificationData
.
sipAddress
||
''
property
var
_contact
:
_sipAddressObserver
.
contact
property
var
_sipAddressObserver
:
SipAddressesModel
.
getSipAddressObserver
(
_sipAddress
)
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
...
@@ -49,10 +47,7 @@ Notification {
...
@@ -49,10 +47,7 @@ Notification {
Contact
{
Contact
{
Layout.fillWidth
:
true
Layout.fillWidth
:
true
entry
:
({
entry
:
SipAddressesModel
.
getSipAddressObserver
(
notification
.
_sipAddress
)
contact
:
notification
.
_contact
,
sipAddress
:
notification
.
_sipAddress
})
}
}
Rectangle
{
Rectangle
{
...
...
linphone-desktop/ui/modules/Linphone/SmartSearchBar.qml
View file @
ce2a71ce
...
@@ -77,6 +77,7 @@ SearchBox {
...
@@ -77,6 +77,7 @@ SearchBox {
Layout.fillHeight
:
true
Layout.fillHeight
:
true
Layout.fillWidth
:
true
Layout.fillWidth
:
true
entry
:
({
entry
:
({
sipAddress
:
interpretableSipAddress
sipAddress
:
interpretableSipAddress
})
})
...
...
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