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

400.1.1 by mihirsoni-123
Added copyright header comments in all the pages
1
/*
400.1.2 by mihirsoni-123
updated copyright year
2
 * Copyright (C) 2013-2014 Canonical Ltd
400.1.1 by mihirsoni-123
Added copyright header comments in all the pages
3
 *
4
 * This file is part of Ubuntu Calendar App
5
 *
6
 * Ubuntu Calendar App is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License version 3 as
8
 * published by the Free Software Foundation.
9
 *
10
 * Ubuntu Calendar App is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 */
455.3.5 by Nekhelesh Ramananthan
Small change
18
19
import QtQuick 2.3
422.5.1 by Akiva Avraham
Upgraded component library imports
20
import Ubuntu.Components 1.1
460.1.1 by Mihir Soni
improved yearview & Monthview
21
94.1.1 by Kunal Parmar
MonthView/YearView chaged according to new design
22
import "dateExt.js" as DateExt
222.3.8 by Bartosz Kosiorek
Sync with lp:ubuntu-calendar-app trunk
23
Page {
222.3.2 by Bartosz Kosiorek
Add quick add event for Year View
24
    id: yearViewPage
338.1.1 by Nicholas Skaggs
restructure yearview, add test
25
    objectName: "yearViewPage"
235.1.1 by Kunal Parmar
View to PAge
26
199.1.2 by Kunal Parmar
Code clean up and further improvemnts
27
    property int currentYear: DateExt.today().getFullYear();
94.1.1 by Kunal Parmar
MonthView/YearView chaged according to new design
28
    signal monthSelected(var date);
29
338.1.1 by Nicholas Skaggs
restructure yearview, add test
30
    Keys.forwardTo: [yearPathView]
455.3.6 by Nekhelesh Ramananthan
Just fixed the code indentation. No other change
31
455.3.1 by Mihir Soni
Removed duplicate header section from views and added common header
32
    Action {
455.3.6 by Nekhelesh Ramananthan
Just fixed the code indentation. No other change
33
        id: calendarTodayAction
34
        objectName:"todaybutton"
35
        iconName: "calendar-today"
36
        text: i18n.tr("Today")
37
        onTriggered: {
38
            currentYear = new Date().getFullYear()
39
        }
40
    }
455.3.1 by Mihir Soni
Removed duplicate header section from views and added common header
41
460.1.1 by Mihir Soni
improved yearview & Monthview
42
    head {
43
        actions: [
44
            calendarTodayAction,
45
            commonHeaderActions.newEventAction,
46
            commonHeaderActions.showCalendarAction,
581.3.1 by Andrew Hayzen
* Add sync header action to AgendaView.qml DayView.qml MonthView.qml WeekView.qml YearView.qml
47
            commonHeaderActions.reloadAction,
48
            commonHeaderActions.syncCalendarAction
460.1.1 by Mihir Soni
improved yearview & Monthview
49
        ]
526.1.2 by Mihir Soni
Yearview Header
50
        contents: Label {
51
            id:year
52
            objectName:"yearLabel"
53
            fontSize: "x-large"
526.1.3 by Mihir Soni
Fixed weekview , added Year string in YearView
54
            text: i18n.tr("Year %1").arg(currentYear)
526.1.2 by Mihir Soni
Yearview Header
55
        }
460.1.1 by Mihir Soni
improved yearview & Monthview
56
    }
235.1.3 by Kunal Parmar
YearView merge issue fixed
57
235.1.1 by Kunal Parmar
View to PAge
58
    PathViewBase {
338.1.1 by Nicholas Skaggs
restructure yearview, add test
59
        id: yearPathView
60
        objectName: "yearPathView"
235.1.1 by Kunal Parmar
View to PAge
61
62
        anchors.fill: parent
63
64
        onNextItemHighlighted: {
65
            currentYear = currentYear + 1;
66
        }
67
68
        onPreviousItemHighlighted: {
69
            currentYear = currentYear - 1;
70
        }
71
520.2.1 by Kunal Parmar
performance improvements for yearview and monthview
72
        delegate: Loader {
235.1.1 by Kunal Parmar
View to PAge
73
            width: parent.width
74
            height: parent.height
75
            anchors.top: parent.top
76
520.2.1 by Kunal Parmar
performance improvements for yearview and monthview
77
            asynchronous: index !== yearPathView.currentIndex
78
            sourceComponent: delegateComponent
79
80
            Component{
81
                id: delegateComponent
82
83
                YearViewDelegate{
84
                    focus: index == yearPathView.currentIndex
85
86
                    scrollMonth: 0;
87
                    isCurrentItem: index == yearPathView.currentIndex
88
                    year: (yearViewPage.currentYear + yearPathView.indexType(index))
89
138.1.1 by Kunal Parmar
creating month hightlight when necessary
90
                    anchors.fill: parent
63.1.1 by Kunal Parmar
year view implementation
91
                }
92
            }
93
        }
94
    }
95
}