Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Plasma Phone Components
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
26
Issues
26
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Plasma
Plasma Phone Components
Commits
5eefb274
Commit
5eefb274
authored
Jun 29, 2015
by
Martin Klapetek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dialer] Make the history work
parent
9b1cc9f1
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
4 deletions
+18
-4
dialer/package/contents/ui/Dialer/History.qml
dialer/package/contents/ui/Dialer/History.qml
+1
-2
dialer/package/contents/ui/Dialer/HistoryDelegate.qml
dialer/package/contents/ui/Dialer/HistoryDelegate.qml
+1
-1
dialer/package/contents/ui/main.qml
dialer/package/contents/ui/main.qml
+3
-0
dialer/src/call-manager.cpp
dialer/src/call-manager.cpp
+1
-1
dialer/src/dialerutils.cpp
dialer/src/dialerutils.cpp
+9
-0
dialer/src/dialerutils.h
dialer/src/dialerutils.h
+3
-0
No files found.
dialer/package/contents/ui/Dialer/History.qml
View file @
5eefb274
...
@@ -26,7 +26,6 @@ import org.kde.plasma.extras 2.0 as PlasmaExtras
...
@@ -26,7 +26,6 @@ import org.kde.plasma.extras 2.0 as PlasmaExtras
Item
{
Item
{
function
secondsToTimeString
(
seconds
)
{
function
secondsToTimeString
(
seconds
)
{
seconds
=
Math
.
floor
(
seconds
/
1000
)
var
h
=
Math
.
floor
(
seconds
/
3600
);
var
h
=
Math
.
floor
(
seconds
/
3600
);
var
m
=
Math
.
floor
((
seconds
-
(
h
*
3600
))
/
60
);
var
m
=
Math
.
floor
((
seconds
-
(
h
*
3600
))
/
60
);
var
s
=
seconds
-
h
*
3600
-
m
*
60
;
var
s
=
seconds
-
h
*
3600
-
m
*
60
;
...
...
dialer/package/contents/ui/Dialer/HistoryDelegate.qml
View file @
5eefb274
...
@@ -102,7 +102,7 @@ Item {
...
@@ -102,7 +102,7 @@ Item {
text
:
"
Name (todo)
"
text
:
"
Name (todo)
"
}
}
PlasmaComponents.Label
{
PlasmaComponents.Label
{
text
:
i18n
(
"
Number: %1
"
,
model
.
number
)
text
:
model
.
number
Layout.fillWidth
:
true
Layout.fillWidth
:
true
}
}
}
}
...
...
dialer/package/contents/ui/main.qml
View file @
5eefb274
...
@@ -47,6 +47,9 @@ ApplicationWindow {
...
@@ -47,6 +47,9 @@ ApplicationWindow {
onMissedCallsActionTriggered
:
{
onMissedCallsActionTriggered
:
{
root
.
visible
=
true
;
root
.
visible
=
true
;
}
}
onCallEnded
:
{
insertCallInHistory
(
callContactNumber
,
callDuration
,
incomingCall
?
1
:
2
);
}
}
}
onVisibleChanged
:
{
onVisibleChanged
:
{
...
...
dialer/src/call-manager.cpp
View file @
5eefb274
...
@@ -56,6 +56,7 @@ CallManager::CallManager(const Tp::CallChannelPtr &callChannel, DialerUtils *dia
...
@@ -56,6 +56,7 @@ CallManager::CallManager(const Tp::CallChannelPtr &callChannel, DialerUtils *dia
connect
(
d
->
callChannel
.
data
(),
&
Tp
::
CallChannel
::
invalidated
,
this
,
[
=
]()
{
connect
(
d
->
callChannel
.
data
(),
&
Tp
::
CallChannel
::
invalidated
,
this
,
[
=
]()
{
qDebug
()
<<
"Channel invalidated"
;
qDebug
()
<<
"Channel invalidated"
;
d
->
dialerUtils
->
setCallState
(
"idle"
);
d
->
dialerUtils
->
setCallState
(
"idle"
);
d
->
dialerUtils
->
emitCallEnded
();
});
});
d
->
ringingNotification
=
nullptr
;
d
->
ringingNotification
=
nullptr
;
...
@@ -197,7 +198,6 @@ void CallManager::onCallStateChanged(Tp::CallState state)
...
@@ -197,7 +198,6 @@ void CallManager::onCallStateChanged(Tp::CallState state)
d
->
callTimer
->
stop
();
d
->
callTimer
->
stop
();
d
->
callTimer
->
deleteLater
();
d
->
callTimer
->
deleteLater
();
d
->
callTimer
=
nullptr
;
d
->
callTimer
=
nullptr
;
d
->
dialerUtils
->
setCallDuration
(
0
);
}
}
//if we requested the call, make sure we have a window to show the error (if any)
//if we requested the call, make sure we have a window to show the error (if any)
// if (d->callChannel->isRequested()) {
// if (d->callChannel->isRequested()) {
...
...
dialer/src/dialerutils.cpp
View file @
5eefb274
...
@@ -122,6 +122,15 @@ void DialerUtils::setCallContactNumber(const QString &contactNumber)
...
@@ -122,6 +122,15 @@ void DialerUtils::setCallContactNumber(const QString &contactNumber)
}
}
}
}
void
DialerUtils
::
emitCallEnded
()
{
qDebug
()
<<
"Call ended:"
<<
m_callContactNumber
<<
m_callDuration
;
Q_EMIT
callEnded
(
m_callContactNumber
,
m_callDuration
,
true
);
m_callDuration
=
0
;
m_callContactNumber
=
QString
();
m_callContactAlias
=
QString
();
}
void
DialerUtils
::
resetMissedCalls
()
void
DialerUtils
::
resetMissedCalls
()
{
{
m_missedCalls
=
0
;
m_missedCalls
=
0
;
...
...
dialer/src/dialerutils.h
View file @
5eefb274
...
@@ -50,6 +50,8 @@ public:
...
@@ -50,6 +50,8 @@ public:
QString
callContactNumber
()
const
;
QString
callContactNumber
()
const
;
void
setCallContactNumber
(
const
QString
&
contactNumber
);
void
setCallContactNumber
(
const
QString
&
contactNumber
);
void
emitCallEnded
();
Q_INVOKABLE
void
resetMissedCalls
();
Q_INVOKABLE
void
resetMissedCalls
();
Q_INVOKABLE
void
dial
(
const
QString
&
number
);
Q_INVOKABLE
void
dial
(
const
QString
&
number
);
...
@@ -62,6 +64,7 @@ Q_SIGNALS:
...
@@ -62,6 +64,7 @@ Q_SIGNALS:
void
acceptCall
();
void
acceptCall
();
void
rejectCall
();
void
rejectCall
();
void
hangUp
();
void
hangUp
();
void
callEnded
(
const
QString
&
callContactNumber
,
uint
callDuration
,
bool
incomingCall
);
private:
private:
QPointer
<
KNotification
>
m_callsNotification
;
QPointer
<
KNotification
>
m_callsNotification
;
...
...
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