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
2f5d23cb
Commit
2f5d23cb
authored
Jan 24, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/views/App/Calls/Incall): display timer
parent
3d83700f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
74 additions
and
15 deletions
+74
-15
CallModel.cpp
tests/src/components/call/CallModel.cpp
+8
-4
CallModel.hpp
tests/src/components/call/CallModel.hpp
+5
-2
CallsListModel.cpp
tests/src/components/calls/CallsListModel.cpp
+12
-4
utils.js
tests/ui/scripts/Utils/utils.js
+24
-0
Incall.qml
tests/ui/views/App/Calls/Incall.qml
+20
-5
CallStyle.qml
tests/ui/views/App/Styles/Calls/CallStyle.qml
+5
-0
No files found.
tests/src/components/call/CallModel.cpp
View file @
2f5d23cb
...
@@ -57,10 +57,6 @@ void CallModel::transfer () {
...
@@ -57,10 +57,6 @@ void CallModel::transfer () {
// TODO
// TODO
}
}
float
CallModel
::
getQuality
()
const
{
return
m_linphone_call
->
getCurrentQuality
();
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
QString
CallModel
::
getSipAddress
()
const
{
QString
CallModel
::
getSipAddress
()
const
{
...
@@ -90,6 +86,14 @@ CallModel::CallStatus CallModel::getStatus () const {
...
@@ -90,6 +86,14 @@ CallModel::CallStatus CallModel::getStatus () const {
return
m_linphone_call
->
getDir
()
==
linphone
::
CallDirIncoming
?
CallStatusIncoming
:
CallStatusOutgoing
;
return
m_linphone_call
->
getDir
()
==
linphone
::
CallDirIncoming
?
CallStatusIncoming
:
CallStatusOutgoing
;
}
}
int
CallModel
::
getDuration
()
const
{
return
m_linphone_call
->
getDuration
();
}
float
CallModel
::
getQuality
()
const
{
return
m_linphone_call
->
getCurrentQuality
();
}
bool
CallModel
::
getMicroMuted
()
const
{
bool
CallModel
::
getMicroMuted
()
const
{
return
m_micro_muted
;
return
m_micro_muted
;
}
}
...
...
tests/src/components/call/CallModel.hpp
View file @
2f5d23cb
...
@@ -12,6 +12,8 @@ class CallModel : public QObject {
...
@@ -12,6 +12,8 @@ class CallModel : public QObject {
Q_PROPERTY
(
QString
sipAddress
READ
getSipAddress
CONSTANT
);
Q_PROPERTY
(
QString
sipAddress
READ
getSipAddress
CONSTANT
);
Q_PROPERTY
(
CallStatus
status
READ
getStatus
NOTIFY
statusChanged
);
Q_PROPERTY
(
CallStatus
status
READ
getStatus
NOTIFY
statusChanged
);
Q_PROPERTY
(
bool
isOutgoing
READ
isOutgoing
CONSTANT
);
Q_PROPERTY
(
bool
isOutgoing
READ
isOutgoing
CONSTANT
);
Q_PROPERTY
(
int
duration
READ
getDuration
CONSTANT
);
Q_PROPERTY
(
float
quality
READ
getQuality
CONSTANT
);
Q_PROPERTY
(
bool
microMuted
READ
getMicroMuted
WRITE
setMicroMuted
NOTIFY
microMutedChanged
);
Q_PROPERTY
(
bool
microMuted
READ
getMicroMuted
WRITE
setMicroMuted
NOTIFY
microMutedChanged
);
Q_PROPERTY
(
bool
pausedByUser
READ
getPausedByUser
WRITE
setPausedByUser
NOTIFY
statusChanged
);
Q_PROPERTY
(
bool
pausedByUser
READ
getPausedByUser
WRITE
setPausedByUser
NOTIFY
statusChanged
);
Q_PROPERTY
(
bool
videoInputEnabled
READ
getVideoInputEnabled
WRITE
setVideoInputEnabled
NOTIFY
videoInputEnabled
);
Q_PROPERTY
(
bool
videoInputEnabled
READ
getVideoInputEnabled
WRITE
setVideoInputEnabled
NOTIFY
videoInputEnabled
);
...
@@ -37,8 +39,6 @@ public:
...
@@ -37,8 +39,6 @@ public:
Q_INVOKABLE
void
terminate
();
Q_INVOKABLE
void
terminate
();
Q_INVOKABLE
void
transfer
();
Q_INVOKABLE
void
transfer
();
Q_INVOKABLE
float
getQuality
()
const
;
signals:
signals:
void
statusChanged
(
CallStatus
status
);
void
statusChanged
(
CallStatus
status
);
void
microMutedChanged
(
bool
status
);
void
microMutedChanged
(
bool
status
);
...
@@ -53,6 +53,9 @@ private:
...
@@ -53,6 +53,9 @@ private:
return
m_linphone_call
->
getDir
()
==
linphone
::
CallDirOutgoing
;
return
m_linphone_call
->
getDir
()
==
linphone
::
CallDirOutgoing
;
}
}
int
getDuration
()
const
;
float
getQuality
()
const
;
bool
getMicroMuted
()
const
;
bool
getMicroMuted
()
const
;
void
setMicroMuted
(
bool
status
);
void
setMicroMuted
(
bool
status
);
...
...
tests/src/components/calls/CallsListModel.cpp
View file @
2f5d23cb
...
@@ -63,13 +63,21 @@ QVariant CallsListModel::data (const QModelIndex &index, int role) const {
...
@@ -63,13 +63,21 @@ QVariant CallsListModel::data (const QModelIndex &index, int role) const {
void
CallsListModel
::
launchAudioCall
(
const
QString
&
sip_uri
)
const
{
void
CallsListModel
::
launchAudioCall
(
const
QString
&
sip_uri
)
const
{
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
core
->
inviteAddress
(
shared_ptr
<
linphone
::
Address
>
address
=
core
->
interpretUrl
(
::
Utils
::
qStringToLinphoneString
(
sip_uri
));
core
->
interpretUrl
(
::
Utils
::
qStringToLinphoneString
(
sip_uri
))
);
if
(
!
address
)
return
;
shared_ptr
<
linphone
::
CallParams
>
params
=
core
->
createCallParams
(
nullptr
);
params
->
enableVideo
(
false
);
core
->
inviteAddressWithParams
(
address
,
params
);
}
}
void
CallsListModel
::
launchVideoCall
(
const
QString
&
sip_uri
)
const
{
void
CallsListModel
::
launchVideoCall
(
const
QString
&
sip_uri
)
const
{
// TODO
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
// TODO: Deal with videos.
core
->
inviteAddress
(
core
->
interpretUrl
(
::
Utils
::
qStringToLinphoneString
(
sip_uri
)));
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
...
...
tests/ui/scripts/Utils/utils.js
View file @
2f5d23cb
...
@@ -314,6 +314,30 @@ function find (obj, cb, context) {
...
@@ -314,6 +314,30 @@ function find (obj, cb, context) {
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
function
formatElapsedTime
(
seconds
)
{
seconds
=
parseInt
(
seconds
,
10
)
var
h
=
Math
.
floor
(
seconds
/
3600
)
var
m
=
Math
.
floor
((
seconds
-
h
*
3600
)
/
60
)
var
s
=
seconds
-
h
*
3600
-
m
*
60
if
(
h
<
10
&&
h
>
0
)
{
h
=
'
0
'
+
h
}
if
(
m
<
10
)
{
m
=
'
0
'
+
m
}
if
(
s
<
10
)
{
s
=
'
0
'
+
s
}
return
(
h
===
0
?
''
:
h
+
'
:
'
)
+
m
+
'
:
'
+
s
}
// -----------------------------------------------------------------------------
function
formatSize
(
size
)
{
function
formatSize
(
size
)
{
var
units
=
[
'
KB
'
,
'
MB
'
,
'
GB
'
,
'
TB
'
]
var
units
=
[
'
KB
'
,
'
MB
'
,
'
GB
'
,
'
TB
'
]
var
unit
=
'
B
'
var
unit
=
'
B
'
...
...
tests/ui/views/App/Calls/Incall.qml
View file @
2f5d23cb
...
@@ -5,6 +5,7 @@ import Common 1.0
...
@@ -5,6 +5,7 @@ import Common 1.0
import
Common
.
Styles
1.0
import
Common
.
Styles
1.0
import
Linphone
1.0
import
Linphone
1.0
import
LinphoneUtils
1.0
import
LinphoneUtils
1.0
import
Utils
1.0
import
App
.
Styles
1.0
import
App
.
Styles
1.0
...
@@ -56,11 +57,7 @@ Rectangle {
...
@@ -56,11 +57,7 @@ Rectangle {
triggeredOnStart
:
true
triggeredOnStart
:
true
onTriggered
:
{
onTriggered
:
{
if
(
!
call
.
getQuality
)
{
var
quality
=
call
.
quality
return
}
var
quality
=
call
.
getQuality
()
callQuality
.
icon
=
'
call_quality_
'
+
(
callQuality
.
icon
=
'
call_quality_
'
+
(
// Note: `quality` is in the [0, 5] interval.
// Note: `quality` is in the [0, 5] interval.
// It's necessary to map in the `call_quality_` interval. ([0, 3])
// It's necessary to map in the `call_quality_` interval. ([0, 3])
...
@@ -106,6 +103,24 @@ Rectangle {
...
@@ -106,6 +103,24 @@ Rectangle {
}
}
}
}
Text
{
id
:
elapsedTime
Layout.fillWidth
:
true
color
:
CallStyle
.
header
.
elapsedTime
.
color
font.pointSize
:
CallStyle
.
header
.
elapsedTime
.
fontSize
horizontalAlignment
:
Text
.
AlignHCenter
Component.onCompleted
:
{
var
updateDuration
=
function
()
{
text
=
Utils
.
formatElapsedTime
(
call
.
duration
)
Utils
.
setTimeout
(
elapsedTime
,
1000
,
updateDuration
)
}
updateDuration
()
}
}
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
// Contact visual.
// Contact visual.
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
...
...
tests/ui/views/App/Styles/Calls/CallStyle.qml
View file @
2f5d23cb
...
@@ -47,5 +47,10 @@ QtObject {
...
@@ -47,5 +47,10 @@ QtObject {
property
int
height
:
60
property
int
height
:
60
property
int
width
:
150
property
int
width
:
150
}
}
property
QtObject
elapsedTime
:
QtObject
{
property
color
color
:
Colors
.
j
property
int
fontSize
:
10
}
}
}
}
}
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