~yohanboniface/ubuntu-calendar-app/fix1280612

« back to all changes in this revision

Viewing changes to Defines.js

  • 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:
 
1
.pragma library
 
2
 
 
3
.import QtOrganizer 5.0 as QtPim
 
4
 
 
5
var reminderLabel = getReminderLabels();
 
6
//value in seconds
 
7
var reminderValue = [ 0,
 
8
    300 /*5 * 60*/,
 
9
    900 /*15* 60*/,
 
10
    1800 /*30* 60*/,
 
11
    3600 /*1*60*60*/,
 
12
    7200 /*2*60*60*/,
 
13
    86400 /*24*60*60*/,
 
14
    172800 /*2*24*60*60*/,
 
15
    604800 /*7*24*60*60*/,
 
16
    1209600 /*14*24*60*60*/];
 
17
 
 
18
var recurrenceLabel = getRecurrenceLabels();
 
19
var recurrenceValue = [ QtPim.RecurrenceRule.Invalid,
 
20
    QtPim.RecurrenceRule.Daily,
 
21
    QtPim.RecurrenceRule.Weekly,
 
22
    QtPim.RecurrenceRule.Monthly,
 
23
    QtPim.RecurrenceRule.Yearly];
 
24
 
 
25
function getReminderLabels() {
 
26
    var object = Qt.createQmlObject('\
 
27
        import QtQuick 2.0;\
 
28
        import Ubuntu.Components 0.1;\
 
29
        QtObject {\
 
30
            property var reminderLabel:[i18n.tr("No Reminder"),\
 
31
                i18n.tr("5 minutes"),\
 
32
                i18n.tr("15 minutes"),\
 
33
                i18n.tr("30 minutes"),\
 
34
                i18n.tr("1 hour"),\
 
35
                i18n.tr("2 hours"),\
 
36
                i18n.tr("1 day"),\
 
37
                i18n.tr("2 days"),\
 
38
                i18n.tr("1 week"),\
 
39
                i18n.tr("2 weeks")];}', Qt.application, 'ReminderLabelObj');
 
40
    return object.reminderLabel;
 
41
}
 
42
 
 
43
function getRecurrenceLabels() {
 
44
    var object = Qt.createQmlObject('\
 
45
        import QtQuick 2.0;\
 
46
        import Ubuntu.Components 0.1;\
 
47
        QtObject {\
 
48
            property var recurrenceLabel:[i18n.tr("Once"),\
 
49
                i18n.tr("Daily"),\
 
50
                i18n.tr("Weekly"),\
 
51
                i18n.tr("Monthly"),\
 
52
                i18n.tr("Yearly")];}', Qt.application, 'RecurrenceLabelObj');
 
53
    return object.recurrenceLabel;
 
54
}