ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #09424
[Merge] lp:~mzanetti/reminders-app/fix-sorting-dialog into lp:reminders-app
Michael Zanetti has proposed merging lp:~mzanetti/reminders-app/fix-sorting-dialog into lp:reminders-app.
Commit message:
fix sorting dialog
Requested reviews:
Ubuntu Notes app developers (notes-app-dev)
For more details, see:
https://code.launchpad.net/~mzanetti/reminders-app/fix-sorting-dialog/+merge/293472
--
Your team Ubuntu Notes app developers is requested to review the proposed merge of lp:~mzanetti/reminders-app/fix-sorting-dialog into lp:reminders-app.
=== modified file 'src/app/qml/components/SortingDialog.qml'
--- src/app/qml/components/SortingDialog.qml 2015-11-02 20:26:37 +0000
+++ src/app/qml/components/SortingDialog.qml 2016-04-30 19:52:13 +0000
@@ -2,46 +2,33 @@
import Ubuntu.Components 1.3
import Ubuntu.Components.Popups 1.3
import Ubuntu.Components.ListItems 1.3
-import reminders 1.0
-
-Item {
- id: root
-
- property int sortOrder
-
- signal accepted();
-
- Component.onCompleted: PopupUtils.open(dialogComponent, root, {sortOrder: root.sortOrder})
-
- Component {
- id: dialogComponent
- Dialog {
- id: dialog
- title: i18n.tr("Sort by")
-
- property alias sortOrder: optionSelector.selectedIndex
-
-
- OptionSelector {
- id: optionSelector
- expanded: true
- model: [
- i18n.tr("Date created (newest first)"),
- i18n.tr("Date created (oldest first)"),
- i18n.tr("Date updated (newest first)"),
- i18n.tr("Date updated (oldest first)"),
- i18n.tr("Title (ascending)"),
- i18n.tr("Title (descending)")
- ]
- delegate: OptionSelectorDelegate {
- objectName: "sortingOption" + index
- }
- onDelegateClicked: {
- root.sortOrder = index
- root.accepted();
- PopupUtils.close(dialog);
- }
- }
+import Evernote 0.1
+
+Dialog {
+ id: dialog
+ title: i18n.tr("Sort by")
+
+ property alias sortOrder: optionSelector.selectedIndex
+
+ signal accepted(int sortOrder);
+
+ OptionSelector {
+ id: optionSelector
+ expanded: true
+ model: [
+ i18n.tr("Date created (newest first)"),
+ i18n.tr("Date created (oldest first)"),
+ i18n.tr("Date updated (newest first)"),
+ i18n.tr("Date updated (oldest first)"),
+ i18n.tr("Title (ascending)"),
+ i18n.tr("Title (descending)")
+ ]
+ delegate: OptionSelectorDelegate {
+ objectName: "sortingOption" + index
+ }
+ onDelegateClicked: {
+ dialog.accepted(index);
+ PopupUtils.close(dialog);
}
}
}
=== modified file 'src/app/qml/ui/NotesPage.qml'
--- src/app/qml/ui/NotesPage.qml 2015-11-02 20:26:37 +0000
+++ src/app/qml/ui/NotesPage.qml 2016-04-30 19:52:13 +0000
@@ -72,13 +72,11 @@
iconSource: "../images/sorting.svg"
text: i18n.tr("Sorting")
onTriggered: {
- var popupComponent = Qt.createComponent(Qt.resolvedUrl("../components/SortingDialog.qml"));
- var popup = popupComponent.createObject(root, {sortOrder: notes.sortOrder} )
- popup.accepted.connect( function() {
- notes.sortOrder = popup.sortOrder
+ var popup = PopupUtils.open(Qt.resolvedUrl("../components/SortingDialog.qml"), root, {sortOrder: notes.sortOrder})
+ popup.accepted.connect( function(sortOrder) {
+ notes.sortOrder = sortOrder
popup.destroy();
})
- popup.sortOrder = notes.sortOrder;
}
},
Action {
Follow ups