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