16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 // SYSTEM INCLUDES |
19 // SYSTEM INCLUDES |
20 #include <StringLoader.h> |
20 #include <StringLoader.h> |
21 |
21 #include <AknGlobalNote.h> //used for Selftest failed note |
|
22 #include <aknPopup.h> |
|
23 #include <aknlists.h> |
|
24 #include <aknSDData.h> |
|
25 #include <badesca.h> |
|
26 #include <tzlocalizationdatatypes.h> |
|
27 #include <tzlocalizer.h> |
|
28 #include <tz.h> |
22 #include <featmgr.h> // Feature Manager |
29 #include <featmgr.h> // Feature Manager |
23 #include <centralrepository.h> |
30 #include <centralrepository.h> |
24 #include <startup.rsg> |
31 #include <startup.rsg> |
25 #include <starterdomaincrkeys.h> |
32 #include <starterdomaincrkeys.h> |
26 #include "startupappprivatepskeys.h" |
33 #include "startupappprivatepskeys.h" |
27 #include <startupdomainpskeys.h> |
34 #include <startupdomainpskeys.h> |
28 #include <startupdomaincrkeys.h> |
35 #include <startupdomaincrkeys.h> |
29 #include <CoreApplicationUIsSDKCRKeys.h> |
36 #include <CoreApplicationUIsSDKCRKeys.h> |
30 #include <starterclient.h> |
37 #include <starterclient.h> |
31 #include <hbdevicemessageboxsymbian.h> |
38 #include "StartupWelcomeCrKeys.h" |
32 #include "sanimstartupctrl.h" |
39 |
33 #include <apgtask.h> |
40 #ifdef RD_UI_TRANSITION_EFFECTS_PHASE2 |
|
41 // Transition effects |
|
42 #include <gfxtranseffect/gfxtranseffect.h> |
|
43 #include <akntranseffect.h> |
|
44 #endif |
|
45 |
|
46 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
47 #include "sanimstartupctrl.h" |
|
48 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
49 #include <akndef.h> // For layout change event definitions |
|
50 #include <AknSoundSystem.h> |
|
51 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
34 |
52 |
35 // USER INCLUDES |
53 // USER INCLUDES |
36 #include "StartupAppUi.h" |
54 #include "StartupAppUi.h" |
37 #include "StartupApplication.h" |
55 #include "StartupApplication.h" |
38 |
56 #include "StartupUserWelcomeNote.h" |
|
57 #include "StartupQueryDialog.h" //used for Startup own Time and Date queries |
|
58 #include "StartupPopupList.h" //used for Startup own City and Country queries |
|
59 #include "StartupMediatorObserver.h" |
39 #include "StartupPubSubObserver.h" |
60 #include "StartupPubSubObserver.h" |
40 #include "startupanimationwrapper.h" |
61 |
41 #include "startupview.h" |
62 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
42 |
63 #include "startupanimationwrapper.h" |
43 #include <eikenv.h> |
64 #include "startupview.h" |
44 |
65 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
45 |
66 #include "StartupDocument.h" |
|
67 #include "StartupOperatorAnimation.h" |
|
68 #include "StartupTone.h" |
|
69 #include "StartupWelcomeAnimation.h" |
|
70 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
71 |
|
72 |
|
73 // CONSTANTS |
|
74 const TInt KUserWelcomeNoteShowPeriodTime = 3000000; // 3 sec |
|
75 |
|
76 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
77 const TInt KOneMilliSecondInMicroSeconds = 1000; |
|
78 const TInt KMaxToneInitWait = 200; // 200 ms |
|
79 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
80 |
|
81 static const TInt KMaxCityLength(120); |
|
82 static const TInt KMaxCountryLength(120); |
|
83 |
|
84 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
46 static const CSAnimStartupCtrl::TAnimationParams KStartupAnimationParams = |
85 static const CSAnimStartupCtrl::TAnimationParams KStartupAnimationParams = |
47 { |
86 { |
48 KCRUidStartupConf, |
87 KCRUidStartupConf, |
49 KStartupAnimationPath, |
88 KStartupAnimationPath, |
50 KStartupAnimationFrameDelay, |
89 KStartupAnimationFrameDelay, |
51 KStartupAnimationScaling, |
90 KStartupAnimationScaling, |
52 KStartupTonePath, |
91 KStartupTonePath, |
53 KStartupToneVolume |
92 KStartupToneVolume |
54 }; |
93 }; |
55 |
94 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
95 |
|
96 _LIT(KEmpty, " "); |
|
97 |
|
98 // Default date and time value is used if cenrep string is not valid |
|
99 // Default date is 01.01.2007 and default time is 09:00 AM |
|
100 _LIT( KDefaultDateTimeValue, "20070000:090000" ); // YYYYMMDD:HHMMSS |
|
101 |
|
102 static const TInt KTimeFormatLength(16); // "20070000:090000." |
56 |
103 |
57 _LIT_SECURITY_POLICY_C1(KReadDeviceDataPolicy, ECapabilityReadDeviceData); |
104 _LIT_SECURITY_POLICY_C1(KReadDeviceDataPolicy, ECapabilityReadDeviceData); |
58 _LIT_SECURITY_POLICY_C1(KWriteDeviceDataPolicy, ECapabilityWriteDeviceData); |
105 _LIT_SECURITY_POLICY_C1(KWriteDeviceDataPolicy, ECapabilityWriteDeviceData); |
59 _LIT_SECURITY_POLICY_PASS(KAlwaysPassPolicy); |
106 _LIT_SECURITY_POLICY_PASS(KAlwaysPassPolicy); |
60 |
107 |
61 // ======== LOCAL FUNCTIONS ================================================== |
108 // ======== LOCAL FUNCTIONS ================================================== |
62 |
109 |
|
110 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
63 namespace |
111 namespace |
64 { |
112 { |
65 TInt AnimationFinishedFunc( TAny* aPtr ) |
113 TInt AnimationFinishedFunc( TAny* aPtr ) |
66 { |
114 { |
67 static_cast<CStartupAppUi*>( aPtr )->AnimationFinished(); |
115 static_cast<CStartupAppUi*>( aPtr )->AnimationFinished(); |
68 return KErrNone; |
116 return KErrNone; |
69 } |
117 } |
70 } |
118 } |
71 |
119 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
72 |
120 |
73 |
121 |
74 // ================= MEMBER FUNCTIONS ======================================== |
122 // ================= MEMBER FUNCTIONS ======================================== |
75 // |
123 // |
76 // --------------------------------------------------------------------------- |
124 // --------------------------------------------------------------------------- |
77 // CStartupAppUi::CStartupAppUi() |
125 // CStartupAppUi::CStartupAppUi() |
78 // --------------------------------------------------------------------------- |
126 // --------------------------------------------------------------------------- |
79 CStartupAppUi::CStartupAppUi() : |
127 CStartupAppUi::CStartupAppUi() : |
80 iInternalState( EStartupStartingUp ), |
128 iUserWelcomeNote( NULL ), |
81 |
129 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
130 iStartupTone( NULL ), |
|
131 iOpStartupTone( NULL ), |
|
132 iToneInitWaitTime( 0 ), |
|
133 iAnimation( EFalse ), |
|
134 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
135 iInternalState( EStartupStartingUp ), |
|
136 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
137 iSplashScreenShouldBeRemoved( EFalse ), |
|
138 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
82 iStartupFirstBootAndRTCCheckAlreadyCalled( EFalse ), |
139 iStartupFirstBootAndRTCCheckAlreadyCalled( EFalse ), |
83 iChargingOrAlarmBoot( EFalse ), |
140 iChargingOrAlarmBoot( EFalse ), |
84 iFirstBoot( ETrue ), |
141 iFirstBoot( ETrue ), |
85 iCleanBoot( EStartupNormalBoot ), |
142 iCleanBoot( EStartupNormalBoot ), |
86 iOfflineModeSupported( EFalse ), |
143 iOfflineModeSupported( EFalse ), |
87 iOfflineModeQueryShown( EFalse ), |
144 iOfflineModeQueryShown( EFalse ), |
88 iCriticalBlockEnded( EFalse ), |
145 iCriticalBlockEnded( EFalse ), |
89 iSwStateFatalStartupError( EFalse ), |
146 iSwStateFatalStartupError( EFalse ), |
90 iStartupWaitingShowStartupAnimation( EFalse ), |
147 iStartupWaitingShowStartupAnimation( EFalse ), |
91 iSimSupported( ETrue ) |
148 iSimSupported( ETrue ), |
92 |
149 iStartupMediatorObserver( NULL ), |
|
150 iCoverUISupported( EFalse ), |
|
151 iCounryListIndex( 0 ) |
|
152 , iTime( 0 ) |
|
153 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
154 , iTouchScreenCalibSupport( EFalse ) |
|
155 , iTouchScreenCalibrationDone( EFalse ) |
|
156 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
93 { |
157 { |
94 TRACES("CStartupAppUi::CStartupAppUi"); |
158 TRACES("CStartupAppUi::CStartupAppUi"); |
95 } |
159 } |
96 |
160 |
97 // --------------------------------------------------------------------------- |
161 // --------------------------------------------------------------------------- |
98 // CStartupAppUi::ConstructL() |
162 // CStartupAppUi::ConstructL() |
99 // --------------------------------------------------------------------------- |
163 // --------------------------------------------------------------------------- |
100 void CStartupAppUi::ConstructL() |
164 void CStartupAppUi::ConstructL() |
101 { |
165 { |
102 RThread thread; //increase the thread priority to smooth the animation |
|
103 thread.SetPriority(EPriorityAbsoluteForeground); |
|
104 thread.Close(); |
|
105 TRACES("CStartupAppUi::ConstructL()"); |
166 TRACES("CStartupAppUi::ConstructL()"); |
106 TInt flags = EStandardApp; |
167 TInt flags = EStandardApp|EAknEnableSkin|EAknEnableMSK ; |
107 BaseConstructL( flags ); |
168 |
108 |
169 BaseConstructL(flags); |
|
170 |
|
171 iAvkonAppUi->SetKeyEventFlags( CAknAppUiBase::EDisableSendKeyShort | |
|
172 CAknAppUiBase::EDisableSendKeyLong ); |
|
173 |
|
174 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
109 iMainView = CStartupView::NewL( ApplicationRect() ); |
175 iMainView = CStartupView::NewL( ApplicationRect() ); |
110 |
|
111 |
|
112 iAnimation = CStartupAnimationWrapper::NewL( *iMainView ); |
176 iAnimation = CStartupAnimationWrapper::NewL( *iMainView ); |
113 |
177 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
114 |
178 |
115 TInt err = RProperty::Define( KPSUidStartupApp, |
179 TInt err = RProperty::Define( KPSUidStartupApp, |
116 KPSStartupAppState, |
180 KPSStartupAppState, |
117 RProperty::EInt, |
181 RProperty::EInt, |
118 KReadDeviceDataPolicy, |
182 KReadDeviceDataPolicy, |
149 { |
246 { |
150 TRACES1("CStartupAppUi::ConstructL(): KPSStartupUiPhase define err %d", err); |
247 TRACES1("CStartupAppUi::ConstructL(): KPSStartupUiPhase define err %d", err); |
151 } |
248 } |
152 |
249 |
153 UpdateStartupUiPhase( EStartupUiPhaseUninitialized ); |
250 UpdateStartupUiPhase( EStartupUiPhaseUninitialized ); |
154 |
251 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
155 |
252 |
156 FeatureManager::InitializeLibL(); |
253 FeatureManager::InitializeLibL(); |
157 if ( FeatureManager::FeatureSupported( KFeatureIdOfflineMode ) ) |
254 if ( FeatureManager::FeatureSupported( KFeatureIdOfflineMode ) ) |
158 { |
255 { |
159 iOfflineModeSupported = ETrue; |
256 iOfflineModeSupported = ETrue; |
160 } |
257 } |
161 if ( !FeatureManager::FeatureSupported( KFeatureIdSimCard ) ) |
258 if ( !FeatureManager::FeatureSupported( KFeatureIdSimCard ) ) |
162 { |
259 { |
163 iSimSupported = EFalse; |
260 iSimSupported = EFalse; |
164 } |
261 } |
165 |
262 if ( FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ) ) |
|
263 { |
|
264 iCoverUISupported = ETrue; |
|
265 } |
166 |
266 |
167 TRACES1("CStartupAppUi::ConstructL(): Offline mode supported: %d", iOfflineModeSupported ); |
267 TRACES1("CStartupAppUi::ConstructL(): Offline mode supported: %d", iOfflineModeSupported ); |
168 TRACES1("CStartupAppUi::ConstructL(): SIM card supported: %d", iSimSupported ); |
268 TRACES1("CStartupAppUi::ConstructL(): SIM card supported: %d", iSimSupported ); |
169 |
269 TRACES1("CStartupAppUi::ConstructL(): CoverUI supported: %d", iCoverUISupported ); |
|
270 |
|
271 #if defined (RD_SCALABLE_UI_V2) && !defined(RD_STARTUP_ANIMATION_CUSTOMIZATION) |
|
272 if ( FeatureManager::FeatureSupported(KFeatureIdPenSupport) && |
|
273 FeatureManager::FeatureSupported(KFeatureIdPenSupportCalibration) ) |
|
274 { |
|
275 iTouchScreenCalibSupport = ETrue; |
|
276 } |
|
277 #endif // RD_SCALABLE_UI_V2 && !RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
278 |
|
279 if (iCoverUISupported) |
|
280 { |
|
281 iStartupMediatorObserver = CStartupMediatorObserver::NewL( this ); |
|
282 } |
170 |
283 |
171 iFirstBoot = FirstBoot(); |
284 iFirstBoot = FirstBoot(); |
172 TRACES1("CStartupAppUi::ConstructL(): First boot: %d", iFirstBoot ); |
285 TRACES1("CStartupAppUi::ConstructL(): First boot: %d", iFirstBoot ); |
173 |
286 |
174 |
287 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
175 CEikonEnv* eikEnv = CEikonEnv::Static(); |
288 iWelcomeAnimation = CStartupWelcomeAnimation::NewL( this, ClientRect()); |
|
289 AddToStackL( iWelcomeAnimation ); |
|
290 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
176 |
291 |
177 // Set Startup application to be system application |
292 // Set Startup application to be system application |
178 eikEnv->SetSystem( ETrue ); |
293 iEikonEnv->SetSystem( ETrue ); |
179 |
294 |
180 eikEnv->RootWin().SetOrdinalPosition(0,0); |
295 iEikonEnv->RootWin().SetOrdinalPosition(0,0); |
181 |
296 |
182 // Disable priority changes of window server |
297 // Disable priority changes of window server |
183 eikEnv->WsSession().ComputeMode( |
298 iEikonEnv->WsSession().ComputeMode( |
184 RWsSession::EPriorityControlDisabled ); |
299 RWsSession::EPriorityControlDisabled ); |
185 iNoteTimer = CPeriodic::NewL( EPriorityNormal ); |
300 |
186 |
301 iNoteTimer = CPeriodic::NewL( EPriorityNormal ); |
|
302 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
303 iAnimTimer = CPeriodic::NewL( EPriorityNormal ); |
|
304 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
187 iExitTimer = CPeriodic::NewL( EPriorityNormal ); |
305 iExitTimer = CPeriodic::NewL( EPriorityNormal ); |
188 |
306 |
|
307 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
308 TRACES("CStartupAppUi::ConstructL(): StartupTone: Initialising"); |
|
309 iStartupTone = CStartupTone::NewL( this, EStartupTone ); |
|
310 TRACES("CStartupAppUi::ConstructL(): StartupTone: Initialised"); |
|
311 |
|
312 TRACES("CStartupAppUi::ConstructL(): Operator StartupTone: Initialising"); |
|
313 iOpStartupTone = CStartupTone::NewL( this, EStartupOpTone ); |
|
314 TRACES("CStartupAppUi::ConstructL(): Operator StartupTone: Initialised"); |
|
315 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
189 |
316 |
190 if ( iSwStateFatalStartupError ) |
317 if ( iSwStateFatalStartupError ) |
191 { |
318 { |
192 TRACES("CStartupAppUi::ConstructL(): ESWStateFatalStartupError"); |
319 TRACES("CStartupAppUi::ConstructL(): ESWStateFatalStartupError"); |
193 DoNextStartupPhaseL( EStartupSystemFatalError ); |
320 DoNextStartupPhaseL( EStartupSystemFatalError ); |
549 // --------------------------------------------------------------------------- |
800 // --------------------------------------------------------------------------- |
550 void CStartupAppUi::DoStartupFirstBootAndRTCCheckL() |
801 void CStartupAppUi::DoStartupFirstBootAndRTCCheckL() |
551 { |
802 { |
552 TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL()"); |
803 TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL()"); |
553 |
804 |
554 |
805 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
555 RProperty::Set( KPSUidStartup, KStartupCleanBoot, iCleanBoot ); |
806 RProperty::Set( KPSUidStartup, KStartupCleanBoot, iCleanBoot ); |
556 RProperty::Set( KPSUidStartup, KPSSplashShutdown, ESplashShutdown ); |
807 RProperty::Set( KPSUidStartup, KPSSplashShutdown, ESplashShutdown ); |
557 |
808 |
|
809 delete iUserWelcomeNote; |
|
810 iUserWelcomeNote = NULL; |
558 iMainView->DrawDeferred(); |
811 iMainView->DrawDeferred(); |
559 |
812 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
560 |
813 |
561 // When Predictive Time and Country Selection is enabled, no queries are |
814 // When Predictive Time and Country Selection is enabled, no queries are |
562 // shown to user during first boot. Instead, Clock application gets the |
815 // shown to user during first boot. Instead, Clock application gets the |
563 // time and location from the network and marks the first boot as done. |
816 // time and location from the network and marks the first boot as done. |
564 if( !PredictiveTimeEnabled() ) |
817 if( !PredictiveTimeEnabled() ) |
565 { |
818 { |
566 if( iFirstBoot && !HiddenReset() ) //&& StartupQueriesEnabled() ) |
819 if( iFirstBoot && !HiddenReset() && StartupQueriesEnabled() ) |
567 { |
820 { |
568 TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): First boot. Show city, time and date queries."); |
821 TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): First boot. Show city, time and date queries."); |
569 TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): Mark first boot"); |
822 |
|
823 |
|
824 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
825 iWelcomeAnimation->UpdateDrawInfo( EStartupDICityTimeDateQueries ); |
|
826 iWelcomeAnimation->DrawNow(); |
|
827 |
|
828 if (iOperatorAnimation) |
|
829 { |
|
830 RemoveFromStack( iOperatorAnimation ); |
|
831 delete iOperatorAnimation; |
|
832 iOperatorAnimation = NULL; |
|
833 } |
|
834 if (iUserWelcomeNote) |
|
835 { |
|
836 RemoveFromStack( iUserWelcomeNote ); |
|
837 delete iUserWelcomeNote; |
|
838 iUserWelcomeNote = NULL; |
|
839 } |
|
840 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
841 |
|
842 ShowStartupQueriesL(); |
|
843 TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): Mark first boot"); |
570 MarkFirstBoot(); |
844 MarkFirstBoot(); |
571 |
845 |
572 } |
846 } |
573 else if( !RTCStatus() && !HiddenReset() ) // && StartupQueriesEnabled()) |
847 else if( !RTCStatus() && !HiddenReset() && StartupQueriesEnabled()) |
574 { |
848 { |
575 TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): No first boot but RTCStatus is corrupted. Ask time and date"); |
849 TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): No first boot but RTCStatus is corrupted. Ask time and date"); |
576 } |
850 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
577 if( iFirstBoot ) // && !StartupQueriesEnabled() ) |
851 iWelcomeAnimation->UpdateDrawInfo( EStartupDICityTimeDateQueries ); |
|
852 if (iUserWelcomeNote) |
|
853 { |
|
854 RemoveFromStack( iUserWelcomeNote ); |
|
855 delete iUserWelcomeNote; |
|
856 iUserWelcomeNote = NULL; |
|
857 } |
|
858 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
859 |
|
860 ShowStartupQueriesL(); // Not first boot, so skips Country/City query |
|
861 } |
|
862 if( iFirstBoot && !StartupQueriesEnabled() ) |
578 { |
863 { |
579 TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): First boot ongoing and queries are disabled."); |
864 TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): First boot ongoing and queries are disabled."); |
580 MarkFirstBoot(); |
865 MarkFirstBoot(); |
581 } |
866 } |
582 } |
867 } |
583 else |
|
584 { |
|
585 // Temporary fix for the defect VEZI-7YDEAR , as clock is not yet supported. |
|
586 TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): if PredictiveTimeEnabled is set"); |
|
587 if( iFirstBoot && !HiddenReset() ) |
|
588 { |
|
589 TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): Mark first boot"); |
|
590 MarkFirstBoot(); |
|
591 } |
|
592 // End of temporary fix. |
|
593 } |
|
594 |
868 |
595 TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): Setting KPSStartupAppState = EStartupAppStateFinished"); |
869 TRACES("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): Setting KPSStartupAppState = EStartupAppStateFinished"); |
596 TInt err = RProperty::Set( KPSUidStartupApp, KPSStartupAppState, EStartupAppStateFinished ); |
870 TInt err = RProperty::Set( KPSUidStartupApp, KPSStartupAppState, EStartupAppStateFinished ); |
597 if( KErrNone != err ) |
871 if( KErrNone != err ) |
598 { |
872 { |
599 TRACES1("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): KPSStartupAppState set err %d" |
873 TRACES1("CStartupAppUi::DoStartupFirstBootAndRTCCheckL(): KPSStartupAppState set err %d" |
600 , err); |
874 , err); |
601 } |
875 } |
602 |
876 |
603 DoNextStartupPhaseL( EStartupStartupOK ); |
877 DoNextStartupPhaseL( EStartupWaitingCUIStartupReady ); |
604 } |
878 } |
605 |
879 |
606 |
880 // --------------------------------------------------------------------------- |
607 |
881 // CStartupAppUi::ShowStartupQueriesL() |
|
882 // --------------------------------------------------------------------------- |
|
883 void CStartupAppUi::ShowStartupQueriesL() |
|
884 { |
|
885 TRACES("CStartupAppUi::ShowStartupQueriesL()"); |
|
886 |
|
887 TBool citysaved(EFalse); |
|
888 TBool timesaved(EFalse); |
|
889 TBool datesaved(EFalse); |
|
890 |
|
891 // Get default time ( to be used only in date query ) |
|
892 GetDefaultTimeAndDate( iTime ); |
|
893 |
|
894 // Show Country, Date and Time queries ( with possibility to go back ). |
|
895 // Country query is shown only in the first boot. |
|
896 |
|
897 while (!timesaved) |
|
898 { |
|
899 while (!datesaved) |
|
900 { |
|
901 while (!citysaved && iFirstBoot) |
|
902 { |
|
903 // 1. Select time zone |
|
904 ShowCountryAndCityListsL(); |
|
905 citysaved = ETrue; |
|
906 TRACES1("CStartupAppUi::ShowStartupQueriesL(): citysaved = %d", citysaved ); |
|
907 } |
|
908 // 2. Set date |
|
909 datesaved = ShowDateQueryL(); |
|
910 TRACES1("CStartupAppUi::ShowStartupQueriesL(): datesaved = %d", datesaved ); |
|
911 if (!datesaved) |
|
912 { |
|
913 citysaved = EFalse; |
|
914 } |
|
915 } |
|
916 // 3. Set time |
|
917 timesaved = ShowTimeQueryL(); |
|
918 TRACES1("CStartupAppUi::ShowStartupQueriesL(): timesaved = %d", timesaved ); |
|
919 if (!timesaved) |
|
920 { |
|
921 datesaved = EFalse; |
|
922 } |
|
923 } |
|
924 |
|
925 // All the queries completed. |
|
926 |
|
927 TRACES("CStartupAppUi::ShowStartupQueriesL() - END"); |
|
928 } |
608 |
929 |
609 // --------------------------------------------------------------------------- |
930 // --------------------------------------------------------------------------- |
610 // CStartupAppUi::DoStartupEndPart() |
931 // CStartupAppUi::DoStartupEndPart() |
611 // --------------------------------------------------------------------------- |
932 // --------------------------------------------------------------------------- |
612 void CStartupAppUi::DoStartupEndPart() |
933 void CStartupAppUi::DoStartupEndPart() |
613 { |
934 { |
614 TRACES("CStartupAppUi::DoStartupEndPart()"); |
935 TRACES("CStartupAppUi::DoStartupEndPart()"); |
615 TRACES("CStartupAppUi::DoStartupEndPart(): STARTUP OK"); |
936 TRACES("CStartupAppUi::DoStartupEndPart(): STARTUP OK"); |
|
937 |
|
938 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
939 RProperty::Set( KPSUidStartup, KStartupCleanBoot, iCleanBoot ); |
|
940 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
941 |
|
942 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
943 TBool fTUDone = ETrue; |
|
944 TRAP_IGNORE(IsFTUAvailableL(fTUDone)); |
616 |
945 |
617 TBool ftuenabled=EFalse; |
946 if(fTUDone) |
618 TInt err=KErrNone; |
947 { |
619 #ifndef __WINSCW__ |
948 UpdateStartupUiPhase( EStartupUiPhaseAllDone ); |
620 TRAP(err, |
949 } |
621 TInt enabled=0; |
950 else |
622 //open cenrep; |
951 { |
623 CRepository *cenrep=CRepository::NewLC(KCRUidStartupConf); |
952 UpdateStartupUiPhase(EStartupUiPhaseAllDone+1); |
624 //check if ftu is enabled or not |
953 } |
625 User::LeaveIfError(cenrep->Get(KFtuStartupEnabled,enabled)); |
954 |
626 ftuenabled=!!enabled; //make sure we only have a boolean value here |
955 //UpdateStartupUiPhase( EStartupUiPhaseAllDone ); |
627 CleanupStack::PopAndDestroy(cenrep); |
956 |
628 ); |
957 |
629 #endif |
958 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
630 if(!ftuenabled) |
|
631 { |
|
632 UpdateStartupUiPhase( EStartupUiPhaseAllDone ); |
|
633 } |
|
634 |
959 |
635 TRACES("CStartupAppUi::DoStartupEndPart(): Exit application."); |
960 TRACES("CStartupAppUi::DoStartupEndPart(): Exit application."); |
636 iExitTimer->Start( 100000, 100000, TCallBack( DoExitApplication, this ) ); |
961 iExitTimer->Start( 100000, 100000, TCallBack( DoExitApplication, this ) ); |
637 TRACES("CStartupAppUi::DoStartupEndPart(): DoExitApplication-timer called."); |
962 TRACES("CStartupAppUi::DoStartupEndPart(): DoExitApplication-timer called."); |
638 TRACES("CStartupAppUi::DoStartupEndPart(): End"); |
963 TRACES("CStartupAppUi::DoStartupEndPart(): End"); |
639 } |
964 } |
|
965 |
|
966 void CStartupAppUi::IsFTUAvailableL(TBool& aFTUAvailable) |
|
967 { |
|
968 //From Startupwelcomecrkeys.h |
|
969 CRepository* repo = CRepository::NewLC(KCRUidWelcome6); |
|
970 repo->Get(KPhoneActicationCompleted, aFTUAvailable); |
|
971 CleanupStack::PopAndDestroy(repo); |
|
972 } |
|
973 |
|
974 |
|
975 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
976 // --------------------------------------------------------------------------- |
|
977 // CStartupAppUi::ContinueStartupAfterToneL() |
|
978 // --------------------------------------------------------------------------- |
|
979 void CStartupAppUi::ContinueStartupAfterToneL(TToneType aToneType) |
|
980 { |
|
981 TRACES("CStartupAppUi::ContinueStartupAfterToneL()"); |
|
982 |
|
983 if (aToneType == EStartupTone) |
|
984 { |
|
985 TRACES("CStartupAppUi::ContinueStartupAfterToneL(): Tone type EStartupTone"); |
|
986 DoNextStartupPhaseL( EStartupWaitingCUIOperatorAnim ); |
|
987 } |
|
988 else if (aToneType == EStartupOpTone) |
|
989 { |
|
990 TRACES("CStartupAppUi::ContinueStartupAfterToneL(): Tone type EStartupOpTone"); |
|
991 DoNextStartupPhaseL( EStartupShowingUserWelcomeNote ); |
|
992 } |
|
993 else |
|
994 { |
|
995 TRACES("CStartupAppUi::ContinueStartupAfterToneL(): Tone interrupted"); |
|
996 DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck ); |
|
997 } |
|
998 TRACES("CStartupAppUi::ContinueStartupAfterToneL(): End"); |
|
999 } |
|
1000 |
|
1001 // --------------------------------------------------------------------------- |
|
1002 // CStartupAppUi::BringToForeground() |
|
1003 // --------------------------------------------------------------------------- |
|
1004 void CStartupAppUi::BringToForeground() |
|
1005 { |
|
1006 TRACES("CStartupAppUi::BringToForeground()"); |
|
1007 if ((iInternalState != EStartupWaitingTouchScreenCalib) || |
|
1008 (iTouchScreenCalibrationDone)) |
|
1009 { |
|
1010 TRACES("CStartupAppUi::BringToForeground(): Bring to foreground"); |
|
1011 TApaTask self(iCoeEnv->WsSession()); |
|
1012 self.SetWgId(iCoeEnv->RootWin().Identifier()); |
|
1013 self.BringToForeground(); |
|
1014 } |
|
1015 TRACES("CStartupAppUi::BringToForeground(): End"); |
|
1016 } |
|
1017 |
|
1018 // --------------------------------------------------------------------------- |
|
1019 // CStartupAppUi::SendToBackground() |
|
1020 // --------------------------------------------------------------------------- |
|
1021 void CStartupAppUi::SendToBackground() |
|
1022 { |
|
1023 TRACES("CStartupAppUi::SendToBackground()"); |
|
1024 TApaTask self(iCoeEnv->WsSession()); |
|
1025 self.SetWgId(iCoeEnv->RootWin().Identifier()); |
|
1026 self.SendToBackground(); |
|
1027 TRACES("CStartupAppUi::SendToBackground(): End"); |
|
1028 } |
|
1029 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
640 |
1030 |
641 // --------------------------------------------------------------------------- |
1031 // --------------------------------------------------------------------------- |
642 // CStartupAppUi::StopTimingL() |
1032 // CStartupAppUi::StopTimingL() |
643 // --------------------------------------------------------------------------- |
1033 // --------------------------------------------------------------------------- |
644 void CStartupAppUi::StopTimingL() |
1034 void CStartupAppUi::StopTimingL() |
651 //telling that timer has expired in appui so that |
1041 //telling that timer has expired in appui so that |
652 //key pressed are not handled any more... |
1042 //key pressed are not handled any more... |
653 TRACES("CStartupAppUi::StopTimingL(): Stopping UWN"); |
1043 TRACES("CStartupAppUi::StopTimingL(): Stopping UWN"); |
654 iStartupFirstBootAndRTCCheckAlreadyCalled = ETrue; |
1044 iStartupFirstBootAndRTCCheckAlreadyCalled = ETrue; |
655 iNoteTimer->Cancel(); |
1045 iNoteTimer->Cancel(); |
656 |
1046 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
657 UpdateStartupUiPhase( EStartupUiPhaseUserWelcomeDone ); |
1047 UpdateStartupUiPhase( EStartupUiPhaseUserWelcomeDone ); |
658 DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck ); |
1048 DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck ); |
659 |
1049 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1050 iUserWelcomeNote->CancelNoteCancelTimer(); |
|
1051 iWelcomeAnimation->UpdateDrawInfo( EStartupDIWelcomeNoteEnd ); |
|
1052 iWelcomeAnimation->DrawNow(); |
|
1053 iUserWelcomeNote->SetUserWelcomeNoteShowing(EFalse); |
|
1054 TRACES("CStartupAppUi::StopTimingL(): UWN stopped"); |
|
1055 |
|
1056 if (iStartupTone->Playing()) |
|
1057 { |
|
1058 TRACES("CStartupAppUi::StopTimingL(): Startup tone playing. Cannot continue to next phase"); |
|
1059 iStartupTone->StartupWaiting(ETrue); |
|
1060 } |
|
1061 else |
|
1062 { |
|
1063 DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck ); |
|
1064 } |
|
1065 } |
|
1066 else if (iInternalState == EStartupShowingOperatorAnimation) // EStartupShowingOperatorAnimation |
|
1067 { |
|
1068 TRACES("CStartupAppUi::StopTimingL(): Stopping animation"); |
|
1069 iAnimTimer->Cancel(); |
|
1070 iWelcomeAnimation->CancelAnimCancelTimer(); |
|
1071 iOperatorAnimation->UpdateDrawInfo( EStartupDIOperatorAnimEnd ); |
|
1072 iOperatorAnimation->SetAnimationShowing(EFalse); |
|
1073 TRACES("CStartupAppUi::StopTimingL(): operator animation showing stopped"); |
|
1074 if ( iOperatorAnimation->IsAnimationCancelled()) |
|
1075 { |
|
1076 TRACES("CStartupAppUi::StopTimingL(): Animation is cancelled by user and therefore UWN is not shown"); |
|
1077 StopOperatorTone(); |
|
1078 iStartupFirstBootAndRTCCheckAlreadyCalled = ETrue; |
|
1079 DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck ); |
|
1080 } |
|
1081 else |
|
1082 { |
|
1083 // If tone is still playing wait until it completes. |
|
1084 if (iOpStartupTone->Playing()) |
|
1085 { |
|
1086 TRACES("CStartupAppUi::StopTimingL(): Operator startup tone is still playing. Wait until it completes."); |
|
1087 iOpStartupTone->StartupWaiting(ETrue); |
|
1088 } |
|
1089 else |
|
1090 { |
|
1091 TRACES("CStartupAppUi::StopTimingL(): Lets display UWN"); |
|
1092 DoNextStartupPhaseL( EStartupShowingUserWelcomeNote ); |
|
1093 } |
|
1094 } |
|
1095 TRACES("CStartupAppUi::StopTimingL(): Operator Animation stopped"); |
|
1096 } |
|
1097 else // EStartupShowingWelcomeAnimation |
|
1098 { |
|
1099 TRACES("CStartupAppUi::StopTimingL(): Stopping animation"); |
|
1100 iAnimTimer->Cancel(); |
|
1101 iWelcomeAnimation->CancelAnimCancelTimer(); |
|
1102 iWelcomeAnimation->UpdateDrawInfo( EStartupDIWelcomeAnimEnd ); |
|
1103 iWelcomeAnimation->SetAnimationShowing(EFalse); |
|
1104 TRACES("CStartupAppUi::StopTimingL(): Welcome animation showing stopped"); |
|
1105 |
|
1106 if ( iWelcomeAnimation->IsAnimationCancelled()) |
|
1107 { |
|
1108 TRACES("CStartupAppUi::StopTimingL(): Animation is cancelled by user and therefore operator animation and UWN is not shown"); |
|
1109 StopStartupTone(); |
|
1110 iStartupFirstBootAndRTCCheckAlreadyCalled = ETrue; |
|
1111 DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck ); |
|
1112 } |
|
1113 else |
|
1114 { |
|
1115 if (iStartupTone->Playing()) |
|
1116 { |
|
1117 // If tone is still playing wait until it completes. |
|
1118 iStartupTone->StartupWaiting(ETrue); |
|
1119 } |
|
1120 else |
|
1121 { |
|
1122 DoNextStartupPhaseL( EStartupWaitingCUIOperatorAnim ); |
|
1123 } |
|
1124 } |
|
1125 TRACES("CStartupAppUi::StopTimingL(): Animation stopped"); |
|
1126 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
660 } |
1127 } |
661 } |
1128 } |
662 |
1129 |
663 TRACES("CStartupAppUi::StopTimingL(): End"); |
1130 TRACES("CStartupAppUi::StopTimingL(): End"); |
664 } |
1131 } |
672 iExitTimer->Cancel(); |
1139 iExitTimer->Cancel(); |
673 Exit(); |
1140 Exit(); |
674 TRACES("CStartupAppUi::ExitApplication(): End"); |
1141 TRACES("CStartupAppUi::ExitApplication(): End"); |
675 } |
1142 } |
676 |
1143 |
|
1144 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1145 // --------------------------------------------------------------------------- |
|
1146 // CStartupAppUi::ShowWelcomeAnimationL() |
|
1147 // --------------------------------------------------------------------------- |
|
1148 void CStartupAppUi::ShowWelcomeAnimationL() |
|
1149 { |
|
1150 TRACES("CStartupAppUi::ShowWelcomeAnimationL()"); |
|
1151 __ASSERT_DEBUG( iWelcomeAnimation , PANIC( EStartupPanicClassMemberVariableIsNull ) ); |
|
1152 TInt showtime = iWelcomeAnimation->ShowingTime(); |
|
1153 iAnimation = ETrue; |
|
1154 TRACES("CStartupAppUi::ShowWelcomeAnimationL(): Animation timer started"); |
|
1155 iAnimTimer->Start( |
|
1156 showtime*KOneMilliSecondInMicroSeconds, |
|
1157 showtime*KOneMilliSecondInMicroSeconds, |
|
1158 TCallBack( DoStopTimingL, this ) ); |
|
1159 iWelcomeAnimation->StartL(); |
|
1160 TRACES("CStartupAppUi::ShowWelcomeAnimationL(): End"); |
|
1161 } |
|
1162 |
|
1163 // --------------------------------------------------------------------------- |
|
1164 // CStartupAppUi::ShowOperatorAnimationL() |
|
1165 // --------------------------------------------------------------------------- |
|
1166 void CStartupAppUi::ShowOperatorAnimationL() |
|
1167 { |
|
1168 TRACES("CStartupAppUi::ShowOperatorAnimationL()"); |
|
1169 __ASSERT_DEBUG( iOperatorAnimation , PANIC( EStartupPanicClassMemberVariableIsNull ) ); |
|
1170 TInt showtime = iOperatorAnimation->ShowingTime(); |
|
1171 iAnimation = ETrue; |
|
1172 TRACES("CStartupAppUi::ShowWelcomeAnimationL(): Operator Animation timer started"); |
|
1173 iAnimTimer->Start( |
|
1174 showtime*KOneMilliSecondInMicroSeconds, |
|
1175 showtime*KOneMilliSecondInMicroSeconds, |
|
1176 TCallBack( DoStopTimingL, this ) ); |
|
1177 iOperatorAnimation->StartL(); |
|
1178 TRACES("CStartupAppUi::ShowOperatorAnimationL(): End"); |
|
1179 } |
|
1180 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1181 |
|
1182 // --------------------------------------------------------------------------- |
|
1183 // CStartupAppUi::ShowUserWelcomeNoteL() |
|
1184 // --------------------------------------------------------------------------- |
|
1185 void CStartupAppUi::ShowUserWelcomeNoteL() |
|
1186 { |
|
1187 TRACES("CStartupAppUi::ShowUserWelcomeNoteL()"); |
|
1188 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1189 iUserWelcomeNote = CStartupUserWelcomeNote::NewL( *this, ClientRect(), *iMainView ); |
|
1190 TStartupNoteTypeInformation type = iUserWelcomeNote->NoteTypeInformation(); |
|
1191 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1192 __ASSERT_DEBUG( iUserWelcomeNote , PANIC( EStartupPanicClassMemberVariableIsNull ) ); |
|
1193 TStartupNoteTypeInformation type; |
|
1194 type = iUserWelcomeNote->NoteTypeInformation(); |
|
1195 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1196 if( type == EStartupImage ) |
|
1197 { |
|
1198 // UserWelcomeNote type is EStartupImage |
|
1199 // This type of note is shown fixed (KUserWelcomeNoteShowPeriodTime) time |
|
1200 TRACES("CStartupAppUi::ShowUserWelcomeNoteL(): UWNTimer started (graphic)"); |
|
1201 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1202 iAnimation = EFalse; |
|
1203 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1204 iNoteTimer->Start( |
|
1205 KUserWelcomeNoteShowPeriodTime, |
|
1206 KUserWelcomeNoteShowPeriodTime, |
|
1207 TCallBack( DoStopTimingL, this ) ); |
|
1208 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1209 iUserWelcomeNote->StartL(); |
|
1210 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1211 } |
|
1212 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1213 else if ( type == EStartupText ) |
|
1214 { |
|
1215 TRACES("CStartupAppUi::ShowUserWelcomeNoteL(): Text UWN"); |
|
1216 |
|
1217 iUserWelcomeNote->StartL(); |
|
1218 |
|
1219 UpdateStartupUiPhase( EStartupUiPhaseUserWelcomeDone ); |
|
1220 |
|
1221 DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck ); |
|
1222 } |
|
1223 else |
|
1224 { |
|
1225 TRACES("CStartupAppUi::ShowUserWelcomeNoteL(): No UWN"); |
|
1226 |
|
1227 DoNextStartupPhaseL( EStartupFirstBootAndRTCCheck ); |
|
1228 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1229 else |
|
1230 { |
|
1231 //if User Welcome Note type is ETextWelcomeNote nothing to do here, |
|
1232 //because it is implemented with Avkon globalnote |
|
1233 //or if type is EDefaultWelcomeNote no User Welcome Note is shown. |
|
1234 TRACES("CStartupAppUi::ShowUserWelcomeNoteL(): No UWN to show or UWN is text"); |
|
1235 } |
|
1236 //invoke welcome note container to show note |
|
1237 iUserWelcomeNote->StartL(); |
|
1238 |
|
1239 if( type == EStartupText || type == EStartupNoNote) |
|
1240 { |
|
1241 //this is called already here because timer not activated in text uwn case |
|
1242 //and so DoStopTimingL() is never called and should be called here. |
|
1243 StopTimingL(); |
|
1244 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1245 } |
|
1246 |
|
1247 TRACES("CStartupAppUi::ShowUserWelcomeNoteL(): End"); |
|
1248 } |
|
1249 |
|
1250 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1251 // --------------------------------------------------------------------------- |
|
1252 // CStartupAppUi::WaitingTouchScreenCalibL() |
|
1253 // --------------------------------------------------------------------------- |
|
1254 void CStartupAppUi::WaitingTouchScreenCalibL() |
|
1255 { |
|
1256 TRACES("CStartupAppUi::WaitingTouchScreenCalibL()"); |
|
1257 #ifdef RD_SCALABLE_UI_V2 |
|
1258 |
|
1259 if( iFirstBoot && iTouchScreenCalibSupport ) |
|
1260 { |
|
1261 if (iTouchScreenCalibrationDone) |
|
1262 { |
|
1263 TRACES("CStartupAppUi::WaitingTouchScreenCalibL(): Calibration already done. Continue boot up"); |
|
1264 DoNextStartupPhaseL( EStartupOfflineModeQuery ); |
|
1265 } |
|
1266 else |
|
1267 { |
|
1268 SendToBackground(); |
|
1269 |
|
1270 iWelcomeAnimation->UpdateDrawInfo( EStartupDITouchScreenCalib ); |
|
1271 iWelcomeAnimation->DrawNow(); |
|
1272 TRACES("CStartupAppUi::WaitingTouchScreenCalibL(): Startup sequence halted until Touch Screen Calibration is done"); |
|
1273 } |
|
1274 } |
|
1275 else |
|
1276 { |
|
1277 TRACES("CStartupAppUi::WaitingTouchScreenCalibL(): Not first boot or calibration not supported. Continue boot up"); |
|
1278 DoNextStartupPhaseL( EStartupOfflineModeQuery ); |
|
1279 } |
|
1280 |
|
1281 #else // !RD_SCALABLE_UI_V2 |
|
1282 TRACES("CStartupAppUi::WaitingTouchScreenCalibL(): Calibration not supported. Continue boot up"); |
|
1283 DoNextStartupPhaseL( EStartupOfflineModeQuery ); |
|
1284 |
|
1285 #endif // RD_SCALABLE_UI_V2 |
|
1286 TRACES("CStartupAppUi::WaitingTouchScreenCalibL(): End"); |
|
1287 } |
|
1288 |
|
1289 #ifdef RD_SCALABLE_UI_V2 |
|
1290 // --------------------------------------------------------------------------- |
|
1291 // CStartupAppUi::TouchScreenCalibrationDoneL() |
|
1292 // --------------------------------------------------------------------------- |
|
1293 void CStartupAppUi::TouchScreenCalibrationDoneL() |
|
1294 { |
|
1295 TRACES("CStartupAppUi::TouchScreenCalibrationDoneL()"); |
|
1296 if (iInternalState == EStartupWaitingTouchScreenCalib) |
|
1297 { |
|
1298 iTouchScreenCalibrationDone = ETrue; |
|
1299 BringToForeground(); |
|
1300 DoNextStartupPhaseL( EStartupOfflineModeQuery ); |
|
1301 } |
|
1302 else |
|
1303 { |
|
1304 iTouchScreenCalibrationDone = ETrue; |
|
1305 } |
|
1306 TRACES("CStartupAppUi::TouchScreenCalibrationDoneL(): End"); |
|
1307 } |
|
1308 #endif // RD_SCALABLE_UI_V2 |
|
1309 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1310 |
|
1311 #ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1312 // --------------------------------------------------------------------------- |
|
1313 // CStartupAppUi::CoverUIWelcomeAnimationSyncOKL() |
|
1314 // --------------------------------------------------------------------------- |
|
1315 void CStartupAppUi::CoverUIWelcomeAnimationSyncOKL() |
|
1316 { |
|
1317 TRACES("CStartupAppUi::CoverUIWelcomeAnimationSyncOKL()"); |
|
1318 DoNextStartupPhaseL( EStartupWaitingStartupTone ); |
|
1319 TRACES("CStartupAppUi::CoverUIWelcomeAnimationSyncOKL(): End"); |
|
1320 } |
|
1321 |
|
1322 // --------------------------------------------------------------------------- |
|
1323 // CStartupAppUi::WaitingCoverUIWelcomeAnimationSyncL() |
|
1324 // --------------------------------------------------------------------------- |
|
1325 void CStartupAppUi::WaitingCoverUIWelcomeAnimationSyncL() |
|
1326 { |
|
1327 TRACES("CStartupAppUi::WaitingCoverUIWelcomeAnimationSyncL()"); |
|
1328 if (iCoverUISupported) |
|
1329 { |
|
1330 iStartupMediatorObserver->IssueCommand(SecondaryDisplay::ECmdStartupSync, |
|
1331 SecondaryDisplay::EStartWelcomeAnimation); |
|
1332 } |
|
1333 else |
|
1334 { |
|
1335 DoNextStartupPhaseL( EStartupWaitingStartupTone ); |
|
1336 } |
|
1337 TRACES("CStartupAppUi::WaitingCoverUIWelcomeAnimationSyncL(): End"); |
|
1338 } |
|
1339 |
|
1340 // --------------------------------------------------------------------------- |
|
1341 // CStartupAppUi::CoverUIOperatorAnimationSyncOKL() |
|
1342 // --------------------------------------------------------------------------- |
|
1343 void CStartupAppUi::CoverUIOperatorAnimationSyncOKL() |
|
1344 { |
|
1345 TRACES("CStartupAppUi::CoverUIOperatorAnimationSyncOKL()"); |
|
1346 DoNextStartupPhaseL( EStartupShowingOperatorAnimation ); |
|
1347 TRACES("CStartupAppUi::CoverUIOperatorAnimationSyncOKL(): End"); |
|
1348 } |
|
1349 |
|
1350 // --------------------------------------------------------------------------- |
|
1351 // CStartupAppUi::WaitingCoverUIOperatorAnimationSyncL() |
|
1352 // --------------------------------------------------------------------------- |
|
1353 void CStartupAppUi::WaitingCoverUIOperatorAnimationSyncL() |
|
1354 { |
|
1355 TRACES("CStartupAppUi::WaitingCoverUIOperatorAnimationSyncL()"); |
|
1356 if (iCoverUISupported) |
|
1357 { |
|
1358 if (iOperatorAnimation->ShowingTime()) |
|
1359 { |
|
1360 iStartupMediatorObserver->IssueCommand(SecondaryDisplay::ECmdStartupSync, |
|
1361 SecondaryDisplay::EStartOperatorAnimation ); |
|
1362 } |
|
1363 else |
|
1364 { |
|
1365 DoNextStartupPhaseL( EStartupShowingOperatorAnimation ); |
|
1366 } |
|
1367 } |
|
1368 else |
|
1369 { |
|
1370 DoNextStartupPhaseL( EStartupShowingOperatorAnimation ); |
|
1371 } |
|
1372 TRACES("CStartupAppUi::WaitingCoverUIOperatorAnimationSyncL(): End"); |
|
1373 } |
|
1374 |
|
1375 // --------------------------------------------------------------------------- |
|
1376 // CStartupAppUi::WaitingStartupToneL() |
|
1377 // --------------------------------------------------------------------------- |
|
1378 void CStartupAppUi::WaitingStartupToneL() |
|
1379 { |
|
1380 if( iStartupTone->ToneFound() && !iStartupTone->AudioReady() ) |
|
1381 { |
|
1382 TRACES("CStartupAppUi::WaitingStartupToneL(): Startup tone found but not ready. Waiting tone to init"); |
|
1383 iToneInitTimer = CPeriodic::NewL( EPriorityNormal ); |
|
1384 iToneInitTimer->Start( KOneMilliSecondInMicroSeconds, |
|
1385 KOneMilliSecondInMicroSeconds, |
|
1386 TCallBack( ToneInitTimerTimeoutL, this ) ); |
|
1387 } |
|
1388 else |
|
1389 { |
|
1390 TRACES("CStartupAppUi::WaitingStartupToneL(): Audio ready"); |
|
1391 DoNextStartupPhaseL( EStartupShowingWelcomeAnimation ); |
|
1392 } |
|
1393 } |
|
1394 |
|
1395 // --------------------------------------------------------------------------- |
|
1396 // CStartupAppUi::ToneInitTimerTimeoutL() |
|
1397 // --------------------------------------------------------------------------- |
|
1398 TInt CStartupAppUi::ToneInitTimerTimeoutL(TAny* aObject) |
|
1399 { |
|
1400 STATIC_CAST( CStartupAppUi*, aObject )->StartupToneWaitStatusL(); // cast, and call non-static function |
|
1401 return KErrNone; |
|
1402 } |
|
1403 |
|
1404 // --------------------------------------------------------------------------- |
|
1405 // CStartupAppUi::StartupToneWaitStatusL() |
|
1406 // --------------------------------------------------------------------------- |
|
1407 void CStartupAppUi::StartupToneWaitStatusL() |
|
1408 { |
|
1409 iToneInitWaitTime++; |
|
1410 TRACES1("CStartupAppUi::StartupToneWaitStatusL(): Total tone init wait time = %d ms", iToneInitWaitTime ); |
|
1411 TBool audioReady = iStartupTone->AudioReady(); |
|
1412 if ( audioReady || (iToneInitWaitTime>=KMaxToneInitWait) ) |
|
1413 { |
|
1414 iToneInitTimer->Cancel(); |
|
1415 delete iToneInitTimer; |
|
1416 iToneInitTimer = NULL; |
|
1417 |
|
1418 TRACES1("CStartupAppUi::StartupToneWaitStatusL(): AudioReady: %d, proceed", audioReady ); |
|
1419 DoNextStartupPhaseL( EStartupShowingWelcomeAnimation ); |
|
1420 } |
|
1421 } |
|
1422 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1423 |
|
1424 // --------------------------------------------------------------------------- |
|
1425 // CStartupAppUi::CoverUIStartupReadySyncOKL() |
|
1426 // --------------------------------------------------------------------------- |
|
1427 void CStartupAppUi::CoverUIStartupReadySyncOKL() |
|
1428 { |
|
1429 TRACES("CStartupAppUi::CoverUIStartupReadySyncOKL()"); |
|
1430 DoNextStartupPhaseL( EStartupStartupOK ); |
|
1431 TRACES("CStartupAppUi::CoverUIStartupReadySyncOKL(): End"); |
|
1432 } |
|
1433 |
|
1434 // --------------------------------------------------------------------------- |
|
1435 // CStartupAppUi::WaitingCoverUIStartupReadySyncL() |
|
1436 // --------------------------------------------------------------------------- |
|
1437 void CStartupAppUi::WaitingCoverUIStartupReadySyncL() |
|
1438 { |
|
1439 TRACES("CStartupAppUi::WaitingCoverUIStartupReadySyncL()"); |
|
1440 if (iCoverUISupported) |
|
1441 { |
|
1442 iStartupMediatorObserver->IssueCommand(SecondaryDisplay::ECmdStartupSync, |
|
1443 SecondaryDisplay::EStartStartupReady); |
|
1444 } |
|
1445 else |
|
1446 { |
|
1447 DoNextStartupPhaseL( EStartupStartupOK ); |
|
1448 } |
|
1449 TRACES("CStartupAppUi::WaitingCoverUIStartupReadySyncL(): End"); |
|
1450 } |
|
1451 |
|
1452 // --------------------------------------------------------------------------- |
|
1453 // CStartupAppUi::RaiseCoverUIEvent() |
|
1454 // --------------------------------------------------------------------------- |
|
1455 void CStartupAppUi::RaiseCoverUIEvent( TUid aCategory, |
|
1456 TInt aEventId, |
|
1457 const TDesC8& aData ) |
|
1458 { |
|
1459 TRACES("CStartupAppUi::RaiseCoverUIEvent()"); |
|
1460 if (iCoverUISupported) |
|
1461 { |
|
1462 iStartupMediatorObserver->RaiseEvent( aCategory, |
|
1463 aEventId, |
|
1464 aData ); |
|
1465 } |
|
1466 TRACES("CStartupAppUi::RaiseCoverUIEvent(): End"); |
|
1467 } |
|
1468 |
677 // --------------------------------------------------------------------------- |
1469 // --------------------------------------------------------------------------- |
678 // CStartupAppUi::SetCriticalBlockEndedL() |
1470 // CStartupAppUi::SetCriticalBlockEndedL() |
679 // --------------------------------------------------------------------------- |
1471 // --------------------------------------------------------------------------- |
680 void CStartupAppUi::SetCriticalBlockEndedL() |
1472 void CStartupAppUi::SetCriticalBlockEndedL() |
681 { |
1473 { |
896 |
1710 |
897 if( KErrNone != err ) |
1711 if( KErrNone != err ) |
898 { |
1712 { |
899 TRACES1("CStartupAppUi::ShowOfflineModeQueryL(): KStartupBootIntoOffline set err %d", err); |
1713 TRACES1("CStartupAppUi::ShowOfflineModeQueryL(): KStartupBootIntoOffline set err %d", err); |
900 } |
1714 } |
901 |
1715 |
902 TRACES("CStartupAppUi::ShowOfflineModeQueryL(): End"); |
1716 TRACES("CStartupAppUi::ShowOfflineModeQueryL(): End"); |
903 } |
1717 } |
904 |
1718 |
905 // --------------------------------------------------------------------------- |
1719 // --------------------------------------------------------------------------- |
906 // CStartupAppUi::CancelAnimation(...) |
1720 // CStartupAppUi::CancelAnimation(...) |
907 // --------------------------------------------------------------------------- |
1721 // --------------------------------------------------------------------------- |
908 void CStartupAppUi::CancelAnimation() |
1722 void CStartupAppUi::CancelAnimation() |
909 { |
1723 { |
910 TRACES("CStartupAppUi::CancelAnimation()"); |
1724 TRACES("CStartupAppUi::CancelAnimation()"); |
911 |
1725 #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION |
912 iAnimation->Cancel(); |
1726 iAnimation->Cancel(); |
913 |
1727 #else // RD_STARTUP_ANIMATION_CUSTOMIZATION |
|
1728 iWelcomeAnimation->CancelAnimation(); |
|
1729 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION |
914 TRACES("CStartupAppUi::CancelAnimation(): End"); |
1730 TRACES("CStartupAppUi::CancelAnimation(): End"); |
915 } |
1731 } |
916 |
1732 |
917 |
1733 // --------------------------------------------------------------------------- |
|
1734 // CStartupAppUi::ShowCountryAndCityListsL() |
|
1735 // --------------------------------------------------------------------------- |
|
1736 void CStartupAppUi::ShowCountryAndCityListsL() |
|
1737 { |
|
1738 TRACES("CStartupAppUi::ShowCountryAndCityListsL()"); |
|
1739 |
|
1740 TInt cityselected( EFalse ); |
|
1741 while ( !cityselected ) |
|
1742 { |
|
1743 TRACES1("CStartupAppUi::ShowCountryAndCityListsL(): City item to focus: %d", iCounryListIndex); |
|
1744 TInt cityGroupId = ShowCountryListL(); |
|
1745 TRACES1("CStartupAppUi::ShowCountryAndCityListsL(): City group id: %d", cityGroupId); |
|
1746 if ( cityGroupId != KErrCancel ) |
|
1747 { |
|
1748 cityselected = ShowCityListL(cityGroupId); |
|
1749 } |
|
1750 else |
|
1751 { |
|
1752 cityselected = ETrue; |
|
1753 } |
|
1754 } |
|
1755 TRACES("CStartupAppUi::ShowCountryAndCityListsL(): End"); |
|
1756 } |
|
1757 |
|
1758 // --------------------------------------------------------------------------- |
|
1759 // CStartupAppUi::ShowCountryListL() |
|
1760 // --------------------------------------------------------------------------- |
|
1761 TInt CStartupAppUi::ShowCountryListL() |
|
1762 { |
|
1763 TRACES("CStartupAppUi::ShowCountryListL()"); |
|
1764 |
|
1765 CAknSinglePopupMenuStyleListBox* listBox = |
|
1766 new(ELeave) CAknSinglePopupMenuStyleListBox; |
|
1767 CleanupStack::PushL(listBox); |
|
1768 |
|
1769 CStartupPopupList* popupList = CStartupPopupList::NewL(listBox, R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT, |
|
1770 AknPopupLayouts::EMenuGraphicHeadingWindow ); |
|
1771 |
|
1772 CleanupStack::PushL(popupList); |
|
1773 |
|
1774 listBox->ConstructL(popupList, EAknListBoxSelectionList | EAknListBoxScrollBarSizeExcluded); |
|
1775 listBox->CreateScrollBarFrameL( ETrue ); |
|
1776 listBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, |
|
1777 CEikScrollBarFrame::EAuto ); |
|
1778 |
|
1779 listBox->ItemDrawer()->FormattedCellData()->EnableMarqueeL( ETrue ); |
|
1780 |
|
1781 CDesCArrayFlat *items = new(ELeave)CDesCArrayFlat(1); |
|
1782 |
|
1783 CleanupStack::PushL(items); |
|
1784 |
|
1785 CTzLocalizer* tzLocalizer = CTzLocalizer::NewL(); |
|
1786 CleanupStack::PushL(tzLocalizer); |
|
1787 |
|
1788 CTzLocalizedCityGroupArray* countryList; |
|
1789 countryList = tzLocalizer->GetAllCityGroupsL(CTzLocalizer::ETzAlphaNameAscending); |
|
1790 CleanupStack::PushL(countryList); |
|
1791 |
|
1792 TRACES("CStartupAppUi::ShowCountryListL(): Create list of cities"); |
|
1793 for(TInt i = 0; i <countryList->Count(); i++) |
|
1794 { |
|
1795 CTzLocalizedCityGroup& cityGroup = countryList->At(i); |
|
1796 |
|
1797 // Check if the country name is blank. |
|
1798 // If it is blank, ignore it. Empty name shouldn't be shown in the list. |
|
1799 if(cityGroup.Name().Compare(KEmpty) != 0) |
|
1800 { |
|
1801 TBuf<KMaxCountryLength> countryitem; |
|
1802 countryitem.Insert(0,cityGroup.Name()); |
|
1803 TRACES1("CStartupAppUi::ShowCountryListL(): Create country to list: %S", &countryitem); |
|
1804 items->AppendL(countryitem); |
|
1805 } |
|
1806 } |
|
1807 |
|
1808 CleanupStack::PopAndDestroy( countryList ); |
|
1809 |
|
1810 CTextListBoxModel* model=listBox->Model(); |
|
1811 model->SetItemTextArray(items); |
|
1812 model->SetOwnershipType(ELbmOwnsItemArray); |
|
1813 |
|
1814 TRACES("CStartupAppUi::ShowCountryListL(): Set title"); |
|
1815 // Set title |
|
1816 HBufC* title = StringLoader::LoadLC( R_QTN_SU_SELECT_COUNTRY ); |
|
1817 popupList->SetTitleL(title->Des()); |
|
1818 CleanupStack::PopAndDestroy( title ); |
|
1819 |
|
1820 popupList->EnableAdaptiveFind(); |
|
1821 listBox->SetCurrentItemIndex(iCounryListIndex); |
|
1822 |
|
1823 TInt cityGroupId; |
|
1824 |
|
1825 if (iCoverUISupported) |
|
1826 { |
|
1827 TRACES("CStartupAppUi::ShowCountryListL(): Publish country list for Secondary UI"); |
|
1828 TPckgBuf<TInt> data( SecondaryDisplay::EShowCountryQuery ); |
|
1829 iStartupMediatorObserver->RaiseEvent( SecondaryDisplay::KCatStartup, |
|
1830 SecondaryDisplay::EMsgStartupEvent, |
|
1831 data ); |
|
1832 } |
|
1833 |
|
1834 TRACES("CStartupAppUi::ShowCountryListL(): Show the list"); |
|
1835 if (popupList->ExecuteLD()) |
|
1836 { |
|
1837 iCounryListIndex = listBox->CurrentItemIndex(); |
|
1838 TRACES1("CStartupAppUi::ShowCountryListL(): CurrentItemIndex: %d", iCounryListIndex); |
|
1839 TPtrC countryName = listBox->Model()->ItemText(iCounryListIndex); |
|
1840 |
|
1841 CTzLocalizedCityGroup* tzLocalizedCityGroup = tzLocalizer->FindCityGroupByNameL(countryName); |
|
1842 CleanupStack::PushL(tzLocalizedCityGroup); |
|
1843 |
|
1844 cityGroupId = tzLocalizedCityGroup->Id(); |
|
1845 CleanupStack::PopAndDestroy( tzLocalizedCityGroup ); |
|
1846 |
|
1847 TRACES1("CStartupAppUi::ShowCountryListL(): Selected country %S", &countryName); |
|
1848 } |
|
1849 else |
|
1850 { |
|
1851 TRACES("CStartupAppUi::ShowCountryListL(): Country list cancelled"); |
|
1852 cityGroupId = KErrCancel; |
|
1853 } |
|
1854 |
|
1855 CleanupStack::PopAndDestroy( tzLocalizer ); |
|
1856 CleanupStack::Pop( items ); |
|
1857 CleanupStack::Pop( popupList ); |
|
1858 CleanupStack::PopAndDestroy( listBox ); |
|
1859 |
|
1860 TRACES1("CStartupAppUi::ShowCountryListL(): End. Return city group id: %d", cityGroupId); |
|
1861 return cityGroupId; |
|
1862 } |
|
1863 |
|
1864 // --------------------------------------------------------------------------- |
|
1865 // CStartupAppUi::ShowCityListL() |
|
1866 // --------------------------------------------------------------------------- |
|
1867 TBool CStartupAppUi::ShowCityListL(TUint8 cityGroupId) |
|
1868 { |
|
1869 TRACES("CStartupAppUi::ShowCityListL()"); |
|
1870 |
|
1871 TBool retval( ETrue ); |
|
1872 |
|
1873 CTzLocalizer* tzLocalizer = CTzLocalizer::NewL(); |
|
1874 CleanupStack::PushL(tzLocalizer); |
|
1875 |
|
1876 CTzLocalizedCityArray* cityList; |
|
1877 |
|
1878 TRACES1("CStartupAppUi::ShowCityListL(): Create list of cities in group %d", cityGroupId); |
|
1879 |
|
1880 cityList = tzLocalizer->GetCitiesInGroupL(cityGroupId,//cityGroup.Id(), |
|
1881 CTzLocalizer::ETzAlphaNameAscending ); |
|
1882 CleanupStack::PushL(cityList); |
|
1883 |
|
1884 if ( cityList->Count() == 1 ) |
|
1885 { |
|
1886 TRACES("CStartupAppUi::ShowCityListL(): Only one city in citygroup. This can be selected automatically."); |
|
1887 |
|
1888 CTzLocalizedCity& city = cityList->At(0); |
|
1889 |
|
1890 CTzLocalizedCity* tzLocalizedCity = tzLocalizer->FindCityByNameL(city.Name()); |
|
1891 CleanupStack::PushL(tzLocalizedCity); |
|
1892 |
|
1893 TInt timeZoneId = tzLocalizedCity->TimeZoneId(); |
|
1894 |
|
1895 tzLocalizer->SetTimeZoneL(timeZoneId); |
|
1896 tzLocalizer->SetFrequentlyUsedZoneL(*tzLocalizedCity, CTzLocalizedTimeZone::ECurrentZone); |
|
1897 |
|
1898 CleanupStack::PopAndDestroy( tzLocalizedCity ); |
|
1899 CleanupStack::PopAndDestroy( cityList ); |
|
1900 CleanupStack::PopAndDestroy( tzLocalizer ); |
|
1901 |
|
1902 TRACES1("CStartupAppUi::ShowCityListL(): End, returns %d", retval); |
|
1903 return retval; |
|
1904 } |
|
1905 |
|
1906 CAknSinglePopupMenuStyleListBox* listBox = |
|
1907 new(ELeave) CAknSinglePopupMenuStyleListBox; |
|
1908 CleanupStack::PushL(listBox); |
|
1909 |
|
1910 CStartupPopupList* popupList = CStartupPopupList::NewL(listBox, R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT, |
|
1911 AknPopupLayouts::EMenuGraphicHeadingWindow ); |
|
1912 |
|
1913 CleanupStack::PushL(popupList); |
|
1914 |
|
1915 CDesCArrayFlat *items = new(ELeave)CDesCArrayFlat(1); |
|
1916 |
|
1917 CleanupStack::PushL(items); |
|
1918 |
|
1919 for(TInt j = 0; j < cityList->Count(); j++) |
|
1920 { |
|
1921 CTzLocalizedCity& city = cityList->At(j); |
|
1922 |
|
1923 // Check if the city name is blank. |
|
1924 // If it is blank, ignore it. Empty name shouldn't be shown in the list. |
|
1925 if(city.Name().Compare(KEmpty) != 0) |
|
1926 { |
|
1927 TBuf<KMaxCityLength> homecityitem; |
|
1928 homecityitem.Insert(0,city.Name()); |
|
1929 TRACES1("CStartupAppUi::ShowCityListL(): Create to list: %S", &homecityitem); |
|
1930 items->AppendL(homecityitem); |
|
1931 } |
|
1932 } |
|
1933 |
|
1934 listBox->ConstructL(popupList, EAknListBoxSelectionList | EAknListBoxScrollBarSizeExcluded); |
|
1935 listBox->CreateScrollBarFrameL( ETrue ); |
|
1936 listBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, |
|
1937 CEikScrollBarFrame::EAuto ); |
|
1938 |
|
1939 listBox->ItemDrawer()->FormattedCellData()->EnableMarqueeL( ETrue ); |
|
1940 |
|
1941 CTextListBoxModel* model=listBox->Model(); |
|
1942 model->SetItemTextArray(items); |
|
1943 model->SetOwnershipType(ELbmOwnsItemArray); |
|
1944 |
|
1945 TRACES("CStartupAppUi::ShowCityListL(): Set title"); |
|
1946 // Set title |
|
1947 HBufC* title = StringLoader::LoadLC( R_QTN_SU_SELECT_CITY ); |
|
1948 popupList->SetTitleL(title->Des()); |
|
1949 CleanupStack::PopAndDestroy(title); |
|
1950 |
|
1951 popupList->EnableAdaptiveFind(); |
|
1952 |
|
1953 if (iCoverUISupported) |
|
1954 { |
|
1955 TRACES("CStartupAppUi::ShowCountryListL(): Publish city list for Secondary UI"); |
|
1956 TPckgBuf<TInt> data( SecondaryDisplay::EShowCityQuery ); |
|
1957 iStartupMediatorObserver->RaiseEvent( SecondaryDisplay::KCatStartup, |
|
1958 SecondaryDisplay::EMsgStartupEvent, |
|
1959 data ); |
|
1960 } |
|
1961 |
|
1962 TRACES("CStartupAppUi::ShowCityListL(): Show the list"); |
|
1963 if (popupList->ExecuteLD()) |
|
1964 { |
|
1965 TInt index(listBox->CurrentItemIndex()); |
|
1966 TRACES1("CStartupAppUi::ShowCityListL(): CurrentItemIndex: %d", index); |
|
1967 TPtrC cityName = listBox->Model()->ItemText(index); |
|
1968 |
|
1969 CTzLocalizedCity* tzLocalizedCity = tzLocalizer->FindCityByNameL(cityName); |
|
1970 CleanupStack::PushL(tzLocalizedCity); |
|
1971 |
|
1972 TInt timeZoneId = tzLocalizedCity->TimeZoneId(); |
|
1973 |
|
1974 tzLocalizer->SetTimeZoneL(timeZoneId); |
|
1975 tzLocalizer->SetFrequentlyUsedZoneL(*tzLocalizedCity, CTzLocalizedTimeZone::ECurrentZone); |
|
1976 |
|
1977 CleanupStack::PopAndDestroy(tzLocalizedCity); |
|
1978 |
|
1979 TRACES1("CStartupAppUi::ShowCityListL(): Selected city %S", &cityName); |
|
1980 } |
|
1981 else |
|
1982 { |
|
1983 TRACES("CStartupAppUi::ShowCityListL(): City list cancelled"); |
|
1984 retval = EFalse; |
|
1985 } |
|
1986 |
|
1987 CleanupStack::Pop(items); |
|
1988 CleanupStack::Pop(popupList); |
|
1989 CleanupStack::PopAndDestroy(listBox); |
|
1990 CleanupStack::PopAndDestroy(cityList); |
|
1991 CleanupStack::PopAndDestroy(tzLocalizer); |
|
1992 |
|
1993 |
|
1994 TRACES("CStartupAppUi::ShowCityListL(): Home city selected"); |
|
1995 TRACES1("CStartupAppUi::ShowCityListL(): End, return %d", retval); |
|
1996 return retval; |
|
1997 } |
|
1998 |
|
1999 // --------------------------------------------------------------------------- |
|
2000 // CStartupAppUi::ShowTimeQueryL() |
|
2001 // --------------------------------------------------------------------------- |
|
2002 TBool CStartupAppUi::ShowTimeQueryL() |
|
2003 { |
|
2004 TRACES("CStartupAppUi::ShowTimeQueryL()"); |
|
2005 |
|
2006 TTime time; |
|
2007 GetDefaultTimeAndDate( time ); |
|
2008 |
|
2009 CStartupQueryDialog* dlg = new (ELeave) CStartupQueryDialog(time, CAknQueryDialog::ENoTone); |
|
2010 TRACES("CStartupAppUi::ShowTimeQueryL(): Publish dialog for Secondary UI"); |
|
2011 dlg->PublishDialogL(SecondaryDisplay::ECmdShowTimeQuery, SecondaryDisplay::KCatStartup); |
|
2012 if( dlg->ExecuteLD( R_STARTUP_TIME_SETTING_QUERY ) ) |
|
2013 { |
|
2014 TTime current; |
|
2015 current.HomeTime(); |
|
2016 TDateTime cTime = current.DateTime(); |
|
2017 TDateTime atime = time.DateTime(); |
|
2018 atime.SetYear(cTime.Year()); |
|
2019 atime.SetMonth(cTime.Month()); |
|
2020 atime.SetDay(cTime.Day()); |
|
2021 time = atime; |
|
2022 |
|
2023 RTz rtz; |
|
2024 User::LeaveIfError(rtz.Connect()); |
|
2025 User::LeaveIfError(rtz.SetHomeTime(time)); |
|
2026 rtz.Close(); |
|
2027 |
|
2028 TRACES("CStartupAppUi::ShowTimeQueryL(): End, return ETrue"); |
|
2029 return ETrue; |
|
2030 } |
|
2031 else |
|
2032 { |
|
2033 //in case of poweroff key was pressed and shutdown is occuring |
|
2034 TRACES("CStartupAppUi::ShowTimeQueryL(): End, return EFalse"); |
|
2035 return EFalse; |
|
2036 } |
|
2037 } |
|
2038 |
|
2039 // --------------------------------------------------------------------------- |
|
2040 // CStartupAppUi::ShowDateQueryL() |
|
2041 // --------------------------------------------------------------------------- |
|
2042 TBool CStartupAppUi::ShowDateQueryL() |
|
2043 { |
|
2044 TRACES("CStartupAppUi::ShowDateQueryL()"); |
|
2045 |
|
2046 |
|
2047 CStartupQueryDialog* dlg = new (ELeave) CStartupQueryDialog(iTime, CAknQueryDialog::ENoTone); |
|
2048 TRACES("CStartupAppUi::ShowDateQueryL(): Publish dialog for Secondary UI"); |
|
2049 dlg->PublishDialogL(SecondaryDisplay::ECmdShowDateQuery, SecondaryDisplay::KCatStartup); |
|
2050 |
|
2051 TInt query( R_STARTUP_DATE_SETTING_QUERY_NOBACK ); |
|
2052 if ( iFirstBoot ) |
|
2053 { |
|
2054 query = R_STARTUP_DATE_SETTING_QUERY; |
|
2055 } |
|
2056 |
|
2057 if( dlg->ExecuteLD( query ) ) |
|
2058 { |
|
2059 TTime current; |
|
2060 current.HomeTime(); |
|
2061 TDateTime cTime = current.DateTime(); |
|
2062 TDateTime atime = iTime.DateTime(); |
|
2063 atime.SetHour(cTime.Hour()); |
|
2064 atime.SetMinute(cTime.Minute()); |
|
2065 atime.SetSecond(cTime.Second()); |
|
2066 atime.SetMicroSecond(cTime.MicroSecond()); |
|
2067 iTime = atime; |
|
2068 |
|
2069 RTz rtz; |
|
2070 User::LeaveIfError(rtz.Connect()); |
|
2071 User::LeaveIfError(rtz.SetHomeTime(iTime)); |
|
2072 rtz.Close(); |
|
2073 |
|
2074 TRACES("CStartupAppUi::ShowDateQueryL(): End, return ETrue"); |
|
2075 return ETrue; |
|
2076 } |
|
2077 else |
|
2078 { |
|
2079 // Back key pressed. ( Or poweroff key was pressed and shutdown is occuring ) |
|
2080 TRACES("CStartupAppUi::ShowDateQueryL(): End, return EFalse"); |
|
2081 return EFalse; |
|
2082 } |
|
2083 } |
|
2084 |
|
2085 // --------------------------------------------------------------------------- |
|
2086 // CStartupAppUi::GetDefaultTimeAndDate() |
|
2087 // --------------------------------------------------------------------------- |
|
2088 void CStartupAppUi::GetDefaultTimeAndDate( TTime& aTime ) |
|
2089 { |
|
2090 TRACES("CStartupAppUi::GetDefaultTimeAndDate(): Get Time and Date from CenRep"); |
|
2091 |
|
2092 CRepository* repository(NULL); |
|
2093 |
|
2094 TRAPD( err, repository = CRepository::NewL( KCRUidStartupConf ) ); |
|
2095 if ( !err ) |
|
2096 { |
|
2097 TBuf<KTimeFormatLength> buf; |
|
2098 err = repository->Get( KStartupDefaultTime, buf ); |
|
2099 if( !err ) |
|
2100 { |
|
2101 err = aTime.Set(buf); // returns error if cenrep time format not valid |
|
2102 } |
|
2103 } |
|
2104 |
|
2105 if ( err ) |
|
2106 { |
|
2107 TRACES("CStartupAppUi::GetDefaultTimeAndDate(): Failed to get valid data from CenRep. Using default"); |
|
2108 aTime.Set(KDefaultDateTimeValue); |
|
2109 } |
|
2110 |
|
2111 delete repository; |
|
2112 TRACES("CStartupAppUi::GetDefaultTimeAndDate(): End"); |
|
2113 } |
918 |
2114 |
919 // --------------------------------------------------------------------------- |
2115 // --------------------------------------------------------------------------- |
920 // CStartupAppUi::FirstBoot() |
2116 // CStartupAppUi::FirstBoot() |
921 // --------------------------------------------------------------------------- |
2117 // --------------------------------------------------------------------------- |
922 TBool CStartupAppUi::FirstBoot() |
2118 TBool CStartupAppUi::FirstBoot() |