Merge lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1564398 into lp:ubuntu-calendar-app

Proposed by Arthur Mello
Status: Merged
Approved by: Renato Araujo Oliveira Filho
Approved revision: 814
Merged at revision: 816
Proposed branch: lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1564398
Merge into: lp:ubuntu-calendar-app
Diff against target: 205 lines (+82/-91)
4 files modified
EventReminder.qml (+0/-82)
EventRepetition.qml (+1/-1)
NewEvent.qml (+18/-8)
OptionSelectorPage.qml (+63/-0)
To merge this branch: bzr merge lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1564398
Reviewer Review Type Date Requested Status
Renato Araujo Oliveira Filho (community) Approve
Jenkins Bot continuous-integration Approve
Review via email: mp+290745@code.launchpad.net

Commit message

Refactor on the EventReminder option selector page
Change EventRepetition page to show all options when OptionSelector is expanded

Description of the change

Refactor on the EventReminder option selector page
Change EventRepetition page to show all options when OptionSelector is expanded

This is not a complete solution for bug #1564398 but implements some changes to reduce the issue

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)
813. By Arthur Mello

Merge with trunk

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
814. By Arthur Mello

Stop using Ubuntu.Components.ListItems

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed file 'EventReminder.qml'
--- EventReminder.qml 2016-03-21 19:45:40 +0000
+++ EventReminder.qml 1970-01-01 00:00:00 +0000
@@ -1,82 +0,0 @@
1/*
2 * Copyright (C) 2014 Canonical Ltd
3 *
4 * This file is part of Ubuntu Calendar App
5 *
6 * Ubuntu Calendar App is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 3 as
8 * published by the Free Software Foundation.
9 *
10 * Ubuntu Calendar App is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import QtQuick 2.4
20import Ubuntu.Components 1.3
21import Ubuntu.Components.ListItems 1.0 as ListItem
22
23Page{
24 id:root
25 objectName: "eventReminder"
26
27 property var audibleReminder: null
28 property var reminderModel: null
29 property var eventTitle: null
30 property int reminderTime: -1
31
32 signal reminderTimeUpdated(int value);
33
34 visible: false
35 flickable: null
36 title: i18n.tr("Reminder")
37
38 head.backAction: Action{
39 iconName:"back"
40 onTriggered:{
41 reminderTimeUpdated(reminderTime)
42 pop();
43 }
44 }
45 Scrollbar{
46 id:scrollList
47 flickableItem: _pageFlickable
48 anchors.fill :parent
49 }
50 Flickable {
51 id: _pageFlickable
52
53
54 clip: true
55 anchors.fill: parent
56 contentHeight: _reminders.itemHeight * reminderModel.count + units.gu(2)
57 ListItem.ItemSelector {
58 id: _reminders
59 expanded: true
60 model: reminderModel
61 delegate: selectorDelegate
62 selectedIndex: reminderModel.get
63 onSelectedIndexChanged: {
64 root.reminderTime = reminderModel.get(selectedIndex).value
65 }
66
67 Component.onCompleted: {
68 for(var i=0; i<reminderModel.count; i++) {
69 if (root.reminderTime === reminderModel.get(i).value){
70 _reminders.selectedIndex = i
71 return;
72 }
73 }
74 }
75 }
76 Component {
77 id: selectorDelegate
78 OptionSelectorDelegate { text: label; }
79 }
80
81 }
82}
830
=== modified file 'EventRepetition.qml'
--- EventRepetition.qml 2016-03-31 18:25:00 +0000
+++ EventRepetition.qml 2016-04-05 19:07:19 +0000
@@ -164,7 +164,7 @@
164 }164 }
165165
166 model: Defines.recurrenceLabel166 model: Defines.recurrenceLabel
167 containerHeight: itemHeight * 4167 containerHeight: itemHeight * model.length
168 onExpandedChanged: Qt.inputMethod.hide();168 onExpandedChanged: Qt.inputMethod.hide();
169 }169 }
170170
171171
=== modified file 'NewEvent.qml'
--- NewEvent.qml 2016-03-31 18:25:00 +0000
+++ NewEvent.qml 2016-04-05 19:07:19 +0000
@@ -740,15 +740,25 @@
740740
741 onClicked:{741 onClicked:{
742 var stack = pageStack742 var stack = pageStack
743 if (!stack)743 if (!stack) {
744 stack = bottomEdgePageStack744 stack = bottomEdgePageStack
745745 }
746 var reminderPick = stack.push(Qt.resolvedUrl("EventReminder.qml"),746
747 {"reminderTime": root.reminderValue,747 var reminderSelectedIndex = 0
748 "reminderModel": reminderModel,748 if (eventReminder.reminderValue !== -1) {
749 "eventTitle": titleEdit.text})749 for (var i=0; i<reminderModel.count; ++i) {
750 reminderPick.reminderTimeUpdated.connect(function(value) {750 if (reminderModel.get(i).value === eventReminder.reminderValue) {
751 root.reminderValue = value751 reminderSelectedIndex = i
752 }
753 }
754 }
755
756 var reminderPick = stack.push(Qt.resolvedUrl("OptionSelectorPage.qml"),
757 {"title": i18n.tr("Reminder"),
758 "model": reminderModel,
759 "selectedIndex": reminderSelectedIndex})
760 reminderPick.selectedIndexChanged.connect(function() {
761 root.reminderValue = reminderModel.get(reminderPick.selectedIndex).value
752 })762 })
753 }763 }
754 }764 }
755765
=== added file 'OptionSelectorPage.qml'
--- OptionSelectorPage.qml 1970-01-01 00:00:00 +0000
+++ OptionSelectorPage.qml 2016-04-05 19:07:19 +0000
@@ -0,0 +1,63 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This file is part of Ubuntu Calendar App
5 *
6 * Ubuntu Calendar App is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 3 as
8 * published by the Free Software Foundation.
9 *
10 * Ubuntu Calendar App is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import QtQuick 2.4
20import Ubuntu.Components 1.3
21
22Page {
23 id: optionSelectorPage
24
25 property alias title: pageHeader.title
26 property alias model: optionsList.model
27 property alias selectedIndex: optionsList.selectedIndex
28
29 header: PageHeader {
30 id: pageHeader
31
32 flickable: optionsList
33 }
34
35 ListView {
36 id: optionsList
37
38 property int selectedIndex
39
40 anchors.fill: parent
41
42 delegate: ListItem {
43 id: optionItem
44
45 height: layout.height
46
47 onClicked: optionsList.selectedIndex = index
48
49 ListItemLayout {
50 id: layout
51
52 title.text: label
53
54 Icon {
55 name: "tick"
56 SlotsLayout.position: SlotsLayout.Trailing;
57 width: units.gu(2)
58 visible: optionsList.selectedIndex === index
59 }
60 }
61 }
62 }
63}

Subscribers

People subscribed via source and target branches

to status/vote changes: