Merge lp:~mzanetti/reminders-app/listitemwithactions into lp:reminders-app

Proposed by Michael Zanetti
Status: Merged
Approved by: Riccardo Padovani
Approved revision: 345
Merged at revision: 343
Proposed branch: lp:~mzanetti/reminders-app/listitemwithactions
Merge into: lp:reminders-app
Diff against target: 758 lines (+580/-45)
10 files modified
src/app/qml/components/ListItemWithActions.qml (+455/-0)
src/app/qml/components/ListItemWithActionsCheckBox.qml (+25/-0)
src/app/qml/components/NotesDelegate.qml (+39/-4)
src/app/qml/components/RemindersDelegate.qml (+30/-37)
src/app/qml/components/ubuntu_component_store.json (+6/-0)
src/app/qml/reminders.qml (+3/-1)
src/app/qml/ui/NotesPage.qml (+17/-1)
src/app/qml/ui/RemindersPage.qml (+2/-1)
src/libqtevernote/note.cpp (+1/-1)
src/libqtevernote/resourceimageprovider.cpp (+2/-0)
To merge this branch: bzr merge lp:~mzanetti/reminders-app/listitemwithactions
Reviewer Review Type Date Requested Status
Riccardo Padovani Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+249585@code.launchpad.net

Commit message

use the awesome ListItemWithActions from the Ubuntu Component Store

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
340. By Michael Zanetti

also allow editing tags from the listitemmenu

341. By Michael Zanetti

also use the listitemwithactions for the reminders page

342. By Michael Zanetti

drop commented code

343. By Michael Zanetti

allow editing the reminder from the listitem actions

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
344. By Michael Zanetti

fix reminders delegate background color

345. By Michael Zanetti

fix a bug in ListItemWithActions

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Awesome, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'src/app/qml/components/ListItemWithActions.qml'
--- src/app/qml/components/ListItemWithActions.qml 1970-01-01 00:00:00 +0000
+++ src/app/qml/components/ListItemWithActions.qml 2015-02-13 01:03:14 +0000
@@ -0,0 +1,455 @@
1/*
2 * Copyright (C) 2012-2014 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.2
18import Ubuntu.Components 1.1
19
20Item {
21 id: root
22
23 property Action leftSideAction: null
24 property list<Action> rightSideActions
25 property double defaultHeight: units.gu(8)
26 property bool locked: false
27 property Action activeAction: null
28 property var activeItem: null
29 property bool triggerActionOnMouseRelease: false
30 property color color: Theme.palette.normal.background
31 property color selectedColor: "#E6E6E6"
32 property bool selected: false
33 property bool selectionMode: false
34 property alias internalAnchors: mainContents.anchors
35 default property alias contents: mainContents.children
36
37 readonly property double actionWidth: units.gu(4)
38 readonly property double leftActionWidth: units.gu(10)
39 readonly property double actionThreshold: actionWidth * 0.4
40 readonly property double threshold: 0.4
41 readonly property string swipeState: main.x == 0 ? "Normal" : main.x > 0 ? "LeftToRight" : "RightToLeft"
42 readonly property alias swipping: mainItemMoving.running
43 readonly property bool _showActions: mouseArea.pressed || swipeState != "Normal" || swipping
44
45 /* internal */
46 property var _visibleRightSideActions: filterVisibleActions(rightSideActions)
47
48 signal itemClicked(var mouse)
49 signal itemPressAndHold(var mouse)
50
51 function returnToBoundsRTL(direction)
52 {
53 var actionFullWidth = actionWidth + units.gu(2)
54
55 // go back to normal state if swipping reverse
56 if (direction === "LTR") {
57 updatePosition(0)
58 return
59 } else if (!triggerActionOnMouseRelease) {
60 updatePosition(-rightActionsView.width + units.gu(2))
61 return
62 }
63
64 var xOffset = Math.abs(main.x)
65 var index = Math.min(Math.floor(xOffset / actionFullWidth), _visibleRightSideActions.length)
66 var newX = 0
67 if (index === _visibleRightSideActions.length) {
68 newX = -(rightActionsView.width - units.gu(2))
69 } else if (index >= 1) {
70 newX = -(actionFullWidth * index)
71 }
72 updatePosition(newX)
73 }
74
75 function returnToBoundsLTR(direction)
76 {
77 var finalX = leftActionWidth
78 if ((direction === "RTL") || (main.x <= (finalX * root.threshold)))
79 finalX = 0
80 updatePosition(finalX)
81 }
82
83 function returnToBounds(direction)
84 {
85 if (main.x < 0) {
86 returnToBoundsRTL(direction)
87 } else if (main.x > 0) {
88 returnToBoundsLTR(direction)
89 } else {
90 updatePosition(0)
91 }
92 }
93
94 function contains(item, point, marginX)
95 {
96 var itemStartX = item.x - marginX
97 var itemEndX = item.x + item.width + marginX
98 return (point.x >= itemStartX) && (point.x <= itemEndX) &&
99 (point.y >= item.y) && (point.y <= (item.y + item.height));
100 }
101
102 function getActionAt(point)
103 {
104 if (contains(leftActionView, point, 0)) {
105 return leftSideAction
106 } else if (contains(rightActionsView, point, 0)) {
107 var newPoint = root.mapToItem(rightActionsView, point.x, point.y)
108 for (var i = 0; i < rightActionsRepeater.count; i++) {
109 var child = rightActionsRepeater.itemAt(i)
110 if (contains(child, newPoint, units.gu(1))) {
111 return i
112 }
113 }
114 }
115 return -1
116 }
117
118 function updateActiveAction()
119 {
120 if (triggerActionOnMouseRelease &&
121 (main.x <= -(root.actionWidth + units.gu(2))) &&
122 (main.x > -(rightActionsView.width - units.gu(2)))) {
123 var actionFullWidth = actionWidth + units.gu(2)
124 var xOffset = Math.abs(main.x)
125 var index = Math.min(Math.floor(xOffset / actionFullWidth), _visibleRightSideActions.length)
126 index = index - 1
127 if (index > -1) {
128 root.activeItem = rightActionsRepeater.itemAt(index)
129 root.activeAction = root._visibleRightSideActions[index]
130 }
131 } else {
132 root.activeAction = null
133 }
134 }
135
136 function resetSwipe()
137 {
138 updatePosition(0)
139 }
140
141 function filterVisibleActions(actions)
142 {
143 var visibleActions = []
144 for(var i = 0; i < actions.length; i++) {
145 var action = actions[i]
146 if (action.visible) {
147 visibleActions.push(action)
148 }
149 }
150 return visibleActions
151 }
152
153 function updatePosition(pos)
154 {
155 if (!root.triggerActionOnMouseRelease && (pos !== 0)) {
156 mouseArea.state = pos > 0 ? "RightToLeft" : "LeftToRight"
157 } else {
158 mouseArea.state = ""
159 }
160 main.x = pos
161 }
162
163 states: [
164 State {
165 name: "select"
166 when: selectionMode || selected
167 PropertyChanges {
168 target: selectionIcon
169 source: Qt.resolvedUrl("ListItemWithActionsCheckBox.qml")
170 anchors.leftMargin: units.gu(2)
171 }
172 PropertyChanges {
173 target: root
174 locked: true
175 }
176 PropertyChanges {
177 target: main
178 x: 0
179 }
180 }
181 ]
182
183 height: defaultHeight
184 clip: height !== defaultHeight
185
186 Rectangle {
187 id: leftActionView
188
189 anchors {
190 top: parent.top
191 bottom: parent.bottom
192 right: main.left
193 }
194 width: root.leftActionWidth + actionThreshold
195 visible: leftSideAction
196 color: UbuntuColors.red
197
198 Icon {
199 anchors {
200 centerIn: parent
201 horizontalCenterOffset: actionThreshold / 2
202 }
203 name: leftSideAction && _showActions ? leftSideAction.iconName : ""
204 color: Theme.palette.selected.field
205 height: units.gu(3)
206 width: units.gu(3)
207 }
208 }
209
210 Rectangle {
211 id: rightActionsView
212
213 anchors {
214 top: main.top
215 left: main.right
216 bottom: main.bottom
217 }
218 visible: _visibleRightSideActions.length > 0
219 width: rightActionsRepeater.count > 0 ? rightActionsRepeater.count * (root.actionWidth + units.gu(2)) + root.actionThreshold + units.gu(2) : 0
220 color: "white"
221 Row {
222 anchors{
223 top: parent.top
224 left: parent.left
225 leftMargin: units.gu(2)
226 right: parent.right
227 rightMargin: units.gu(2)
228 bottom: parent.bottom
229 }
230 spacing: units.gu(2)
231 Repeater {
232 id: rightActionsRepeater
233
234 model: _showActions ? _visibleRightSideActions : []
235 Item {
236 property alias image: img
237
238 height: rightActionsView.height
239 width: root.actionWidth
240
241 Icon {
242 id: img
243
244 anchors.centerIn: parent
245 width: units.gu(3)
246 height: units.gu(3)
247 name: modelData.iconName
248 source: modelData.iconSource
249 color: root.activeAction === modelData ? UbuntuColors.lightAubergine : UbuntuColors.lightGrey
250 }
251 }
252 }
253 }
254 }
255
256
257 Rectangle {
258 id: main
259 objectName: "mainItem"
260
261 anchors {
262 top: parent.top
263 bottom: parent.bottom
264 }
265
266 width: parent.width
267 color: root.selected ? root.selectedColor : root.color
268
269 Loader {
270 id: selectionIcon
271
272 anchors {
273 left: main.left
274 verticalCenter: main.verticalCenter
275 }
276 width: (status === Loader.Ready) ? item.implicitWidth : 0
277 visible: (status === Loader.Ready) && (item.width === item.implicitWidth)
278 Behavior on width {
279 NumberAnimation {
280 duration: UbuntuAnimation.SnapDuration
281 }
282 }
283 }
284
285
286 Item {
287 id: mainContents
288
289 anchors {
290 left: selectionIcon.right
291// leftMargin: units.gu(2)
292 top: parent.top
293// topMargin: units.gu(1)
294 right: parent.right
295// rightMargin: units.gu(2)
296 bottom: parent.bottom
297// bottomMargin: units.gu(1)
298 }
299 }
300
301 Behavior on x {
302 UbuntuNumberAnimation {
303 id: mainItemMoving
304
305 easing.type: Easing.OutElastic
306 duration: UbuntuAnimation.SlowDuration
307 }
308 }
309 Behavior on color {
310 ColorAnimation {}
311 }
312 }
313
314 SequentialAnimation {
315 id: triggerAction
316
317 property var currentItem: root.activeItem ? root.activeItem.image : null
318
319 running: false
320 ParallelAnimation {
321 UbuntuNumberAnimation {
322 target: triggerAction.currentItem
323 property: "opacity"
324 from: 1.0
325 to: 0.0
326 duration: UbuntuAnimation.SlowDuration
327 easing {type: Easing.InOutBack; }
328 }
329 UbuntuNumberAnimation {
330 target: triggerAction.currentItem
331 properties: "width, height"
332 from: units.gu(3)
333 to: root.actionWidth
334 duration: UbuntuAnimation.SlowDuration
335 easing {type: Easing.InOutBack; }
336 }
337 }
338 PropertyAction {
339 target: triggerAction.currentItem
340 properties: "width, height"
341 value: units.gu(3)
342 }
343 PropertyAction {
344 target: triggerAction.currentItem
345 properties: "opacity"
346 value: 1.0
347 }
348 ScriptAction {
349 script: {
350 root.activeAction.triggered(root)
351 root.activeAction = null;
352 mouseArea.state = ""
353 }
354 }
355 PauseAnimation {
356 duration: 500
357 }
358 UbuntuNumberAnimation {
359 target: main
360 property: "x"
361 to: 0
362 }
363 }
364
365 MouseArea {
366 id: mouseArea
367
368 property bool locked: root.locked || ((root.leftSideAction === null) && (root._visibleRightSideActions.count === 0))
369 property bool manual: false
370 property string direction: "None"
371 property real lastX: -1
372
373 anchors.fill: parent
374 drag {
375 target: locked ? null : main
376 axis: Drag.XAxis
377 minimumX: rightActionsView.visible ? -(rightActionsView.width) : 0
378 maximumX: leftActionView.visible ? leftActionView.width : 0
379 threshold: root.actionThreshold
380 }
381
382 states: [
383 State {
384 name: "LeftToRight"
385 PropertyChanges {
386 target: mouseArea
387 drag.maximumX: 0
388 }
389 },
390 State {
391 name: "RightToLeft"
392 PropertyChanges {
393 target: mouseArea
394 drag.minimumX: 0
395 }
396 }
397 ]
398
399 onMouseXChanged: {
400 var offset = (lastX - mouseX)
401 if (Math.abs(offset) <= root.actionThreshold) {
402 return
403 }
404 lastX = mouseX
405 direction = offset > 0 ? "RTL" : "LTR";
406 }
407
408 onPressed: {
409 lastX = mouse.x
410 }
411
412 onReleased: {
413 if (root.triggerActionOnMouseRelease && root.activeAction) {
414 triggerAction.start()
415 } else {
416 root.returnToBounds(direction)
417 root.activeAction = null
418 }
419 lastX = -1
420 direction = "None"
421 }
422 onClicked: {
423 if (main.x === 0) {
424 root.itemClicked(mouse)
425 } else if (main.x > 0) {
426 var action = getActionAt(Qt.point(mouse.x, mouse.y))
427 if (action && action !== -1) {
428 action.triggered(root)
429 }
430 } else {
431 var actionIndex = getActionAt(Qt.point(mouse.x, mouse.y))
432 if (actionIndex !== -1) {
433 root.activeItem = rightActionsRepeater.itemAt(actionIndex)
434 root.activeAction = root._visibleRightSideActions[actionIndex]
435 triggerAction.start()
436 return
437 }
438 }
439 root.resetSwipe()
440 }
441
442 onPositionChanged: {
443 if (mouseArea.pressed) {
444 updateActiveAction()
445 }
446 }
447 onPressAndHold: {
448 if (main.x === 0) {
449 root.itemPressAndHold(mouse)
450 }
451 }
452 z: -1
453 }
454}
455
0456
=== added file 'src/app/qml/components/ListItemWithActionsCheckBox.qml'
--- src/app/qml/components/ListItemWithActionsCheckBox.qml 1970-01-01 00:00:00 +0000
+++ src/app/qml/components/ListItemWithActionsCheckBox.qml 2015-02-13 01:03:14 +0000
@@ -0,0 +1,25 @@
1/*
2 * Copyright (C) 2012-2014 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.2
18import Ubuntu.Components 1.1
19
20CheckBox {
21 checked: root.selected
22 width: implicitWidth
23 // disable item mouse area to avoid conflicts with parent mouse area
24 __mouseArea.enabled: false
25}
026
=== modified file 'src/app/qml/components/NotesDelegate.qml'
--- src/app/qml/components/NotesDelegate.qml 2014-12-16 21:01:28 +0000
+++ src/app/qml/components/NotesDelegate.qml 2015-02-13 01:03:14 +0000
@@ -22,9 +22,10 @@
22import Ubuntu.Components.ListItems 1.022import Ubuntu.Components.ListItems 1.0
23import Evernote 0.123import Evernote 0.1
2424
25Empty {25ListItemWithActions {
26 id: root26 id: root
27 height: units.gu(12)27 height: units.gu(12)
28 width: parent.width
2829
29 property string title30 property string title
30 property date creationDate31 property date creationDate
@@ -39,10 +40,44 @@
39 property bool conflicting40 property bool conflicting
40 property string notebookColor41 property string notebookColor
4142
42 showDivider: false;43 signal deleteNote()
4344 signal editNote()
45 signal editReminder()
46 signal editTags()
47
48 leftSideAction: Action {
49 iconName: "delete"
50 text: i18n.tr("Delete")
51 onTriggered: {
52 root.deleteNote()
53 }
54 }
55
56 rightSideActions: [
57 Action {
58 iconName: "alarm-clock"
59 text: i18n.tr("Reminder")
60 onTriggered: {
61 root.editReminder();
62 }
63 },
64 Action {
65 iconSource: "../images/tags.svg"
66 text: i18n.tr("Tags")
67 onTriggered: {
68 root.editTags();
69 }
70 },
71 Action {
72 iconName: "edit"
73 text: i18n.tr("Edit")
74 onTriggered: {
75 root.editNote();
76 }
77 }
78 ]
44 ColumnLayout {79 ColumnLayout {
45 anchors { fill: parent; leftMargin: units.gu(1); rightMargin: units.gu(1) }80 anchors { fill: parent }
46 spacing: 081 spacing: 0
4782
48 Rectangle {83 Rectangle {
4984
=== modified file 'src/app/qml/components/RemindersDelegate.qml'
--- src/app/qml/components/RemindersDelegate.qml 2014-12-14 21:28:11 +0000
+++ src/app/qml/components/RemindersDelegate.qml 2015-02-13 01:03:14 +0000
@@ -24,54 +24,47 @@
24import Ubuntu.Components.Pickers 1.024import Ubuntu.Components.Pickers 1.0
25import Evernote 0.125import Evernote 0.1
2626
27Base {27ListItemWithActions {
28 id: root28 id: root
29 height: units.gu(10)29 height: units.gu(10)
30 clip: true30 clip: true
31 removable: true31 color: "transparent"
32
33 backgroundIndicator: Row {
34 x: root.__contents.x > 0 ? root.__contents.x - width : 0
35 width: childrenRect.width
36 anchors.verticalCenter: parent.verticalCenter
37 spacing: units.gu(1)
38
39 Icon {
40 height: units.gu(3)
41 width: height
42 anchors.verticalCenter: parent.verticalCenter
43 name: root.note.reminderDone ? "clear" : "select"
44 }
45
46 Label {
47 id: confirmRemovalDialog
48 anchors.verticalCenter: parent.verticalCenter
49 text: root.note.reminderDone ? i18n.tr("Clear reminder") : i18n.tr("Mark as done")
50 }
51 }
5232
53 property var note33 property var note
5434
35 leftSideAction: Action {
36 text: i18n.tr("Clear reminder")
37 iconName: "clear"
38 onTriggered: {
39 note.reminder = false;
40 NotesStore.saveNote(note.guid)
41 }
42 }
43
44 rightSideActions: [
45 Action {
46 iconSource: root.note.reminderDone ? "image://theme/select" : "../images/unchecked.svg"
47 text: root.note.reminderDone ? i18n.tr("Mark as undone") : i18n.tr("Mark as done")
48 onTriggered: {
49 note.reminderDone = !root.note.reminderDone;
50 NotesStore.saveNote(note.guid)
51 }
52 },
53 Action {
54 iconName: "alarm-clock"
55 text: i18n.tr("Edit reminder")
56 onTriggered: {
57 pageStack.push(Qt.resolvedUrl("../ui/SetReminderPage.qml"), { note: root.note });
58 }
59 }
60 ]
61
55 Behavior on height {62 Behavior on height {
56 UbuntuNumberAnimation {}63 UbuntuNumberAnimation {}
57 }64 }
5865
59 onItemRemoved: {
60 // Revert "removal"
61 root.cancelItemRemoval();
62 root.height = units.gu(10)
63 print("marking reminder as", !note.reminderDone, " done for note", note.title);
64 if (!note.reminderDone) {
65 note.reminderDone = true;
66 } else {
67 note.reminder = false;
68 }
69
70 NotesStore.saveNote(note.guid)
71 }
72
73 RowLayout {66 RowLayout {
74 anchors { fill: parent; topMargin: units.gu(1); bottomMargin: units.gu(1) }67 anchors { fill: parent; margins: units.gu(1) }
75 spacing: units.gu(1)68 spacing: units.gu(1)
7669
77 UbuntuShape {70 UbuntuShape {
7871
=== added file 'src/app/qml/components/ubuntu_component_store.json'
--- src/app/qml/components/ubuntu_component_store.json 1970-01-01 00:00:00 +0000
+++ src/app/qml/components/ubuntu_component_store.json 2015-02-13 01:03:14 +0000
@@ -0,0 +1,6 @@
1{
2 "name": "ListItemWithActions",
3 "description": "This widget provides an updated listitem which is what the core apps currently use.",
4 "version": "1.0",
5 "documentation_url": "http://ubuntu-component-store.readthedocs.org/en/latest/_components/listitemwithactions.html"
6}
07
=== modified file 'src/app/qml/reminders.qml'
--- src/app/qml/reminders.qml 2015-02-12 14:02:35 +0000
+++ src/app/qml/reminders.qml 2015-02-13 01:03:14 +0000
@@ -128,7 +128,9 @@
128128
129 function switchToEditMode(note) {129 function switchToEditMode(note) {
130 if (root.narrowMode) {130 if (root.narrowMode) {
131 pagestack.pop();131 if (pagestack.depth > 1) {
132 pagestack.pop();
133 }
132 var component = Qt.createComponent(Qt.resolvedUrl("ui/EditNotePage.qml"));134 var component = Qt.createComponent(Qt.resolvedUrl("ui/EditNotePage.qml"));
133 var page = component.createObject();135 var page = component.createObject();
134 page.exitEditMode.connect(function() {Qt.inputMethod.hide(); pagestack.pop()});136 page.exitEditMode.connect(function() {Qt.inputMethod.hide(); pagestack.pop()});
135137
=== modified file 'src/app/qml/ui/NotesPage.qml'
--- src/app/qml/ui/NotesPage.qml 2014-12-16 21:01:28 +0000
+++ src/app/qml/ui/NotesPage.qml 2015-02-13 01:03:14 +0000
@@ -20,6 +20,7 @@
20import QtQuick.Layouts 1.020import QtQuick.Layouts 1.0
21import Ubuntu.Components 1.121import Ubuntu.Components 1.1
22import Ubuntu.Components.ListItems 1.022import Ubuntu.Components.ListItems 1.0
23import Ubuntu.Components.Popups 1.0
23import Evernote 0.124import Evernote 0.1
24import "../components"25import "../components"
2526
@@ -148,6 +149,7 @@
148 creationDate: model.created149 creationDate: model.created
149 changedDate: model.updated150 changedDate: model.updated
150 content: model.tagline151 content: model.tagline
152 triggerActionOnMouseRelease: true
151 tags: {153 tags: {
152 var tags = new Array();154 var tags = new Array();
153 for (var i = 0; i < model.tagGuids.length; i++) {155 for (var i = 0; i < model.tagGuids.length; i++) {
@@ -163,11 +165,25 @@
163 syncError: model.syncError165 syncError: model.syncError
164 conflicting: model.conflicting166 conflicting: model.conflicting
165167
166 onClicked: {168 onItemClicked: {
167 if (!model.conflicting) {169 if (!model.conflicting) {
168 root.selectedNote = NotesStore.note(guid);170 root.selectedNote = NotesStore.note(guid);
169 }171 }
170 }172 }
173
174 onDeleteNote: {
175 NotesStore.deleteNote(model.guid)
176 }
177 onEditNote: {
178 root.editNote(NotesStore.note(model.guid));
179 }
180 onEditReminder: {
181 pageStack.push(Qt.resolvedUrl("SetReminderPage.qml"), { note: NotesStore.note(model.guid) });
182 }
183 onEditTags: {
184 PopupUtils.open(Qt.resolvedUrl("../components/EditTagsDialog.qml"), root,
185 { note: NotesStore.note(model.guid), pageHeight: root.height });
186 }
171 }187 }
172188
173 section.criteria: ViewSection.FullString189 section.criteria: ViewSection.FullString
174190
=== modified file 'src/app/qml/ui/RemindersPage.qml'
--- src/app/qml/ui/RemindersPage.qml 2014-12-14 22:31:00 +0000
+++ src/app/qml/ui/RemindersPage.qml 2015-02-13 01:03:14 +0000
@@ -68,8 +68,9 @@
68 delegate: RemindersDelegate {68 delegate: RemindersDelegate {
69 width: remindersListView.width69 width: remindersListView.width
70 note: notes.note(guid)70 note: notes.note(guid)
71 triggerActionOnMouseRelease: true
7172
72 onClicked: {73 onItemClicked: {
73 root.selectedNote = NotesStore.note(guid);74 root.selectedNote = NotesStore.note(guid);
74 }75 }
75 }76 }
7677
=== modified file 'src/libqtevernote/note.cpp'
--- src/libqtevernote/note.cpp 2014-12-16 21:01:28 +0000
+++ src/libqtevernote/note.cpp 2015-02-13 01:03:14 +0000
@@ -35,8 +35,8 @@
35Note::Note(const QString &guid, quint32 updateSequenceNumber, QObject *parent) :35Note::Note(const QString &guid, quint32 updateSequenceNumber, QObject *parent) :
36 QObject(parent),36 QObject(parent),
37 m_isSearchResult(false),37 m_isSearchResult(false),
38 m_deleted(false),
38 m_updateSequenceNumber(updateSequenceNumber),39 m_updateSequenceNumber(updateSequenceNumber),
39 m_deleted(false),
40 m_loading(false),40 m_loading(false),
41 m_loaded(false),41 m_loaded(false),
42 m_syncError(false),42 m_syncError(false),
4343
=== modified file 'src/libqtevernote/resourceimageprovider.cpp'
--- src/libqtevernote/resourceimageprovider.cpp 2014-10-23 21:27:46 +0000
+++ src/libqtevernote/resourceimageprovider.cpp 2015-02-13 01:03:14 +0000
@@ -26,7 +26,9 @@
2626
27 QImage image;27 QImage image;
28 if (mediaType.startsWith("image")) {28 if (mediaType.startsWith("image")) {
29 qDebug() << "image requested" << NotesStore::instance()->note(noteGuid)->resource(resourceHash);
29 image = QImage::fromData(NotesStore::instance()->note(noteGuid)->resource(resourceHash)->imageData(requestedSize));30 image = QImage::fromData(NotesStore::instance()->note(noteGuid)->resource(resourceHash)->imageData(requestedSize));
31 qDebug() << "done...";
30 } else if (mediaType.startsWith("audio")) {32 } else if (mediaType.startsWith("audio")) {
31 image.load("/usr/share/icons/ubuntu-mobile/actions/scalable/media-playback-start.svg");33 image.load("/usr/share/icons/ubuntu-mobile/actions/scalable/media-playback-start.svg");
32 } else {34 } else {

Subscribers

People subscribed via source and target branches