Merge lp:~mzanetti/reminders-app/save-on-inactive into lp:reminders-app

Proposed by Michael Zanetti
Status: Merged
Approved by: Riccardo Padovani
Approved revision: 442
Merged at revision: 445
Proposed branch: lp:~mzanetti/reminders-app/save-on-inactive
Merge into: lp:reminders-app
Diff against target: 36 lines (+19/-0)
1 file modified
src/app/qml/ui/EditNoteView.qml (+19/-0)
To merge this branch: bzr merge lp:~mzanetti/reminders-app/save-on-inactive
Reviewer Review Type Date Requested Status
Riccardo Padovani Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+260387@code.launchpad.net

Commit message

save the note when the app becomes inactive

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)
Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Tested both in tablet and phone mode, works as expected, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/qml/ui/EditNoteView.qml'
2--- src/app/qml/ui/EditNoteView.qml 2015-05-07 21:41:41 +0000
3+++ src/app/qml/ui/EditNoteView.qml 2015-05-27 21:58:39 +0000
4@@ -89,6 +89,17 @@
5 }
6 }
7
8+ Connections {
9+ target: Qt.application
10+ onActiveChanged: {
11+ print("active changed", root, root.note, active)
12+ if (root.note) {
13+ print("Saving note:", root.note.guid)
14+ root.saveNote()
15+ }
16+ }
17+ }
18+
19 Column {
20 anchors { left: parent.left; top: parent.top; right: parent.right; bottom: toolbox.top }
21
22@@ -211,6 +222,14 @@
23 textMargin: units.gu(1)
24 selectionColor: UbuntuColors.blue
25
26+ property int lastCursorPos: -1
27+ onCursorPositionChanged: {
28+ lastCursorPos = cursorPosition;
29+ }
30+ onTextChanged: {
31+ cursorPosition = lastCursorPos
32+ }
33+
34 // Due to various things updating when creating the view,
35 // we need to set the focus in the next event loop pass
36 // in order to have any effect.

Subscribers

People subscribed via source and target branches