~dpm/ubuntu-calendar-app/fixes-1282500

« back to all changes in this revision

Viewing changes to EventDetails.qml

  • Committer: Tarmac
  • Author(s): Kunal Parmar
  • Date: 2014-02-14 20:40:17 UTC
  • mfrom: (192.2.3 ubuntu-calendar-app)
  • Revision ID: tarmac-20140214204017-uw01whfcjs042yhr
Reminder support added. Fixes: https://bugs.launchpad.net/bugs/1240539, https://bugs.launchpad.net/bugs/1270241.

Approved by Renato Araujo Oliveira Filho, Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
import QtOrganizer 5.0
7
7
 
8
8
import "GlobalEventModel.js" as GlobalModel
 
9
import "Defines.js" as Defines
9
10
 
10
11
Page {
11
12
    id: root
34
35
        }
35
36
    }
36
37
    function showEvent(e) {
37
 
        var location = "";
38
 
 
39
38
        // TRANSLATORS: this is a time formatting string,
40
39
        // see http://qt-project.org/doc/qt-5.0/qtqml/qml-qtquick2-date.html#details for valid expressions
41
40
        var timeFormat = i18n.tr("hh:mm");
49
48
        if( e.displayLabel) {
50
49
            titleLabel.text = e.displayLabel;
51
50
        }
 
51
 
 
52
        var location = "";
52
53
        if( e.location ) {
53
54
            locationLabel.text = e.location;
54
55
            location = e.location;
65
66
        }
66
67
 
67
68
        var index = 0;
68
 
        var recurrenceLabel= [ i18n.tr("Once"),
69
 
                              i18n.tr("Daily"),
70
 
                              i18n.tr("Weekly"),
71
 
                              i18n.tr("Monthly"),
72
 
                              i18n.tr("Yearly")];
73
 
 
74
69
        if(e.recurrence ) {
75
70
            var recurrenceRule = e.recurrence.recurrenceRules;
76
71
            index = ( recurrenceRule.length > 0 ) ? recurrenceRule[0].frequency : 0;
77
72
        }
78
 
        recurrentHeader.value = recurrenceLabel[index];
 
73
        recurrentHeader.value = Defines.recurrenceLabel[index];
 
74
 
 
75
        index = 0;
 
76
        var reminder = e.detail( Detail.VisualReminder);
 
77
        if( reminder ) {
 
78
            var reminderTime = reminder.secondsBeforeStart;
 
79
            var foundIndex = Defines.reminderValue.indexOf(reminderTime);
 
80
            index = foundIndex != -1 ? foundIndex : 0;
 
81
        }
 
82
        reminderHeader.value = Defines.reminderLabel[index];
 
83
 
79
84
 
80
85
        // FIXME: need to cache map image to avoid duplicate download every time
81
86
        var imageSrc = "http://maps.googleapis.com/maps/api/staticmap?center="+location+
217
222
                id: reminderHeader
218
223
                xMargin: column.recurranceAreaMaxWidth
219
224
                header: i18n.tr("Remind me")
220
 
                value :"15 minutes before" //Neds to change
221
225
            }
222
226
        }
223
227
    }