~pkunal-parmar/ubuntu-calendar-app/ICalImport

192.2.1 by Kunal Parmar
Reminder support added
1
.pragma library
2
192.2.3 by Kunal Parmar
Merge from Trunk
3
.import QtOrganizer 5.0 as QtPim
4
192.2.1 by Kunal Parmar
Reminder support added
5
var reminderLabel = getReminderLabels();
6
//value in seconds
7
var reminderValue = [ 0,
286.1.3 by Mihir Soni
cleande the code
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*/];
192.2.1 by Kunal Parmar
Reminder support added
17
192.2.3 by Kunal Parmar
Merge from Trunk
18
var recurrenceLabel = getRecurrenceLabels();
211.2.1 by Mihir
Added limit functionality to event
19
var limitLabel = getLimitLabels();
286.1.1 by Mihir Soni
Added repeate week days
20
var weekLabel = getWeekLabels();
286.1.16 by Mihir Soni
changes as per review comments
21
// It contains multiple weekly entries to handle following occurence
22
//1.Every Weekday (Monday to Friday
23
//2.Every Monday, Wednesday and Friday
24
//3.Every Tuesday and Thursday
25
//4.Weekly
192.2.3 by Kunal Parmar
Merge from Trunk
26
var recurrenceValue = [ QtPim.RecurrenceRule.Invalid,
286.1.3 by Mihir Soni
cleande the code
27
    QtPim.RecurrenceRule.Daily,
28
    QtPim.RecurrenceRule.Weekly,
286.1.16 by Mihir Soni
changes as per review comments
29
    QtPim.RecurrenceRule.Weekly,
30
    QtPim.RecurrenceRule.Weekly,
31
    QtPim.RecurrenceRule.Weekly,
286.1.3 by Mihir Soni
cleande the code
32
    QtPim.RecurrenceRule.Monthly,
33
    QtPim.RecurrenceRule.Yearly];
192.2.3 by Kunal Parmar
Merge from Trunk
34
192.2.1 by Kunal Parmar
Reminder support added
35
function getReminderLabels() {
372.1.1 by Kunal Parmar
Moved component to file to ease the translation
36
    var component = Qt.createComponent(Qt.resolvedUrl("ReminderLabelDefines.qml"));
37
    var object = component.createObject(Qt.application);
192.2.1 by Kunal Parmar
Reminder support added
38
    return object.reminderLabel;
39
}
40
192.2.3 by Kunal Parmar
Merge from Trunk
41
function getRecurrenceLabels() {
372.1.1 by Kunal Parmar
Moved component to file to ease the translation
42
    var component = Qt.createComponent(Qt.resolvedUrl("RecurrenceLabelDefines.qml"));
43
    var object = component.createObject(Qt.application);
192.2.3 by Kunal Parmar
Merge from Trunk
44
    return object.recurrenceLabel;
45
}
211.2.1 by Mihir
Added limit functionality to event
46
function getLimitLabels(){
372.1.1 by Kunal Parmar
Moved component to file to ease the translation
47
    var component = Qt.createComponent(Qt.resolvedUrl("LimitLabelDefines.qml"));
48
    var object = component.createObject(Qt.application);
211.2.1 by Mihir
Added limit functionality to event
49
    return object.limitLabel;
50
}
286.1.1 by Mihir Soni
Added repeate week days
51
function getWeekLabels(){
52
    var object = Qt.createQmlObject('\
53
        import QtQuick 2.0;\
54
        import Ubuntu.Components 0.1;\
55
        QtObject {\
286.1.12 by Mihir Soni
Change as per review comments
56
            property var weekLabel:[Qt.locale().dayName(7,Locale.NarrowFormat),\
286.1.7 by Mihir Soni
Added localization form Qt.locale
57
                                    Qt.locale().dayName(1,Locale.NarrowFormat),\
58
                                    Qt.locale().dayName(2,Locale.NarrowFormat),\
59
                                    Qt.locale().dayName(3,Locale.NarrowFormat),\
60
                                    Qt.locale().dayName(4,Locale.NarrowFormat),\
61
                                    Qt.locale().dayName(5,Locale.NarrowFormat),\
62
                                    Qt.locale().dayName(6,Locale.NarrowFormat)];}', Qt.application, 'weekLabelObj');
286.1.1 by Mihir Soni
Added repeate week days
63
    return object.weekLabel;
64
}