author | hgs |
Mon, 26 Jul 2010 13:54:38 +0530 | |
changeset 55 | 2c54b51f39c4 |
parent 51 | 0b38fc5b94c6 |
child 57 | bb2d3e476f29 |
permissions | -rw-r--r-- |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: Calendar view manager |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
15 |
* |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
19 |
//system includes |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
20 |
#include <hbmainwindow.h> |
45 | 21 |
#include <hbinstance.h> |
22 |
#include <hbapplication.h> // hbapplication |
|
23 |
#include <xqserviceutil.h> // service utils |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
25 |
//user includes |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
26 |
#include "calenviewmanager.h" |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
27 |
#include "calencontroller.h" |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
28 |
#include "hb_calencommands.hrh" |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
29 |
#include "calenservicesimpl.h" |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
30 |
#include "calenmonthview.h" |
45 | 31 |
#include "calenagendaview.h" |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
32 |
#include "calenmonthview.h" |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
33 |
#include "agendaeventviewer.h" |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
34 |
#include "calennotificationhandler.h" |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
35 |
#include "CalenUid.h" |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
36 |
#include "calenactionuiutils.h" |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
37 |
#include "calensettingsview.h" |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
38 |
#include "calendocloader.h" |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
39 |
#include "calendarui_debug.h" |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
40 |
#include "calencommon.h" |
45 | 41 |
#include "calendayview.h" |
55 | 42 |
#include <agendautil.h> |
51 | 43 |
#include "OstTraceDefinitions.h" |
44 |
#ifdef OST_TRACE_COMPILER_IN_USE |
|
45 |
#include "calenviewmanagerTraces.h" |
|
46 |
#endif |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
49 |
// CalenViewManager::CalenViewManager |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
// 2nd phase of construction. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
// |
45 | 54 |
CalenViewManager::CalenViewManager( CCalenController& aController) |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
55 |
: mController(aController) |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
56 |
{ |
51 | 57 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_CALENVIEWMANAGER_ENTRY ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
58 |
|
45 | 59 |
// Following block intializes member variables |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
60 |
mCalenEventViewer = NULL; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
61 |
mMonthViewDocLoader = NULL; |
45 | 62 |
mAgendaViewDocLoader = NULL; |
63 |
mAgendaViewAltDocLoader = NULL; |
|
64 |
mCalenAgendaView = NULL; |
|
65 |
mCalenMonthView = NULL; |
|
66 |
mCalenAgendaViewAlt = NULL; |
|
67 |
mSettingsView = NULL; |
|
68 |
mCalenDayView = NULL; |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
69 |
|
45 | 70 |
// Connect to instance view and entry view creation signals from agenda |
71 |
// interface |
|
72 |
connect(mController.agendaInterface(), SIGNAL(instanceViewCreationCompleted(int)), |
|
73 |
this, SLOT(handleInstanceViewCreation(int))); |
|
74 |
connect(mController.agendaInterface(), SIGNAL(entryViewCreationCompleted(int)), |
|
75 |
this, SLOT(handleEntryViewCreation(int))); |
|
51 | 76 |
connect(mController.agendaInterface(), SIGNAL(entriesChanged(QList<ulong>)), |
77 |
this, SLOT(handleEntriesChanged(QList<ulong>))); |
|
55 | 78 |
connect(mController.agendaInterface(), SIGNAL(entryUpdated(ulong)), |
79 |
this, SLOT(handleEntryUpdation(ulong))); |
|
80 |
connect(mController.agendaInterface(), SIGNAL(entryAdded(ulong)), |
|
81 |
this, SLOT(handleEntryUpdation(ulong))); |
|
51 | 82 |
OstTraceFunctionExit0( CALENVIEWMANAGER_CALENVIEWMANAGER_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
83 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
84 |
|
45 | 85 |
void CalenViewManager::SecondPhaseConstruction() |
86 |
{ |
|
51 | 87 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_SECONDPHASECONSTRUCTION_ENTRY ); |
45 | 88 |
|
89 |
// Check the Application Startup reason from Activity Manager |
|
90 |
int activityReason = qobject_cast<HbApplication*>(qApp)->activateReason(); |
|
91 |
||
92 |
// Check if calendar is launched thru XQService framework |
|
93 |
bool isFromServiceFrmWrk = XQServiceUtil::isService(); // Since activateReason |
|
94 |
//of hbapplication is not returning right value if the activity is started |
|
95 |
//as services so using the above line temporarily untill a fix is available in |
|
96 |
// hbappliacation. Need to remove this line after the fix is available for hbapplcation |
|
97 |
||
98 |
||
99 |
if (Hb::ActivationReasonActivity == activityReason) // Check if application is started |
|
100 |
// as an activity |
|
101 |
{ |
|
102 |
// Application is started from an activity |
|
103 |
// Extract activity data |
|
104 |
QVariant data = qobject_cast<HbApplication*>(qApp)->activateData(); |
|
105 |
// Restore state from activity data |
|
106 |
QByteArray serializedModel = data.toByteArray(); |
|
107 |
QDataStream stream(&serializedModel, QIODevice::ReadOnly); |
|
108 |
int viewId; // int declared for debugging purpose |
|
109 |
stream >> viewId; // read stream into an int |
|
110 |
||
111 |
mFirstView = viewId; |
|
112 |
if (ECalenMonthView == viewId) // Check if Activity was stored for month view |
|
113 |
{ |
|
114 |
loadMonthView(); // Load month view |
|
115 |
} |
|
116 |
else if (ECalenAgendaView == viewId) // Check if Activity was stored for agenda view |
|
117 |
{ |
|
118 |
loadAgendaView(); // Load agenda view |
|
119 |
} |
|
120 |
||
121 |
ActivateDefaultViewL(viewId); |
|
122 |
// Connect to the view ready signal so that we can construct other views |
|
123 |
// once this view is ready |
|
124 |
connect(&mController.MainWindow(), SIGNAL(viewReady()), |
|
125 |
this, SLOT(handleMainViewReady())); |
|
126 |
||
127 |
if (ECalenMonthView == viewId) // Check if Activity was stored for month view |
|
128 |
{ |
|
129 |
mController.MainWindow().addView(mCalenMonthView); // Add month view to main window |
|
130 |
mController.MainWindow().setCurrentView(mCalenMonthView); // Set month view as current view |
|
131 |
} |
|
132 |
else if (ECalenAgendaView == viewId) // Check if Activity was stored for agenda view |
|
133 |
{ |
|
134 |
mController.MainWindow().addView(mCalenAgendaView); // Add agenda view to main window |
|
135 |
mController.MainWindow().setCurrentView(mCalenAgendaView); // Set agenda view as current view |
|
136 |
} |
|
137 |
} else if (isFromServiceFrmWrk/*Hb::ActivationReasonService == activityReason*/) { |
|
138 |
// Dont load any views until our remote slot gets called in |
|
139 |
// calenserviceprovider.cpp |
|
140 |
// Just have an empty mainwindow |
|
141 |
} else { |
|
142 |
// Do the normal startup |
|
143 |
// Load the month view and active it and add it to main window |
|
144 |
mFirstView = ECalenMonthView; |
|
145 |
loadMonthView(); |
|
146 |
ActivateDefaultViewL(ECalenMonthView); |
|
147 |
// Connect to the view ready signal so that we construct other view |
|
148 |
// once this view is shown |
|
149 |
connect(&mController.MainWindow(), SIGNAL(viewReady()), |
|
150 |
this, SLOT(handleMainViewReady())); |
|
151 |
||
152 |
mController.MainWindow().addView(mCalenMonthView); |
|
153 |
mController.MainWindow().setCurrentView(mCalenMonthView); |
|
154 |
} |
|
155 |
||
156 |
||
51 | 157 |
OstTraceFunctionExit0( CALENVIEWMANAGER_SECONDPHASECONSTRUCTION_EXIT ); |
45 | 158 |
} |
159 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
160 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
161 |
// CalenViewManager::~CalenViewManager |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
162 |
// Destructor. |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
163 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
164 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
165 |
// |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
166 |
CalenViewManager::~CalenViewManager() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
167 |
{ |
51 | 168 |
OstTraceFunctionEntry0( DUP1_CALENVIEWMANAGER_CALENVIEWMANAGER_ENTRY ); |
169 |
||
45 | 170 |
if (mSettingsView) { |
171 |
delete mSettingsView; |
|
172 |
mSettingsView = 0; |
|
173 |
} |
|
174 |
if (mAgendaViewDocLoader) { |
|
175 |
delete mAgendaViewDocLoader; |
|
176 |
mAgendaViewDocLoader = 0; |
|
177 |
} |
|
178 |
if (mAgendaViewAltDocLoader) { |
|
179 |
delete mAgendaViewAltDocLoader; |
|
180 |
mAgendaViewAltDocLoader = 0; |
|
181 |
} |
|
182 |
if (mMonthViewDocLoader) { |
|
183 |
delete mMonthViewDocLoader; |
|
184 |
mMonthViewDocLoader = 0; |
|
185 |
} |
|
51 | 186 |
|
187 |
OstTraceFunctionExit0( DUP1_CALENVIEWMANAGER_CALENVIEWMANAGER_EXIT ); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
188 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
189 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
190 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
191 |
// CalenViewManager::constructAndActivateView |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
192 |
// Constructs and activates the requested view |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
193 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
194 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
195 |
// |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
196 |
void CalenViewManager::constructAndActivateView(int view) |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
197 |
{ |
51 | 198 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_CONSTRUCTANDACTIVATEVIEW_ENTRY ); |
199 |
||
200 |
// We are here because, some other application is launching calendar with |
|
45 | 201 |
// the view, hence connect to viewReady() signal to do any lazy loading |
202 |
// in the slot |
|
203 |
||
204 |
// Connect to the view ready signal so that we construct other view |
|
205 |
// once this view is shown |
|
206 |
connect(&mController.MainWindow(), SIGNAL(viewReady()), |
|
207 |
this, SLOT(handleMainViewReady())); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
208 |
if (view == ECalenMonthView) { |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
209 |
mFirstView = ECalenMonthView; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
210 |
loadMonthView(); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
211 |
ActivateDefaultViewL(ECalenMonthView); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
212 |
// Add month view to mainwindow. |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
213 |
mController.MainWindow().addView(mCalenMonthView); |
45 | 214 |
mController.MainWindow().setCurrentView(mCalenMonthView); |
215 |
} else if (view == ECalenAgendaView) { |
|
216 |
mFirstView = ECalenAgendaView; |
|
217 |
loadAgendaView(); |
|
218 |
ActivateDefaultViewL(ECalenAgendaView); |
|
219 |
// Add agenda view to mainwindow. |
|
220 |
mController.MainWindow().addView(mCalenAgendaView); |
|
221 |
mController.MainWindow().setCurrentView(mCalenAgendaView); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
222 |
} |
51 | 223 |
OstTraceFunctionExit0( CALENVIEWMANAGER_CONSTRUCTANDACTIVATEVIEW_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
224 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
225 |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
226 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
227 |
// CalenViewManager::loadMonthView |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
228 |
// Loads month view frm the docml |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
229 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
230 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
231 |
// |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
232 |
void CalenViewManager::loadMonthView() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
233 |
{ |
51 | 234 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_LOADMONTHVIEW_ENTRY ); |
235 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
236 |
bool loadSuccess = false; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
237 |
Qt::Orientation currentOrienation = mController.MainWindow().orientation(); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
238 |
// Create the month view docloader object. |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
239 |
mMonthViewDocLoader = new CalenDocLoader(mController); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
240 |
mMonthViewDocLoader->load(CALEN_MONTHVIEW_XML_FILE, &loadSuccess); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
241 |
Q_ASSERT_X(loadSuccess, "calenviewmanager.cpp", |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
242 |
"Unable to load month view XML"); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
243 |
// Based on the current orientation, load the appropriate section |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
244 |
if (Qt::Vertical == currentOrienation) { |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
245 |
mMonthViewDocLoader->load(CALEN_MONTHVIEW_XML_FILE, |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
246 |
CALEN_PORTRAIT, &loadSuccess); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
247 |
} else { |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
248 |
mMonthViewDocLoader->load(CALEN_MONTHVIEW_XML_FILE, |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
249 |
CALEN_LANDSCAPE, &loadSuccess); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
250 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
251 |
Q_ASSERT_X(loadSuccess, "calenviewmanager.cpp", "Unable to load XML"); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
252 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
253 |
// Get the calenmonth view from the loader. |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
254 |
mCalenMonthView = static_cast<CalenMonthView *> |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
255 |
(mMonthViewDocLoader->findWidget(CALEN_MONTHVIEW)); |
45 | 256 |
Q_ASSERT_X(mCalenMonthView, "calenviewmanager.cpp", |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
257 |
"Unable to load calenMonth view"); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
258 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
259 |
// Setup the month view. |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
260 |
mCalenMonthView->setupView(mMonthViewDocLoader); |
51 | 261 |
|
262 |
OstTraceFunctionExit0( CALENVIEWMANAGER_LOADMONTHVIEW_EXIT ); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
263 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
264 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
265 |
// ---------------------------------------------------------------------------- |
45 | 266 |
// CalenViewManager::loadAgendaView |
267 |
// Loads the agenda view frm the docml |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
268 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
269 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
270 |
// |
45 | 271 |
void CalenViewManager::loadAgendaView() |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
272 |
{ |
51 | 273 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_LOADAGENDAVIEW_ENTRY ); |
274 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
275 |
bool loadSuccess = false; |
45 | 276 |
// Create the agenda view docloader object. |
277 |
mAgendaViewDocLoader = new CalenDocLoader(mController); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
278 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
279 |
// Load default section |
45 | 280 |
mAgendaViewDocLoader->load(CALEN_AGENDAVIEW_XML_FILE, &loadSuccess); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
281 |
if (!loadSuccess) { |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
282 |
qFatal("calenviewmanager.cpp : Unable to load XML"); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
283 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
284 |
|
45 | 285 |
// Get the calenagenda view from the loader |
286 |
mCalenAgendaView = static_cast<CalenAgendaView *> (mAgendaViewDocLoader->findWidget(CALEN_AGENDAVIEW)); |
|
287 |
if (!mCalenAgendaView) { |
|
288 |
qFatal("calenviewmanager.cpp : Unable to find agenda view"); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
289 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
290 |
|
45 | 291 |
// Setup the agenda view |
292 |
mCalenAgendaView->setupView(mAgendaViewDocLoader); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
293 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
294 |
// The following code is done to provide swipe support |
45 | 295 |
// in agenda view. Idea is to create two views and keep |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
296 |
// switiching between these two using view switch effects |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
297 |
// to provide an illusion of flow to the user |
45 | 298 |
loadAlternateAgendaView(); |
299 |
||
51 | 300 |
OstTraceFunctionExit0( CALENVIEWMANAGER_LOADAGENDAVIEW_EXIT ); |
45 | 301 |
} |
302 |
||
303 |
// ---------------------------------------------------------------------------- |
|
55 | 304 |
// CalenViewManager::loadDayView |
305 |
// Loads day view from the docml |
|
306 |
// ---------------------------------------------------------------------------- |
|
307 |
void CalenViewManager::loadDayView() |
|
308 |
{ |
|
309 |
bool loadSuccess = false; |
|
310 |
||
311 |
// Create the docloader object |
|
312 |
CalenDocLoader *docLoader = new CalenDocLoader(mController); |
|
313 |
||
314 |
if (docLoader) { |
|
315 |
docLoader->load(CALEN_DAYVIEW_DOCML, &loadSuccess); |
|
316 |
if (!loadSuccess) { |
|
317 |
qFatal("calenviewmanager.cpp : Unable to load day view XML"); |
|
318 |
} |
|
319 |
||
320 |
// Get the CalenDayView object from the loader |
|
321 |
mCalenDayView = static_cast<CalenDayView *> |
|
322 |
(docLoader->findWidget(CALEN_DAYVIEW)); |
|
323 |
if (!mCalenDayView) { |
|
324 |
qFatal("calenviewmanager.cpp : Unable to find day view"); |
|
325 |
} |
|
326 |
||
327 |
// Set up the day view - day view takes the ownership |
|
328 |
mCalenDayView->setupView(docLoader); |
|
329 |
} |
|
330 |
} |
|
331 |
||
332 |
// ---------------------------------------------------------------------------- |
|
45 | 333 |
// CalenViewManager::handleMainViewReady |
334 |
// Slot to handle viewReady() signal from mainwindow |
|
335 |
// (other items were commented in a header). |
|
336 |
// ---------------------------------------------------------------------------- |
|
337 |
// |
|
338 |
void CalenViewManager::handleMainViewReady() |
|
339 |
{ |
|
51 | 340 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_HANDLEMAINVIEWREADY_ENTRY ); |
341 |
||
45 | 342 |
// Construct the month view part that is kept for lazy loading |
343 |
if (mCalenMonthView) { |
|
344 |
mCalenMonthView->doLazyLoading(); |
|
345 |
} |
|
346 |
||
347 |
// Construct other views |
|
348 |
constructOtherViews(); |
|
349 |
||
350 |
// Install the event filter for the controller once the view is ready |
|
351 |
// so that system language/locale changes can be handled |
|
352 |
//hbInstance->allMainWindows().first()->installEventFilter(&mController); |
|
353 |
||
354 |
// disconnect the view ready signal as we dont need it anymore |
|
355 |
disconnect(&mController.MainWindow(), SIGNAL(viewReady()), |
|
356 |
this, SLOT(handleMainViewReady())); |
|
51 | 357 |
|
358 |
OstTraceFunctionExit0( CALENVIEWMANAGER_HANDLEMAINVIEWREADY_EXIT ); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
359 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
360 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
361 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
362 |
// CalenViewManager::constructOtherViews |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
363 |
// Constructs the other views apart frm firstview and adds them to main window |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
364 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
365 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
366 |
// |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
367 |
void CalenViewManager::constructOtherViews() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
368 |
{ |
51 | 369 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_CONSTRUCTOTHERVIEWS_ENTRY ); |
370 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
371 |
// Load all other views except mFirstView |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
372 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
373 |
// NOTE: Right now, since Calendar has only two views, month view |
45 | 374 |
// and agenda view, when client launches agenda view, then there is no need |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
375 |
// to construct the month view as per UI REQ., but tomorrow if new views |
45 | 376 |
// come after agenda view, then we need to construct those views if they are |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
377 |
// native views. Right now, there is a event viewer but its not a native |
45 | 378 |
// view. Hence, if agenda view is launched, dont construct month view |
379 |
if (mFirstView != ECalenAgendaView) // check if agenda view is not already loaded |
|
380 |
{ |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
381 |
// Load all other views |
45 | 382 |
loadAgendaView(); |
383 |
||
384 |
if (!mCalenDayView) { |
|
55 | 385 |
loadDayView(); |
45 | 386 |
} |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
387 |
} |
45 | 388 |
else //agenda view was launched as first view |
389 |
{ |
|
390 |
// No implementation yet. UI specs not clear |
|
391 |
// to be commented in with some more code once UI specs is frozen |
|
392 |
// for agenda view launching as first view after it was saved as activity |
|
393 |
// when it was launched from month view |
|
394 |
// loadMonthView(); |
|
395 |
// mCalenMonthView->doLazyLoading(); |
|
396 |
} |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
397 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
398 |
// Setup the settings view |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
399 |
mSettingsView = new CalenSettingsView(mController.Services()); |
51 | 400 |
|
401 |
OstTraceFunctionExit0( CALENVIEWMANAGER_CONSTRUCTOTHERVIEWS_EXIT ); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
402 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
403 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
404 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
405 |
// CalenViewManager::getFirstView |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
406 |
// Returns the first view |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
407 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
408 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
409 |
// |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
410 |
int CalenViewManager::getFirstView() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
411 |
{ |
51 | 412 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_GETFIRSTVIEW_ENTRY ); |
413 |
||
414 |
OstTraceFunctionExit0( CALENVIEWMANAGER_GETFIRSTVIEW_EXIT ); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
415 |
return mFirstView; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
416 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
417 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
418 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
419 |
// CalenViewManager::showNextDay |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
420 |
// other items were commented in a header |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
421 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
422 |
// |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
423 |
void CalenViewManager::showNextDay() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
424 |
{ |
51 | 425 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_SHOWNEXTDAY_ENTRY ); |
426 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
427 |
// Set the context for the next day |
45 | 428 |
QDateTime currentDay = mController.Services().Context().focusDateAndTime(); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
429 |
currentDay = currentDay.addDays(1); |
45 | 430 |
mController.Services().Context().setFocusDate(currentDay); |
431 |
mCurrentViewId = ECalenAgendaView; |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
432 |
// Check which is the currently activated view |
45 | 433 |
if (mController.MainWindow().currentView() == mCalenAgendaView) { |
434 |
mCalenAgendaView->disconnectAboutToQuitEvent(); // disconnect mCalenAgendaView to get aboutToQuit Events |
|
435 |
HbEffect::add(mCalenAgendaView, |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
436 |
":/fxml/view_hide", |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
437 |
"hide"); |
45 | 438 |
HbEffect::add(mCalenAgendaViewAlt, |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
439 |
":/fxml/view_show", |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
440 |
"show"); |
45 | 441 |
// Set the other agenda view as the current view |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
442 |
// and animate to provide illusion of swipe |
45 | 443 |
// It would also connect for aboutToQuit events |
444 |
mCalenAgendaViewAlt->doPopulation(); |
|
445 |
mController.MainWindow().setCurrentView(mCalenAgendaViewAlt, true, Hb::ViewSwitchUseNormalAnim); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
446 |
} else { |
45 | 447 |
mCalenAgendaViewAlt->disconnectAboutToQuitEvent(); // disconnect mCalenAgendaViewAlt to get aboutToQuit Events |
448 |
HbEffect::add(mCalenAgendaViewAlt, |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
449 |
":/fxml/view_hide", |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
450 |
"hide"); |
45 | 451 |
HbEffect::add(mCalenAgendaView, |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
452 |
":/fxml/view_show", |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
453 |
"show"); |
45 | 454 |
// It would also connect for aboutToQuit events |
455 |
mCalenAgendaView->doPopulation(); |
|
456 |
mController.MainWindow().setCurrentView(mCalenAgendaView, true, Hb::ViewSwitchUseNormalAnim); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
457 |
} |
51 | 458 |
OstTraceFunctionExit0( CALENVIEWMANAGER_SHOWNEXTDAY_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
459 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
460 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
461 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
462 |
// CalenViewManager::showPrevDay |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
463 |
// other items were commented in a header |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
464 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
465 |
// |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
466 |
void CalenViewManager::showPrevDay() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
467 |
{ |
51 | 468 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_SHOWPREVDAY_ENTRY ); |
469 |
||
45 | 470 |
QDateTime currentDay = mController.Services().Context().focusDateAndTime(); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
471 |
currentDay = currentDay.addDays(-1); |
45 | 472 |
mController.Services().Context().setFocusDate(currentDay); |
473 |
mCurrentViewId = ECalenAgendaView; |
|
474 |
if (mController.MainWindow().currentView() == mCalenAgendaView) { |
|
475 |
mCalenAgendaView->disconnectAboutToQuitEvent(); // disconnect mCalenAgendaView to get aboutToQuit Events |
|
476 |
HbEffect::add(mCalenAgendaView, |
|
477 |
":/fxml/view_hide_back", |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
478 |
"hide"); |
45 | 479 |
HbEffect::add(mCalenAgendaViewAlt, |
480 |
":/fxml/view_show_back", |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
481 |
"show"); |
45 | 482 |
// It would also connect for aboutToQuit events |
483 |
mCalenAgendaViewAlt->doPopulation(); |
|
484 |
mController.MainWindow().setCurrentView(mCalenAgendaViewAlt, true, Hb::ViewSwitchUseNormalAnim); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
485 |
} else { |
45 | 486 |
mCalenAgendaViewAlt->disconnectAboutToQuitEvent(); // disconnect mCalenAgendaViewAlt to get aboutToQuit Events |
487 |
HbEffect::add(mCalenAgendaViewAlt, |
|
488 |
":/fxml/view_hide_back", |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
489 |
"hide"); |
45 | 490 |
HbEffect::add(mCalenAgendaView, |
491 |
":/fxml/view_show_back", |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
492 |
"show"); |
45 | 493 |
// It would also connect for aboutToQuit events |
494 |
mCalenAgendaView->doPopulation(); |
|
495 |
mController.MainWindow().setCurrentView(mCalenAgendaView, true, Hb::ViewSwitchUseNormalAnim); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
496 |
} |
51 | 497 |
|
498 |
OstTraceFunctionExit0( CALENVIEWMANAGER_SHOWPREVDAY_EXIT ); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
499 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
500 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
501 |
// ---------------------------------------------------------------------------- |
45 | 502 |
// CalenViewManager::removePreviousView |
503 |
// Remove the previous view from main window |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
504 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
505 |
// |
45 | 506 |
void CalenViewManager::removePreviousView() |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
507 |
{ |
51 | 508 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_REMOVEPREVIOUSVIEW_ENTRY ); |
509 |
||
45 | 510 |
if (ECalenAgendaView == mCurrentViewId) { |
511 |
mCalenAgendaView->clearListModel(); |
|
512 |
mCalenAgendaViewAlt->clearListModel(); |
|
513 |
mController.MainWindow().removeView(mCalenAgendaView); |
|
514 |
mController.MainWindow().removeView(mCalenAgendaViewAlt); |
|
515 |
} else if (ECalenDayView == mCurrentViewId) { |
|
516 |
mController.MainWindow().removeView(mCalenDayView); |
|
517 |
} else { |
|
518 |
if (ECalenMonthView == mCurrentViewId) { |
|
519 |
mController.MainWindow().removeView(mCalenMonthView); |
|
520 |
} |
|
521 |
} |
|
522 |
||
51 | 523 |
OstTraceFunctionExit0( CALENVIEWMANAGER_REMOVEPREVIOUSVIEW_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
524 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
525 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
526 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
527 |
// CalenViewManager::~ActivateDefaultViewL |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
528 |
// Activates the default view, as retrieved from settings. |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
529 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
530 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
531 |
// |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
532 |
void CalenViewManager::ActivateDefaultViewL(int defaultView) |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
533 |
{ |
51 | 534 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_ACTIVATEDEFAULTVIEWL_ENTRY ); |
535 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
536 |
mCurrentViewId = defaultView; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
537 |
if (ECalenMonthView == defaultView) { |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
538 |
mCalenMonthView->doPopulation(); |
45 | 539 |
} else if (ECalenAgendaView == defaultView) { |
540 |
mCalenAgendaView->doPopulation(); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
541 |
} |
51 | 542 |
OstTraceFunctionExit0( CALENVIEWMANAGER_ACTIVATEDEFAULTVIEWL_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
543 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
544 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
545 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
546 |
// Refresh current view. |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
547 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
548 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
549 |
void CalenViewManager::refreshCurrentViewL() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
550 |
{ |
51 | 551 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_REFRESHCURRENTVIEWL_ENTRY ); |
552 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
553 |
activateCurrentView(); |
51 | 554 |
|
555 |
OstTraceFunctionExit0( CALENVIEWMANAGER_REFRESHCURRENTVIEWL_EXIT ); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
556 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
557 |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
558 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
559 |
// Activate current view. |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
560 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
561 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
562 |
void CalenViewManager::activateCurrentView() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
563 |
{ |
51 | 564 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_ACTIVATECURRENTVIEW_ENTRY ); |
565 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
566 |
switch (mCurrentViewId) { |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
567 |
case ECalenMonthView: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
568 |
mCalenMonthView->doPopulation(); |
23
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
569 |
mController.MainWindow().setCurrentView(mCalenMonthView); |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
570 |
break; |
45 | 571 |
case ECalenAgendaView: |
572 |
if (mController.MainWindow().currentView() == mCalenAgendaView) { |
|
23
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
573 |
// This happens when settings view or event viewer is opened |
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
574 |
// from the agenda view. Simply repopulate the view |
45 | 575 |
if (mCalenAgendaView) { |
576 |
mCalenAgendaView->doPopulation(); |
|
577 |
mController.MainWindow().setCurrentView(mCalenAgendaView); |
|
578 |
} |
|
579 |
} else if (mController.MainWindow().currentView() == mCalenAgendaViewAlt){ |
|
23
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
580 |
// This happens when settings view or event viewer is opened |
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
581 |
// from the agenda view. Simply repopulate the view |
45 | 582 |
if (mCalenAgendaViewAlt) { |
583 |
mCalenAgendaViewAlt->doPopulation(); |
|
584 |
mController.MainWindow().setCurrentView(mCalenAgendaViewAlt); |
|
585 |
} |
|
23
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
586 |
} else { |
45 | 587 |
// This is called whenever the agenda view is opened from the month |
588 |
// view. Since the agenda view is not added to the mainwindow, |
|
589 |
// add the agenda views to mainwindow and set any one of them as |
|
23
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
590 |
// current view |
45 | 591 |
if (mCalenAgendaView) { |
592 |
mCalenAgendaView->doPopulation(); |
|
593 |
mController.MainWindow().addView(mCalenAgendaView); |
|
594 |
mController.MainWindow().setCurrentView(mCalenAgendaView); |
|
595 |
mController.MainWindow().addView(mCalenAgendaViewAlt); |
|
596 |
} |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
597 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
598 |
break; |
45 | 599 |
case ECalenShowSettings: |
600 |
mSettingsView->refreshView(); |
|
601 |
break; |
|
602 |
case ECalenDayView: |
|
603 |
mCalenDayView->doPopulation(); |
|
604 |
mController.MainWindow().setCurrentView(mCalenDayView); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
605 |
break; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
606 |
} |
51 | 607 |
|
608 |
OstTraceFunctionExit0( CALENVIEWMANAGER_ACTIVATECURRENTVIEW_EXIT ); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
609 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
610 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
611 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
612 |
// CalenViewManager::launchEventView |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
613 |
// Launch event view. |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
614 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
615 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
616 |
// |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
617 |
void CalenViewManager::launchEventView() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
618 |
{ |
51 | 619 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_LAUNCHEVENTVIEW_ENTRY ); |
620 |
||
45 | 621 |
// capture cureent view in case app closed/quits from AgendaEventViewer |
622 |
if (mCalenMonthView) { |
|
623 |
mCalenMonthView->captureScreenshot(true); |
|
624 |
} |
|
625 |
else if (mCalenAgendaView) { |
|
626 |
mCalenAgendaView->captureScreenshot(true); |
|
627 |
} |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
628 |
MCalenContext& context = mController.Services().Context(); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
629 |
AgendaEntry viewEntry= mController.Services().agendaInterface()->fetchById( |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
630 |
context.instanceId().mEntryLocalUid ); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
631 |
if (viewEntry.isRepeating() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
632 |
&& viewEntry.type() != AgendaEntry::TypeTodo) { |
45 | 633 |
QDateTime startDateTime = context.focusDateAndTime(); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
634 |
viewEntry.setStartAndEndTime(startDateTime, |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
635 |
startDateTime.addSecs(viewEntry.durationInSecs())); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
636 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
637 |
mCalenEventViewer = new AgendaEventViewer( |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
638 |
mController.Services().agendaInterface(), this); |
23
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
639 |
connect(mCalenEventViewer, SIGNAL(viewingCompleted(const QDate)), |
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
640 |
this, SLOT(handleViewingCompleted(const QDate))); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
641 |
connect(mCalenEventViewer, SIGNAL(editingStarted()), |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
642 |
this, SLOT(handleEditingStarted())); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
643 |
connect(mCalenEventViewer, SIGNAL(editingCompleted()), |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
644 |
this, SLOT(handleEditingCompleted())); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
645 |
connect(mCalenEventViewer, SIGNAL(deletingStarted()), |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
646 |
this, SLOT(handleDeletingStarted())); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
647 |
connect(mCalenEventViewer, SIGNAL(deletingCompleted()), |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
648 |
this, SLOT(handleDeletingCompleted())); |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
649 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
650 |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
651 |
// Launch agenda event viewer |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
652 |
mCalenEventViewer->view(viewEntry, AgendaEventViewer::ActionEditDelete); |
51 | 653 |
OstTraceFunctionExit0( CALENVIEWMANAGER_LAUNCHEVENTVIEW_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
654 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
655 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
656 |
// ---------------------------------------------------------------------------- |
45 | 657 |
// CalenViewManager::loadAlternateAgendaView |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
658 |
// other items were commented in a header |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
659 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
660 |
// |
45 | 661 |
void CalenViewManager::loadAlternateAgendaView() |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
662 |
{ |
51 | 663 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_LOADALTERNATEAGENDAVIEW_ENTRY ); |
664 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
665 |
bool loadSuccess = false; |
45 | 666 |
// Create the agenda view docloader object. |
667 |
mAgendaViewAltDocLoader = new CalenDocLoader(mController); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
668 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
669 |
// Load default section |
45 | 670 |
mAgendaViewAltDocLoader->load(CALEN_AGENDAVIEW_XML_FILE, &loadSuccess); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
671 |
if (!loadSuccess) { |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
672 |
qFatal("calenviewmanager.cpp : Unable to load XML"); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
673 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
674 |
|
45 | 675 |
// Get the calenagenda view from the loader |
676 |
mCalenAgendaViewAlt = static_cast<CalenAgendaView *> (mAgendaViewAltDocLoader->findWidget(CALEN_AGENDAVIEW)); |
|
677 |
if (!mCalenAgendaViewAlt) { |
|
678 |
qFatal("calenviewmanager.cpp : Unable to find alternate agenda view"); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
679 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
680 |
|
45 | 681 |
// Setup the agenda view |
682 |
mCalenAgendaViewAlt->setupView(mAgendaViewAltDocLoader); |
|
51 | 683 |
OstTraceFunctionExit0( CALENVIEWMANAGER_LOADALTERNATEAGENDAVIEW_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
684 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
685 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
686 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
687 |
// CalenViewManager::HandleCommandL |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
688 |
// Handles view manager commands. |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
689 |
// @return ETrue if command is handled, EFalse otherwise |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
690 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
691 |
// |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
692 |
TBool CalenViewManager::HandleCommandL(const TCalenCommand& command) |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
693 |
{ |
51 | 694 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_HANDLECOMMANDL_ENTRY ); |
695 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
696 |
TBool commandUsed(EFalse); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
697 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
698 |
switch (command.Command()) { |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
699 |
case ECalenMonthView: |
45 | 700 |
// First remove the previous native view before |
701 |
// we set the mCurrentViewId with the current view |
|
702 |
removePreviousView(); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
703 |
// Add month view to mainwindow. |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
704 |
mController.MainWindow().addView(mCalenMonthView); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
705 |
mCurrentViewId = ECalenMonthView; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
706 |
activateCurrentView(); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
707 |
break; |
45 | 708 |
case ECalenAgendaView: |
709 |
// First remove the previous native view before |
|
710 |
// we set the mCurrentViewId with the current view |
|
711 |
removePreviousView(); |
|
712 |
mCurrentViewId = ECalenAgendaView; |
|
713 |
activateCurrentView(); |
|
714 |
break; |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
715 |
case ECalenDayView: |
45 | 716 |
{ |
55 | 717 |
// First add new view |
45 | 718 |
mController.MainWindow().addView(mCalenDayView); |
55 | 719 |
|
720 |
// Removes current view |
|
721 |
// Notice: removing view should be done after new view is set as current to |
|
722 |
// avoid situation that there is no current view in application |
|
723 |
removePreviousView(); |
|
724 |
||
725 |
// Sets and activates day view |
|
726 |
mCurrentViewId = ECalenDayView; |
|
727 |
activateCurrentView(); |
|
45 | 728 |
} |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
729 |
break; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
730 |
case ECalenEventView: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
731 |
launchEventView(); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
732 |
break; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
733 |
case ECalenStartActiveStep: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
734 |
activateCurrentView(); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
735 |
break; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
736 |
case ECalenShowNextDay: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
737 |
showNextDay(); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
738 |
break; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
739 |
case ECalenShowPrevDay: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
740 |
showPrevDay(); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
741 |
break; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
742 |
} |
51 | 743 |
OstTraceFunctionExit0( CALENVIEWMANAGER_HANDLECOMMANDL_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
744 |
return commandUsed; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
745 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
746 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
747 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
748 |
// CalenViewManager::HandleNotification |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
749 |
// Handles notifications. |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
750 |
// (other items were commented in a header). |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
751 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
752 |
// |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
753 |
void CalenViewManager::HandleNotification( |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
754 |
const TCalenNotification notification) |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
755 |
{ |
51 | 756 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_HANDLENOTIFICATION_ENTRY ); |
757 |
||
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
758 |
switch (notification) { |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
759 |
case ECalenNotifyExternalDatabaseChanged: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
760 |
case ECalenNotifyDialogClosed: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
761 |
case ECalenNotifyMultipleEntriesDeleted: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
762 |
case ECalenNotifyEntrySaved: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
763 |
case ECalenNotifyEntryDeleted: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
764 |
case ECalenNotifyInstanceDeleted: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
765 |
case ECalenNotifyEntryClosed: |
45 | 766 |
case ECalenNotifySystemLocaleChanged: |
55 | 767 |
case ECalenNotifySystemTimeChanged: |
51 | 768 |
case ECalenNotifySystemLanguageChanged: { |
55 | 769 |
|
770 |
if (notification == ECalenNotifySystemTimeChanged) { |
|
771 |
MCalenContext &context = mController.context(); |
|
772 |
QDateTime defaultTime = context.defaultCalTimeForViewsL(); |
|
773 |
context.setFocusDateAndTime(defaultTime); |
|
774 |
} |
|
775 |
activateCurrentView(); |
|
776 |
if (mCalenMonthView) { |
|
777 |
mCalenMonthView->captureScreenshot(); |
|
778 |
} else if (mCalenAgendaView) { |
|
779 |
mCalenAgendaView->captureScreenshot(); |
|
780 |
} |
|
51 | 781 |
} |
45 | 782 |
break; |
51 | 783 |
case ECalenNotifySettingsClosed: { |
45 | 784 |
//when setting view closed , switch to the previous view |
785 |
mCurrentViewId = mPreviousViewsId ; |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
786 |
mController.Services().IssueCommandL(ECalenStartActiveStep); |
45 | 787 |
|
788 |
// invalidate captured screenshots as either agenda view is activated now |
|
789 |
if (mCalenMonthView) { |
|
790 |
mCalenMonthView->captureScreenshot(); |
|
791 |
} else if (mCalenAgendaView) { |
|
792 |
mCalenAgendaView->captureScreenshot(); |
|
793 |
} |
|
794 |
||
795 |
} |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
796 |
break; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
797 |
default: |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
798 |
break; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
799 |
} |
51 | 800 |
OstTraceFunctionExit0( CALENVIEWMANAGER_HANDLENOTIFICATION_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
801 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
802 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
803 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
804 |
// CalenViewManager::settingsView |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
805 |
// Returns the settings view |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
806 |
// (other items were commented in a header). |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
807 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
808 |
// |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
809 |
CalenSettingsView* CalenViewManager::settingsView() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
810 |
{ |
51 | 811 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_SETTINGSVIEW_ENTRY ); |
812 |
||
813 |
OstTraceFunctionExit0( CALENVIEWMANAGER_SETTINGSVIEW_EXIT ); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
814 |
return mSettingsView; |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
815 |
} |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
816 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
817 |
// ---------------------------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
818 |
// CalenViewManager::handleViewingCompleted |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
819 |
// Slot to handle signal viewingCompleted by the agenda event viewer |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
820 |
// (other items were commented in a header). |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
821 |
// ---------------------------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
822 |
// |
23
fd30d51f876b
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
823 |
void CalenViewManager::handleViewingCompleted(const QDate date) |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
824 |
{ |
55 | 825 |
Q_UNUSED(date); |
51 | 826 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_HANDLEVIEWINGCOMPLETED_ENTRY ); |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
827 |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
828 |
// Cleanup. |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
829 |
mCalenEventViewer->deleteLater(); |
55 | 830 |
if (!date.isNull() && date.isValid()) { |
831 |
mController.Services().Context().setFocusDate(QDateTime(date)); |
|
832 |
} |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
833 |
mController.Services().IssueNotificationL(ECalenNotifyEntryClosed); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
834 |
|
45 | 835 |
// invalidate captured screenshots as either agenda view is activated now |
836 |
if (mCalenMonthView) { |
|
837 |
mCalenMonthView->captureScreenshot(); |
|
838 |
} else if (mCalenAgendaView) { |
|
839 |
mCalenAgendaView->captureScreenshot(); |
|
840 |
} |
|
51 | 841 |
OstTraceFunctionExit0( CALENVIEWMANAGER_HANDLEVIEWINGCOMPLETED_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
842 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
843 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
844 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
845 |
// CalenViewManager::handleEditingStarted |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
846 |
// Slot to handle signal editingStarted by the agenda event viewer |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
847 |
// (other items were commented in a header). |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
848 |
// ---------------------------------------------------------------------------- |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
849 |
// |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
850 |
void CalenViewManager::handleEditingStarted() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
851 |
{ |
51 | 852 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_HANDLEEDITINGSTARTED_ENTRY ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
853 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
854 |
mController.IssueCommandL(ECalenEditEntryFromViewer); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
855 |
|
51 | 856 |
OstTraceFunctionExit0( CALENVIEWMANAGER_HANDLEEDITINGSTARTED_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
857 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
858 |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
859 |
// ---------------------------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
860 |
// CalenViewManager::handleEditingCompleted |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
861 |
// Slot to handle signal editingCompleted by the agenda event viewer |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
862 |
// (other items were commented in a header). |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
863 |
// ---------------------------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
864 |
// |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
865 |
void CalenViewManager::handleEditingCompleted() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
866 |
{ |
51 | 867 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_HANDLEEDITINGCOMPLETED_ENTRY ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
868 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
869 |
mController.Services().IssueNotificationL(ECalenNotifyEditorClosedFromViewer); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
870 |
|
51 | 871 |
OstTraceFunctionExit0( CALENVIEWMANAGER_HANDLEEDITINGCOMPLETED_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
872 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
873 |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
874 |
// ---------------------------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
875 |
// CalenViewManager::handleDeletingStarted |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
876 |
// Slot to handle signal deletingStarted by the agenda event viewer |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
877 |
// (other items were commented in a header). |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
878 |
// ---------------------------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
879 |
// |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
880 |
void CalenViewManager::handleDeletingStarted() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
881 |
{ |
51 | 882 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_HANDLEDELETINGSTARTED_ENTRY ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
883 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
884 |
mController.IssueCommandL(ECalenDeleteEntryFromViewer); |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
885 |
|
51 | 886 |
OstTraceFunctionExit0( CALENVIEWMANAGER_HANDLEDELETINGSTARTED_EXIT ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
887 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
888 |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
889 |
// ---------------------------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
890 |
// CalenViewManager::handleDeletingCompleted |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
891 |
// Slot to handle signal deletingCompleted by the agenda event viewer |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
892 |
// (other items were commented in a header). |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
893 |
// ---------------------------------------------------------------------------- |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
894 |
// |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
895 |
void CalenViewManager::handleDeletingCompleted() |
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
896 |
{ |
51 | 897 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_HANDLEDELETINGCOMPLETED_ENTRY ); |
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
898 |
|
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
899 |
mController.Services().IssueNotificationL(ECalenNotifyEntryDeleted); |
45 | 900 |
|
901 |
// invalidate captured screenshots as either month view or agenda view is activated now |
|
902 |
if (mCalenMonthView) { |
|
903 |
mCalenMonthView->captureScreenshot(); |
|
904 |
} else if (mCalenAgendaView) { |
|
905 |
mCalenAgendaView->captureScreenshot(); |
|
906 |
} |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
907 |
|
51 | 908 |
OstTraceFunctionExit0( CALENVIEWMANAGER_HANDLEDELETINGCOMPLETED_EXIT ); |
45 | 909 |
} |
910 |
||
911 |
// ---------------------------------------------------------------------------- |
|
912 |
// CalenViewManager::handleInstanceViewCreation |
|
913 |
// Slot to handle completion of instance view creation |
|
914 |
// (other items were commented in a header). |
|
915 |
// ---------------------------------------------------------------------------- |
|
916 |
// |
|
917 |
void CalenViewManager::handleInstanceViewCreation(int status) |
|
918 |
{ |
|
51 | 919 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_HANDLEINSTANCEVIEWCREATION_ENTRY ); |
920 |
||
45 | 921 |
Q_UNUSED(status); |
922 |
// handleInstanceViewCreation function is called only once. Now that the instance |
|
923 |
// view creation is successfull. Events need to be populated on screen |
|
924 |
// Ideal colution should be to call a uniform function, e.g. PopulateEvents |
|
925 |
// where PopulateEvents should be implemeted by all views. Since the current |
|
926 |
// solution for the month view implements the construction in two phases so |
|
927 |
// it needs to be refactored and a common solution needs to be put here. So |
|
928 |
// that code doesn't break if another view is added tomorow |
|
929 |
if (mCalenMonthView) { |
|
930 |
mCalenMonthView->fetchEntriesAndUpdateModel(); |
|
931 |
} |
|
932 |
else if (mCalenAgendaView) { |
|
933 |
mCalenAgendaView->doPopulation(); |
|
934 |
} |
|
55 | 935 |
// Calls the emitAppReady function of CalenController. Need to emit this |
936 |
// signal after the view is fully constructed & populated |
|
937 |
// with actual data and ready to be used. So entry view & instance view |
|
938 |
// needs to be created so that a new entry can also be created. Finally |
|
939 |
// NotesApplication object needs to emit applicationReady Signal. |
|
940 |
mController.emitAppReady(); |
|
51 | 941 |
|
942 |
OstTraceFunctionExit0( CALENVIEWMANAGER_HANDLEINSTANCEVIEWCREATION_EXIT ); |
|
45 | 943 |
} |
944 |
||
945 |
// ---------------------------------------------------------------------------- |
|
946 |
// CalenViewManager::handleDeletingCompleted |
|
947 |
// Slot to handle completion of entry view creation |
|
948 |
// (other items were commented in a header). |
|
949 |
// ---------------------------------------------------------------------------- |
|
950 |
// |
|
951 |
void CalenViewManager::handleEntryViewCreation(int status) |
|
952 |
{ |
|
51 | 953 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_HANDLEENTRYVIEWCREATION_ENTRY ); |
954 |
||
45 | 955 |
// Nothing Yet |
956 |
Q_UNUSED(status); |
|
51 | 957 |
|
958 |
OstTraceFunctionExit0( CALENVIEWMANAGER_HANDLEENTRYVIEWCREATION_EXIT ); |
|
45 | 959 |
} |
960 |
||
961 |
// ---------------------------------------------------------------------------- |
|
51 | 962 |
// CalenViewManager::handleEntriesChanged |
963 |
// this function will be called when someone else has changed the database |
|
964 |
// ---------------------------------------------------------------------------- |
|
965 |
// |
|
966 |
void CalenViewManager::handleEntriesChanged(QList<ulong> ids) |
|
967 |
{ |
|
55 | 968 |
Q_UNUSED(ids); |
51 | 969 |
// Update and refresh the view. |
970 |
activateCurrentView(); |
|
45 | 971 |
} |
972 |
||
973 |
// ---------------------------------------------------------------------------- |
|
55 | 974 |
// CalenViewManager::handleEntryUpdation |
975 |
// this function will be called when any entry is updated or added into database |
|
976 |
// Here we need to set the context to the entry updated or added. |
|
977 |
// ---------------------------------------------------------------------------- |
|
978 |
// |
|
979 |
void CalenViewManager::handleEntryUpdation(ulong id) |
|
980 |
{ |
|
981 |
AgendaEntry updatedEntry = mController.agendaInterface()->fetchById(id); |
|
982 |
||
983 |
// Agenda entry is not null then refresh the view else close event viewer |
|
984 |
if (!updatedEntry.isNull()) { |
|
985 |
if (AgendaEntry::TypeTodo != updatedEntry.type()) { |
|
986 |
QDate date = updatedEntry.startTime().date(); |
|
987 |
if (!date.isNull() && date.isValid()) { |
|
988 |
mController.Services().Context().setFocusDate(QDateTime(date)); |
|
989 |
} |
|
990 |
} |
|
991 |
} |
|
992 |
||
993 |
} |
|
994 |
||
995 |
// ---------------------------------------------------------------------------- |
|
45 | 996 |
// CalenViewManager::launchSettingsView |
997 |
// Launches settings view |
|
998 |
// (other items were commented in a header). |
|
999 |
// ---------------------------------------------------------------------------- |
|
1000 |
// |
|
1001 |
void CalenViewManager::launchSettingsView() |
|
1002 |
{ |
|
51 | 1003 |
OstTraceFunctionEntry0( CALENVIEWMANAGER_LAUNCHSETTINGSVIEW_ENTRY ); |
1004 |
||
45 | 1005 |
mPreviousViewsId = mCurrentViewId ; |
1006 |
mCurrentViewId = ECalenShowSettings; |
|
1007 |
mSettingsView->initializeForm(); |
|
1008 |
mController.Services().MainWindow().setCurrentView(mSettingsView); |
|
1009 |
||
1010 |
// capture cureent view in case app closed/quits from settings view |
|
1011 |
if (mCalenMonthView){ |
|
1012 |
mCalenMonthView->captureScreenshot(true); |
|
1013 |
} else if(mCalenAgendaView){ |
|
1014 |
mCalenAgendaView->captureScreenshot(true); |
|
1015 |
} |
|
51 | 1016 |
|
1017 |
OstTraceFunctionExit0( CALENVIEWMANAGER_LAUNCHSETTINGSVIEW_EXIT ); |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1018 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1019 |
|
18
c198609911f9
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1020 |
// End of file --Don't remove this. |