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
=== modified file 'src/qml/HistoryPage/HistoryPage.qml'
--- src/qml/HistoryPage/HistoryPage.qml 2015-05-15 19:16:36 +0000
+++ src/qml/HistoryPage/HistoryPage.qml 2015-05-15 19:16:36 +0000
@@ -35,6 +35,7 @@
35 property bool fullView: true35 property bool fullView: true
36 property alias currentIndex: historyList.currentIndex36 property alias currentIndex: historyList.currentIndex
37 property alias selectionMode: historyList.isInSelectionMode37 property alias selectionMode: historyList.isInSelectionMode
38 readonly property bool mostCalledView: (head.sections.selectedIndex == 2)
3839
39 function activateCurrentIndex() {40 function activateCurrentIndex() {
40 if (!fullView && historyList.currentItem) {41 if (!fullView && historyList.currentItem) {
@@ -46,7 +47,9 @@
46 active: false47 active: false
47 flickable: null48 flickable: null
4849
49 head.sections.model: [ i18n.ctr("All Calls", "All"), i18n.tr("Missed") ]50 head.sections.model: [ i18n.ctr("All Calls", "All"),
51 i18n.tr("Missed"),
52 i18n.tr("Frequently Called") ]
5053
51 Rectangle {54 Rectangle {
52 anchors.fill: parent55 anchors.fill: parent
@@ -117,8 +120,10 @@
117 if (pageStackNormalMode.depth > 1) {120 if (pageStackNormalMode.depth > 1) {
118 if (head.sections.selectedIndex == 0) {121 if (head.sections.selectedIndex == 0) {
119 historyEventModel.filter = emptyFilter;122 historyEventModel.filter = emptyFilter;
123 } else if (head.sections.selectedIndex == 1) {
124 historyEventModel.filter = missedFilter;
120 } else {125 } else {
121 historyEventModel.filter = missedFilter;126 historyEventModel.filter = frequentlyCalledFilter;
122 }127 }
123 }128 }
124 }129 }
@@ -134,9 +139,27 @@
134 filterValue: true139 filterValue: true
135 }140 }
136141
142 HistoryIntersectionFilter {
143 id: frequentlyCalledFilter
144 filters: [
145 HistoryFilter {
146 filterProperty: "senderId"
147 filterValue: "self"
148 },
149 HistoryFilter {
150 filterProperty: "timestamp"
151 filterValue: {
152 var currentDate = new Date().getTime();
153 return new Date(currentDate - (2592000000)) // 30 days ago
154 }
155 matchFlags: HistoryFilter.MatchGreaterOrEqual
156 }
157 ]
158 }
159
137 HistoryGroupedEventsModel {160 HistoryGroupedEventsModel {
138 id: historyEventModel161 id: historyEventModel
139 groupingProperties: ["participants", "date"]162 groupingProperties: mostCalledView ? ["participants"] : ["participants", "date"]
140 type: HistoryThreadModel.EventTypeVoice163 type: HistoryThreadModel.EventTypeVoice
141 sort: HistorySort {164 sort: HistorySort {
142 sortField: "timestamp"165 sortField: "timestamp"
@@ -244,7 +267,7 @@
244 }267 }
245 }268 }
246269
247 section.property: "date"270 section.property: mostCalledView ? "" : "date"
248 section.delegate: fullView ? sectionComponent : null271 section.delegate: fullView ? sectionComponent : null
249272
250 listDelegate: delegateComponent273 listDelegate: delegateComponent

Subscribers

People subscribed via source and target branches