Merge lp:~mzanetti/reminders-app/fix-sorting-dialog into lp:reminders-app

Proposed by Michael Zanetti
Status: Merged
Approved by: Alan Pope 🍺🐧🐱 πŸ¦„
Approved revision: 553
Merged at revision: 555
Proposed branch: lp:~mzanetti/reminders-app/fix-sorting-dialog
Merge into: lp:reminders-app
Diff against target: 98 lines (+30/-45)
2 files modified
src/app/qml/components/SortingDialog.qml (+27/-40)
src/app/qml/ui/NotesPage.qml (+3/-5)
To merge this branch: bzr merge lp:~mzanetti/reminders-app/fix-sorting-dialog
Reviewer Review Type Date Requested Status
Alan Pope 🍺🐧🐱 πŸ¦„ (community) Approve
Jenkins Bot continuous-integration Approve
Review via email: mp+293472@code.launchpad.net

Commit message

fix sorting dialog

To post a comment you must log in.
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Works a treat, thanks for the fix!

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/components/SortingDialog.qml'
2--- src/app/qml/components/SortingDialog.qml 2015-11-02 20:26:37 +0000
3+++ src/app/qml/components/SortingDialog.qml 2016-04-30 19:52:13 +0000
4@@ -2,46 +2,33 @@
5 import Ubuntu.Components 1.3
6 import Ubuntu.Components.Popups 1.3
7 import Ubuntu.Components.ListItems 1.3
8-import reminders 1.0
9-
10-Item {
11- id: root
12-
13- property int sortOrder
14-
15- signal accepted();
16-
17- Component.onCompleted: PopupUtils.open(dialogComponent, root, {sortOrder: root.sortOrder})
18-
19- Component {
20- id: dialogComponent
21- Dialog {
22- id: dialog
23- title: i18n.tr("Sort by")
24-
25- property alias sortOrder: optionSelector.selectedIndex
26-
27-
28- OptionSelector {
29- id: optionSelector
30- expanded: true
31- model: [
32- i18n.tr("Date created (newest first)"),
33- i18n.tr("Date created (oldest first)"),
34- i18n.tr("Date updated (newest first)"),
35- i18n.tr("Date updated (oldest first)"),
36- i18n.tr("Title (ascending)"),
37- i18n.tr("Title (descending)")
38- ]
39- delegate: OptionSelectorDelegate {
40- objectName: "sortingOption" + index
41- }
42- onDelegateClicked: {
43- root.sortOrder = index
44- root.accepted();
45- PopupUtils.close(dialog);
46- }
47- }
48+import Evernote 0.1
49+
50+Dialog {
51+ id: dialog
52+ title: i18n.tr("Sort by")
53+
54+ property alias sortOrder: optionSelector.selectedIndex
55+
56+ signal accepted(int sortOrder);
57+
58+ OptionSelector {
59+ id: optionSelector
60+ expanded: true
61+ model: [
62+ i18n.tr("Date created (newest first)"),
63+ i18n.tr("Date created (oldest first)"),
64+ i18n.tr("Date updated (newest first)"),
65+ i18n.tr("Date updated (oldest first)"),
66+ i18n.tr("Title (ascending)"),
67+ i18n.tr("Title (descending)")
68+ ]
69+ delegate: OptionSelectorDelegate {
70+ objectName: "sortingOption" + index
71+ }
72+ onDelegateClicked: {
73+ dialog.accepted(index);
74+ PopupUtils.close(dialog);
75 }
76 }
77 }
78
79=== modified file 'src/app/qml/ui/NotesPage.qml'
80--- src/app/qml/ui/NotesPage.qml 2015-11-02 20:26:37 +0000
81+++ src/app/qml/ui/NotesPage.qml 2016-04-30 19:52:13 +0000
82@@ -72,13 +72,11 @@
83 iconSource: "../images/sorting.svg"
84 text: i18n.tr("Sorting")
85 onTriggered: {
86- var popupComponent = Qt.createComponent(Qt.resolvedUrl("../components/SortingDialog.qml"));
87- var popup = popupComponent.createObject(root, {sortOrder: notes.sortOrder} )
88- popup.accepted.connect( function() {
89- notes.sortOrder = popup.sortOrder
90+ var popup = PopupUtils.open(Qt.resolvedUrl("../components/SortingDialog.qml"), root, {sortOrder: notes.sortOrder})
91+ popup.accepted.connect( function(sortOrder) {
92+ notes.sortOrder = sortOrder
93 popup.destroy();
94 })
95- popup.sortOrder = notes.sortOrder;
96 }
97 },
98 Action {

Subscribers

People subscribed via source and target branches