Merge lp:~pkunal-parmar/ubuntu-calendar-app/Restructure into lp:ubuntu-calendar-app

Proposed by Kunal Parmar
Status: Merged
Approved by: Mihir Soni
Approved revision: 240
Merged at revision: 242
Proposed branch: lp:~pkunal-parmar/ubuntu-calendar-app/Restructure
Merge into: lp:ubuntu-calendar-app
Diff against target: 276 lines (+98/-103)
1 file modified
calendar.qml (+98/-103)
To merge this branch: bzr merge lp:~pkunal-parmar/ubuntu-calendar-app/Restructure
Reviewer Review Type Date Requested Status
Victor Thompson (community) Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Mihir Soni Approve
Review via email: mp+214371@code.launchpad.net

Commit message

Removing unnecessary intermediate page from pagestack.
As shown in SDK documentation.
we dont need intermediate page, below pagestack, we can direcly put tabs under pagestack.

Description of the change

Removing unnecessary intermediate page from pagestack.
As shown in SDK documentation.
we dont need intermediate page, below pagestack, we can direcly put tabs under pagestack.

http://developer.ubuntu.com/api/qml/sdk-1.0/Ubuntu.Components.Tabs/

MainView {
    id: mainView
   ..
    PageStack {
        id: pageStack
        Component.onCompleted: push(tabs)
        Tabs {
            id: tabs
            Tab {
                title: "Tab 1"
          ..

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Mihir Soni (mihirsoni) wrote :

looks good to me Kunal.

Thank you for MR.

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
Kunal Parmar (pkunal-parmar) wrote :

I need to merge trunk, I will update trunk then we can merge it.

238. By Kunal Parmar

Merge from trunk

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
239. By Kunal Parmar

merge issue fixed

240. By Kunal Parmar

merge issue fixed

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

After some initial testing I see no regressions in this MR. +1 community approve.

review: Approve
241. By Kunal Parmar

Loader used to load page

242. By Kunal Parmar

AutoPilot test fix

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'calendar.qml'
2--- calendar.qml 2014-04-11 00:21:42 +0000
3+++ calendar.qml 2014-04-12 02:58:03 +0000
4@@ -53,7 +53,7 @@
5 width: units.gu(100)
6 height: units.gu(80)
7 focus: true
8- Keys.forwardTo: [yearView,monthView,weekView,dayView,pageStack.currentPage,tabPage]
9+ Keys.forwardTo: [pageStack.currentPage]
10
11 headerColor: "#266249"
12 backgroundColor: "#478158"
13@@ -63,10 +63,27 @@
14 PageStack {
15 id: pageStack
16
17- Component.onCompleted: push(tabPage)
18-
19- Page{
20- id: tabPage
21+ Component.onCompleted: push(tabs)
22+
23+ // This is for wait that the app is load when newEvent is invoked by argument
24+ Timer {
25+ id: timer
26+ interval: 200; running: false; repeat: false
27+ onTriggered: {
28+ tabs.newEvent();
29+ }
30+ }
31+
32+ EventListModel{
33+ id: eventModel
34+ //This model is just for newevent
35+ //so we dont need any update
36+ autoUpdate: false
37+ }
38+
39+ Tabs{
40+ id: tabs
41+ Keys.forwardTo: [tabs.currentPage]
42
43 property var currentDay: DateExt.today();
44
45@@ -77,7 +94,7 @@
46
47 onCurrentDayChanged: {
48 if( yearView.currentYear !== currentDay.getFullYear() ) {
49- yearView.currentYear = tabPage.currentDay.getFullYear();
50+ yearView.currentYear = tabs.currentDay.getFullYear();
51 }
52
53 if( monthView.currentMonth !== undefined && !monthView.currentMonth.isSameDay(currentDay))
54@@ -125,13 +142,13 @@
55 var difference = endTime - startTime;
56
57 if (difference > month)
58- return 0; // Year view
59+ return yearTab.index; // Year view
60 else if (difference > 7 * day)
61- return 1; // Month view}
62+ return monthTab.index; // Month view}
63 else if (difference > day)
64- return 2; // Week view
65+ return weekTab.index; // Week view
66 else
67- return 3; // Day view
68+ return dayTab.index; // Day view
69 }
70
71 // This function parse the argument
72@@ -153,14 +170,14 @@
73 // If an url has been set
74 if (args.defaultArgument.at(0)) {
75 parseArguments(args.defaultArgument.at(0))
76- tabPage.currentDay = new Date()
77+ tabs.currentDay = new Date()
78 // If newevent has been called on startup
79 if (newevent) {
80 timer.running = true;
81 }
82 else if (starttime !== -1) { // If no newevent has been setted, but starttime
83 var startTime = parseInt(starttime);
84- tabPage.currentDay = new Date(startTime);
85+ tabs.currentDay = new Date(startTime);
86
87 // If also endtime has been settend
88 if (endtime !== -1) {
89@@ -183,22 +200,6 @@
90 }
91 } // End of Component.onCompleted:
92
93- // This is for wait that the app is load when newEvent is invoked by argument
94- Timer {
95- id: timer
96- interval: 200; running: false; repeat: false
97- onTriggered: {
98- tabPage.newEvent();
99- }
100- }
101-
102- EventListModel{
103- id: eventModel
104- //This model is just for newevent
105- //so we dont need any update
106- autoUpdate: false
107- }
108-
109 ToolbarItems {
110 id: commonToolBar
111
112@@ -208,7 +209,7 @@
113 iconSource: Qt.resolvedUrl("calendar-today.svg");
114 text: i18n.tr("Today");
115 onTriggered: {
116- tabPage.currentDay = (new Date()).midnight();
117+ tabs.currentDay = (new Date()).midnight();
118 }
119 }
120 }
121@@ -218,7 +219,7 @@
122 iconSource: Qt.resolvedUrl("new-event.svg");
123 text: i18n.tr("New Event");
124 onTriggered: {
125- pageStack.push(Qt.resolvedUrl("NewEvent.qml"),{"date":tabPage.currentDay,"model":eventModel});
126+ pageStack.push(Qt.resolvedUrl("NewEvent.qml"),{"date":tabs.currentDay,"model":eventModel});
127 }
128 }
129 }
130@@ -246,79 +247,73 @@
131 }
132 }
133
134- Tabs{
135- id: tabs
136-
137- Tab{
138- id: yearTab
139- objectName: "yearTab"
140- title: i18n.tr("Year")
141- page: YearView{
142- id: yearView
143- objectName: "yearPage"
144- tools: commonToolBar
145- anchors.fill: parent
146- onMonthSelected: {
147- tabs.selectedTabIndex = 1
148- var now = DateExt.today();
149- if( date.getMonth() === now.getMonth()
150- && date.getFullYear() === now.getFullYear()) {
151- monthView.currentMonth = now
152- } else {
153- monthView.currentMonth = date.midnight();
154- }
155- }
156- }
157- }
158- Tab {
159- id: monthTab
160- objectName: "monthTab"
161- title: i18n.tr("Month")
162- page: MonthView{
163- anchors.fill: parent
164- tools: commonToolBar
165- id: monthView
166-
167- onDateSelected: {
168- tabs.selectedTabIndex = 3
169- tabPage.currentDay = date;
170- }
171- }
172- }
173- Tab{
174- id: weekTab
175- objectName: "weekTab"
176- title: i18n.tr("Week")
177- page: WeekView{
178- id: weekView
179- anchors.fill: parent
180- tools: commonToolBar
181- isCurrentPage: tabs.selectedTab == weekTab
182-
183- onDayStartChanged: {
184- tabPage.currentDay = dayStart;
185- }
186-
187- onDateSelected: {
188- tabs.selectedTabIndex = 3;
189- tabPage.currentDay = date;
190- }
191- }
192- }
193-
194- Tab{
195- id: dayTab
196- objectName: "dayTab"
197- title: i18n.tr("Day")
198- page: DayView{
199- id: dayView
200- anchors.fill: parent
201- tools: commonToolBar
202- isCurrentPage: tabs.selectedTab == dayTab
203-
204- onCurrentDayChanged: {
205- tabPage.currentDay = currentDay;
206- }
207+ Tab{
208+ id: yearTab
209+ objectName: "yearTab"
210+ title: i18n.tr("Year")
211+ page: YearView{
212+ id: yearView
213+ objectName: "yearPage"
214+ tools: commonToolBar
215+ onMonthSelected: {
216+ tabs.selectedTabIndex = monthTab.index;
217+ var now = DateExt.today();
218+ if( date.getMonth() === now.getMonth()
219+ && date.getFullYear() === now.getFullYear()) {
220+ monthView.currentMonth = now
221+ } else {
222+ monthView.currentMonth = date.midnight();
223+ }
224+ }
225+ }
226+ }
227+
228+ Tab {
229+ id: monthTab
230+ objectName: "monthTab"
231+ title: i18n.tr("Month")
232+ page: MonthView{
233+ tools: commonToolBar
234+ id: monthView
235+
236+ onDateSelected: {
237+ tabs.selectedTabIndex = dayTab.index;
238+ tabs.currentDay = date;
239+ }
240+ }
241+ }
242+
243+ Tab{
244+ id: weekTab
245+ objectName: "weekTab"
246+ title: i18n.tr("Week")
247+ page: WeekView{
248+ id: weekView
249+ tools: commonToolBar
250+ isCurrentPage: tabs.selectedTab == weekTab
251+
252+ onDayStartChanged: {
253+ tabs.currentDay = dayStart;
254+ }
255+
256+ onDateSelected: {
257+ tabs.selectedTabIndex = dayTab.index;
258+ tabs.currentDay = date;
259+ }
260+ }
261+ }
262+
263+ Tab{
264+ id: dayTab
265+ objectName: "dayTab"
266+ title: i18n.tr("Day")
267+ page: DayView{
268+ id: dayView
269+ tools: commonToolBar
270+ isCurrentPage: tabs.selectedTab == dayTab
271+
272+ onCurrentDayChanged: {
273+ tabs.currentDay = currentDay;
274 }
275 }
276 }

Subscribers

People subscribed via source and target branches

to status/vote changes: