Merge lp:~renatofilho/dialer-app/most-called into lp:dialer-app

Proposed by Renato Araujo Oliveira Filho
Status: Work in progress
Proposed branch: lp:~renatofilho/dialer-app/most-called
Merge into: lp:dialer-app
Prerequisite: lp:~renatofilho/dialer-app/non-expansion
Diff against target: 72 lines (+27/-4)
1 file modified
src/qml/HistoryPage/HistoryPage.qml (+27/-4)
To merge this branch: bzr merge lp:~renatofilho/dialer-app/most-called
Reviewer Review Type Date Requested Status
Ubuntu Phablet Team Pending
Review via email: mp+259279@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

413. By Renato Araujo Oliveira Filho

Initial implementation of MostCalled list

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/qml/HistoryPage/HistoryPage.qml'
2--- src/qml/HistoryPage/HistoryPage.qml 2015-05-15 19:16:36 +0000
3+++ src/qml/HistoryPage/HistoryPage.qml 2015-05-15 19:16:36 +0000
4@@ -35,6 +35,7 @@
5 property bool fullView: true
6 property alias currentIndex: historyList.currentIndex
7 property alias selectionMode: historyList.isInSelectionMode
8+ readonly property bool mostCalledView: (head.sections.selectedIndex == 2)
9
10 function activateCurrentIndex() {
11 if (!fullView && historyList.currentItem) {
12@@ -46,7 +47,9 @@
13 active: false
14 flickable: null
15
16- head.sections.model: [ i18n.ctr("All Calls", "All"), i18n.tr("Missed") ]
17+ head.sections.model: [ i18n.ctr("All Calls", "All"),
18+ i18n.tr("Missed"),
19+ i18n.tr("Frequently Called") ]
20
21 Rectangle {
22 anchors.fill: parent
23@@ -117,8 +120,10 @@
24 if (pageStackNormalMode.depth > 1) {
25 if (head.sections.selectedIndex == 0) {
26 historyEventModel.filter = emptyFilter;
27+ } else if (head.sections.selectedIndex == 1) {
28+ historyEventModel.filter = missedFilter;
29 } else {
30- historyEventModel.filter = missedFilter;
31+ historyEventModel.filter = frequentlyCalledFilter;
32 }
33 }
34 }
35@@ -134,9 +139,27 @@
36 filterValue: true
37 }
38
39+ HistoryIntersectionFilter {
40+ id: frequentlyCalledFilter
41+ filters: [
42+ HistoryFilter {
43+ filterProperty: "senderId"
44+ filterValue: "self"
45+ },
46+ HistoryFilter {
47+ filterProperty: "timestamp"
48+ filterValue: {
49+ var currentDate = new Date().getTime();
50+ return new Date(currentDate - (2592000000)) // 30 days ago
51+ }
52+ matchFlags: HistoryFilter.MatchGreaterOrEqual
53+ }
54+ ]
55+ }
56+
57 HistoryGroupedEventsModel {
58 id: historyEventModel
59- groupingProperties: ["participants", "date"]
60+ groupingProperties: mostCalledView ? ["participants"] : ["participants", "date"]
61 type: HistoryThreadModel.EventTypeVoice
62 sort: HistorySort {
63 sortField: "timestamp"
64@@ -244,7 +267,7 @@
65 }
66 }
67
68- section.property: "date"
69+ section.property: mostCalledView ? "" : "date"
70 section.delegate: fullView ? sectionComponent : null
71
72 listDelegate: delegateComponent

Subscribers

People subscribed via source and target branches