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