Merge lp:~mihirsoni/ubuntu-calendar-app/1464457 into lp:ubuntu-calendar-app

Proposed by Mihir Soni on 2015-06-27
Status: Merged
Approved by: Alan Pope 🍺🐧🐱 πŸ¦„ on 2015-07-03
Approved revision: 683
Merged at revision: 687
Proposed branch: lp:~mihirsoni/ubuntu-calendar-app/1464457
Merge into: lp:ubuntu-calendar-app
Diff against target: 98 lines (+29/-22)
3 files modified
EventDetails.qml (+4/-13)
NewEvent.qml (+23/-8)
tests/autopilot/calendar_app/__init__.py (+2/-1)
To merge this branch: bzr merge lp:~mihirsoni/ubuntu-calendar-app/1464457
Reviewer Review Type Date Requested Status
Alan Pope 🍺🐧🐱 πŸ¦„ 2015-06-27 Approve on 2015-06-29
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2015-06-27
Review via email: mp+263185@code.launchpad.net

Commit Message

Description of the Change

To post a comment you must log in.

Thanks Mihir. I prefer this. While it's an extra button press to go into 'edit' to 'delete' I think that makes sense, especially compared with how the app is currently. I prefer this consistency with other calendar apps on other legacy platforms.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'EventDetails.qml'
2--- EventDetails.qml 2015-06-18 15:45:50 +0000
3+++ EventDetails.qml 2015-06-27 17:59:28 +0000
4@@ -171,6 +171,10 @@
5 pageStack.currentPage.eventAdded.connect( function(event){
6 pageStack.pop();
7 })
8+ //When event deleted from the Edit mode
9+ pageStack.currentPage.eventDeleted.connect(function(eventId){
10+ pageStack.pop();
11+ })
12 }
13
14 Keys.onEscapePressed: {
15@@ -185,19 +189,6 @@
16
17 head.actions: [
18 Action {
19- text: i18n.tr("Delete");
20- objectName: "delete"
21- iconName: "delete"
22- onTriggered: {
23- var dialog = PopupUtils.open(Qt.resolvedUrl("DeleteConfirmationDialog.qml"),root,{"event": event});
24- dialog.deleteEvent.connect( function(eventId){
25- model.removeItem(eventId);
26- pageStack.pop();
27- });
28- }
29- },
30-
31- Action {
32 text: i18n.tr("Edit");
33 objectName: "edit"
34 iconName: "edit";
35
36=== modified file 'NewEvent.qml'
37--- NewEvent.qml 2015-06-23 15:59:08 +0000
38+++ NewEvent.qml 2015-06-27 17:59:28 +0000
39@@ -45,6 +45,7 @@
40 flickable: null
41
42 signal eventAdded(var event);
43+ signal eventDeleted(var event);
44
45 onStartDateChanged: {
46 startDateTimeInput.dateTime = startDate;
47@@ -62,14 +63,28 @@
48 endDateTimeInput.dateTime = endDate;
49 }
50
51- head.actions: Action {
52- iconName: "ok"
53- objectName: "save"
54- text: i18n.tr("Save")
55- enabled: !!titleEdit.text.trim()
56- onTriggered: saveToQtPim();
57- }
58-
59+ head.actions: [
60+ Action {
61+ text: i18n.tr("Delete");
62+ objectName: "delete"
63+ iconName: "delete"
64+ visible : isEdit
65+ onTriggered: {
66+ var dialog = PopupUtils.open(Qt.resolvedUrl("DeleteConfirmationDialog.qml"),root,{"event": event});
67+ dialog.deleteEvent.connect( function(eventId){
68+ model.removeItem(eventId);
69+ pageStack.pop();
70+ root.eventDeleted(eventId);
71+ });
72+ }
73+ },
74+ Action {
75+ iconName: "ok"
76+ objectName: "save"
77+ text: i18n.tr("Save")
78+ enabled: !!titleEdit.text.trim()
79+ onTriggered: saveToQtPim();
80+ }]
81 Component.onCompleted: {
82 //If current date is setted by an argument we don't have to change it.
83 if(typeof(date) === 'undefined'){
84
85=== modified file 'tests/autopilot/calendar_app/__init__.py'
86--- tests/autopilot/calendar_app/__init__.py 2015-05-22 14:32:00 +0000
87+++ tests/autopilot/calendar_app/__init__.py 2015-06-27 17:59:28 +0000
88@@ -962,8 +962,9 @@
89 """
90 root = self.get_root_instance()
91 header = root.select_single(MainView).get_header()
92+ header.click_action_button('edit')
93+ root.wait_select_single(NewEvent, objectName='newEventPage')
94 header.click_action_button('delete')
95-
96 delete_confirmation_dialog = root.wait_select_single(
97 DeleteConfirmationDialog, objectName='deleteConfirmationDialog')
98 delete_confirmation_dialog.confirm_deletion()

Subscribers

People subscribed via source and target branches

to status/vote changes: