Merge lp:~mefrio-g/ubuntu-calendar-app/fix-1270242 into lp:ubuntu-calendar-app

Proposed by Mario Guerriero
Status: Merged
Approved by: Kunal Parmar
Approved revision: 192
Merged at revision: 193
Proposed branch: lp:~mefrio-g/ubuntu-calendar-app/fix-1270242
Merge into: lp:ubuntu-calendar-app
Diff against target: 111 lines (+46/-2)
2 files modified
EventDetails.qml (+15/-0)
NewEvent.qml (+31/-2)
To merge this branch: bzr merge lp:~mefrio-g/ubuntu-calendar-app/fix-1270242
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Kunal Parmar Approve
Review via email: mp+204057@code.launchpad.net

Commit message

added support for recurrence

Description of the change

added support for recurrence

To post a comment you must log in.
Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

Hi Mario,

Thanks for fixing the issue. Your change seems good.

However, we also need to reflect recurrence value in EventDetails.qml and also when editing the event in NewEvent.qml.
Can you add those changes as well ?

I have done some work for that in this branch
https://code.launchpad.net/~pkunal-parmar/ubuntu-calendar-app/MissingFields

You can refer it, I was not able to merge those changes as I was busy with other tasks.

Revision history for this message
Mario Guerriero (mefrio-g) wrote :

I totally forgot about edit and display mode. I just added them. I tried to arrange the code so that it looks much more "compatible" to yours.

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

This looks good to me, Tested and seems to work fine on desktop.

On side note: We are currently missing Options in UI that can limit recurrence of event. Like create recurrence event only for 10 times or Don't create recurrence event after certain date time.

So we need option to specify limit property of recurring event, option like, count, date time or no limit.
You can read more here.
http://doc.qt.digia.com/qtmobility/qml-recurrencerule.html#limit-prop

I am not sure if you would be interested in implementing this, but it was related so thought to mention it.

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Mario Guerriero (mefrio-g) wrote :

Hi Kunal,

I think this feature regards some other branches/bugs. What should I fix now? I can't understand what the bot is saying.

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

Hi Mario,

I agree, we can do that in separate branch.

Regarding error, looks like server issue.
I will try to trigger build again in sometime.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

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 2014-01-18 03:15:28 +0000
3+++ EventDetails.qml 2014-02-01 18:03:08 +0000
4@@ -3,6 +3,7 @@
5 import Ubuntu.Components.Popups 0.1
6 import Ubuntu.Components.ListItems 0.1
7 import Ubuntu.Components.Themes.Ambiance 0.1
8+import QtOrganizer 5.0
9
10 import "GlobalEventModel.js" as GlobalModel
11
12@@ -62,6 +63,20 @@
13 contactModel.append( {"name": attendees[j].name } );
14 }
15 }
16+
17+ var index = 0;
18+ var recurrenceLabel= [ i18n.tr("Once"),
19+ i18n.tr("Daily"),
20+ i18n.tr("Weekly"),
21+ i18n.tr("Monthly"),
22+ i18n.tr("Yearly")];
23+
24+ if(e.recurrence ) {
25+ var recurrenceRule = e.recurrence.recurrenceRules;
26+ index = ( recurrenceRule.length > 0 ) ? recurrenceRule[0].frequency : 0;
27+ }
28+ recurrentHeader.value = recurrenceLabel[index];
29+
30 // FIXME: need to cache map image to avoid duplicate download every time
31 var imageSrc = "http://maps.googleapis.com/maps/api/staticmap?center="+location+
32 "&markers=color:red|"+location+"&zoom=15&size="+mapContainer.width+
33
34=== modified file 'NewEvent.qml'
35--- NewEvent.qml 2014-01-01 04:22:40 +0000
36+++ NewEvent.qml 2014-02-01 18:03:08 +0000
37@@ -1,4 +1,5 @@
38 import QtQuick 2.0
39+import QtOrganizer 5.0
40 import Ubuntu.Components 0.1
41 import Ubuntu.Components.Popups 0.1
42 import Ubuntu.Components.ListItems 0.1
43@@ -73,7 +74,15 @@
44 personEdit.text += ",";
45 }
46 }
47+
48+ var index = 0;
49+ if(e.recurrence ) {
50+ var recurrenceRule = e.recurrence.recurrenceRules;
51+ index = ( recurrenceRule.length > 0 ) ? recurrenceRule[0].frequency : 0;
52+ }
53+ recurrenceOption.selectedIndex = index;
54 }
55+
56 //Save the new or Existing event
57 function saveToQtPim() {
58 internal.clearFocus()
59@@ -91,6 +100,14 @@
60 attendee.name = personEdit.text;
61 event.setDetail(attendee);
62 }
63+
64+ var recurrenceRule = internal.recurrenceValue[ recurrenceOption.selectedIndex ];
65+ if( recurrenceRule !== RecurrenceRule.Invalid ) {
66+ var rule = Qt.createQmlObject("import QtOrganizer 5.0; RecurrenceRule {}", event.recurrence);
67+ rule.frequency = recurrenceRule;
68+ event.recurrence.recurrenceRules = [rule];
69+ }
70+
71 internal.eventModel.saveItem(event);
72 pageStack.pop();
73 }
74@@ -274,16 +291,17 @@
75
76 Item {
77 width: parent.width
78- height: childrenRect.height
79+ height: recurrenceOption.height
80 Label{
81 id: frequencyLabel
82 text: i18n.tr("This happens");
83 anchors.verticalCenter: parent.verticalCenter
84 }
85 OptionSelector{
86+ id: recurrenceOption
87 anchors.right: parent.right
88 width: parent.width - optionSelectorWidth - units.gu(1)
89- model:[i18n.tr("Once"),i18n.tr("Daily"),i18n.tr("Weekly"),i18n.tr("Monthly"),i18n.tr("Yearly")]
90+ model: internal.recurrenceLabel
91 }
92 }
93
94@@ -316,6 +334,17 @@
95 QtObject {
96 id: internal
97 property var eventModel;
98+ property var recurrenceValue: [ RecurrenceRule.Invalid,
99+ RecurrenceRule.Daily,
100+ RecurrenceRule.Weekly,
101+ RecurrenceRule.Monthly,
102+ RecurrenceRule.Yearly];
103+
104+ property var recurrenceLabel: [ i18n.tr("Once"),
105+ i18n.tr("Daily"),
106+ i18n.tr("Weekly"),
107+ i18n.tr("Monthly"),
108+ i18n.tr("Yearly")];
109
110 function clearFocus() {
111 Qt.inputMethod.hide()

Subscribers

People subscribed via source and target branches

to status/vote changes: