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
1=== removed file 'EventReminder.qml'
2--- EventReminder.qml 2016-03-21 19:45:40 +0000
3+++ EventReminder.qml 1970-01-01 00:00:00 +0000
4@@ -1,82 +0,0 @@
5-/*
6- * Copyright (C) 2014 Canonical Ltd
7- *
8- * This file is part of Ubuntu Calendar App
9- *
10- * Ubuntu Calendar App is free software: you can redistribute it and/or modify
11- * it under the terms of the GNU General Public License version 3 as
12- * published by the Free Software Foundation.
13- *
14- * Ubuntu Calendar App is distributed in the hope that it will be useful,
15- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17- * GNU General Public License for more details.
18- *
19- * You should have received a copy of the GNU General Public License
20- * along with this program. If not, see <http://www.gnu.org/licenses/>.
21- */
22-
23-import QtQuick 2.4
24-import Ubuntu.Components 1.3
25-import Ubuntu.Components.ListItems 1.0 as ListItem
26-
27-Page{
28- id:root
29- objectName: "eventReminder"
30-
31- property var audibleReminder: null
32- property var reminderModel: null
33- property var eventTitle: null
34- property int reminderTime: -1
35-
36- signal reminderTimeUpdated(int value);
37-
38- visible: false
39- flickable: null
40- title: i18n.tr("Reminder")
41-
42- head.backAction: Action{
43- iconName:"back"
44- onTriggered:{
45- reminderTimeUpdated(reminderTime)
46- pop();
47- }
48- }
49- Scrollbar{
50- id:scrollList
51- flickableItem: _pageFlickable
52- anchors.fill :parent
53- }
54- Flickable {
55- id: _pageFlickable
56-
57-
58- clip: true
59- anchors.fill: parent
60- contentHeight: _reminders.itemHeight * reminderModel.count + units.gu(2)
61- ListItem.ItemSelector {
62- id: _reminders
63- expanded: true
64- model: reminderModel
65- delegate: selectorDelegate
66- selectedIndex: reminderModel.get
67- onSelectedIndexChanged: {
68- root.reminderTime = reminderModel.get(selectedIndex).value
69- }
70-
71- Component.onCompleted: {
72- for(var i=0; i<reminderModel.count; i++) {
73- if (root.reminderTime === reminderModel.get(i).value){
74- _reminders.selectedIndex = i
75- return;
76- }
77- }
78- }
79- }
80- Component {
81- id: selectorDelegate
82- OptionSelectorDelegate { text: label; }
83- }
84-
85- }
86-}
87
88=== modified file 'EventRepetition.qml'
89--- EventRepetition.qml 2016-03-31 18:25:00 +0000
90+++ EventRepetition.qml 2016-04-05 19:07:19 +0000
91@@ -164,7 +164,7 @@
92 }
93
94 model: Defines.recurrenceLabel
95- containerHeight: itemHeight * 4
96+ containerHeight: itemHeight * model.length
97 onExpandedChanged: Qt.inputMethod.hide();
98 }
99
100
101=== modified file 'NewEvent.qml'
102--- NewEvent.qml 2016-03-31 18:25:00 +0000
103+++ NewEvent.qml 2016-04-05 19:07:19 +0000
104@@ -740,15 +740,25 @@
105
106 onClicked:{
107 var stack = pageStack
108- if (!stack)
109+ if (!stack) {
110 stack = bottomEdgePageStack
111-
112- var reminderPick = stack.push(Qt.resolvedUrl("EventReminder.qml"),
113- {"reminderTime": root.reminderValue,
114- "reminderModel": reminderModel,
115- "eventTitle": titleEdit.text})
116- reminderPick.reminderTimeUpdated.connect(function(value) {
117- root.reminderValue = value
118+ }
119+
120+ var reminderSelectedIndex = 0
121+ if (eventReminder.reminderValue !== -1) {
122+ for (var i=0; i<reminderModel.count; ++i) {
123+ if (reminderModel.get(i).value === eventReminder.reminderValue) {
124+ reminderSelectedIndex = i
125+ }
126+ }
127+ }
128+
129+ var reminderPick = stack.push(Qt.resolvedUrl("OptionSelectorPage.qml"),
130+ {"title": i18n.tr("Reminder"),
131+ "model": reminderModel,
132+ "selectedIndex": reminderSelectedIndex})
133+ reminderPick.selectedIndexChanged.connect(function() {
134+ root.reminderValue = reminderModel.get(reminderPick.selectedIndex).value
135 })
136 }
137 }
138
139=== added file 'OptionSelectorPage.qml'
140--- OptionSelectorPage.qml 1970-01-01 00:00:00 +0000
141+++ OptionSelectorPage.qml 2016-04-05 19:07:19 +0000
142@@ -0,0 +1,63 @@
143+/*
144+ * Copyright (C) 2016 Canonical Ltd
145+ *
146+ * This file is part of Ubuntu Calendar App
147+ *
148+ * Ubuntu Calendar App is free software: you can redistribute it and/or modify
149+ * it under the terms of the GNU General Public License version 3 as
150+ * published by the Free Software Foundation.
151+ *
152+ * Ubuntu Calendar App is distributed in the hope that it will be useful,
153+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
154+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
155+ * GNU General Public License for more details.
156+ *
157+ * You should have received a copy of the GNU General Public License
158+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
159+ */
160+
161+import QtQuick 2.4
162+import Ubuntu.Components 1.3
163+
164+Page {
165+ id: optionSelectorPage
166+
167+ property alias title: pageHeader.title
168+ property alias model: optionsList.model
169+ property alias selectedIndex: optionsList.selectedIndex
170+
171+ header: PageHeader {
172+ id: pageHeader
173+
174+ flickable: optionsList
175+ }
176+
177+ ListView {
178+ id: optionsList
179+
180+ property int selectedIndex
181+
182+ anchors.fill: parent
183+
184+ delegate: ListItem {
185+ id: optionItem
186+
187+ height: layout.height
188+
189+ onClicked: optionsList.selectedIndex = index
190+
191+ ListItemLayout {
192+ id: layout
193+
194+ title.text: label
195+
196+ Icon {
197+ name: "tick"
198+ SlotsLayout.position: SlotsLayout.Trailing;
199+ width: units.gu(2)
200+ visible: optionsList.selectedIndex === index
201+ }
202+ }
203+ }
204+ }
205+}

Subscribers

People subscribed via source and target branches

to status/vote changes: