81 void CBrowserPreferences::ConstructL( TBrowserOverriddenSettings* aSettings ) |
81 void CBrowserPreferences::ConstructL( TBrowserOverriddenSettings* aSettings ) |
82 { |
82 { |
83 LOG_ENTERFN("CBrowserPreferences::ConstructL"); |
83 LOG_ENTERFN("CBrowserPreferences::ConstructL"); |
84 iObservers = new ( ELeave ) CArrayPtrFlat< MPreferencesObserver >( 1 ); |
84 iObservers = new ( ELeave ) CArrayPtrFlat< MPreferencesObserver >( 1 ); |
85 iCommsModel.ApDb().AddObserverL( this ); |
85 iCommsModel.ApDb().AddObserverL( this ); |
86 |
86 |
87 iApDH = CApDataHandler::NewLC( iCommsModel.CommsDb() ); |
87 iApDH = CApDataHandler::NewLC( iCommsModel.CommsDb() ); |
88 CleanupStack::Pop(); |
88 CleanupStack::Pop(); |
89 |
89 |
90 iVpnEngine = CVpnApEngine::NewLC( &(iCommsModel.CommsDb()) ); |
90 iVpnEngine = CVpnApEngine::NewLC( &(iCommsModel.CommsDb()) ); |
91 CleanupStack::Pop(); |
91 CleanupStack::Pop(); |
92 |
92 |
93 CRepository* repository = CRepository::NewL( KCRUidBrowserUiLV ); |
93 CRepository* repository = CRepository::NewL( KCRUidBrowserUiLV ); |
94 |
94 |
95 if ( repository->Get( |
95 if ( repository->Get( |
96 KBrowserUiCommonFlags, iEngineLocalFeaturesBitmask ) != KErrNone ) |
96 KBrowserUiCommonFlags, iEngineLocalFeaturesBitmask ) != KErrNone ) |
97 { |
97 { |
98 // in case of problems, assume everything is off |
98 // in case of problems, assume everything is off |
99 iEngineLocalFeaturesBitmask = 0; |
99 iEngineLocalFeaturesBitmask = 0; |
100 } |
100 } |
101 if ( repository->Get( |
101 if ( repository->Get( |
102 KBrowserUiCommonFlags, iUiLocalFeaturesBitmask ) != KErrNone ) |
102 KBrowserUiCommonFlags, iUiLocalFeaturesBitmask ) != KErrNone ) |
103 { |
103 { |
104 // in case of problems, assume everything is off |
104 // in case of problems, assume everything is off |
105 iUiLocalFeaturesBitmask = 0; |
105 iUiLocalFeaturesBitmask = 0; |
106 } |
106 } |
107 if ( repository->Get( |
107 if ( repository->Get( |
108 KBrowserUiCdmaFlags, iCdmaUiLocalFeaturesBitmask ) != KErrNone ) |
108 KBrowserUiCdmaFlags, iCdmaUiLocalFeaturesBitmask ) != KErrNone ) |
109 { |
109 { |
110 // in case of problems, assume everything is off |
110 // in case of problems, assume everything is off |
111 iCdmaUiLocalFeaturesBitmask = 0; |
111 iCdmaUiLocalFeaturesBitmask = 0; |
112 } |
112 } |
113 |
113 |
114 delete repository; |
114 delete repository; |
115 |
115 |
116 iRepository = CRepository::NewL( KCRUidBrowser ); |
116 iRepository = CRepository::NewL( KCRUidBrowser ); |
117 |
117 |
142 TBool CBrowserPreferences::EngineLocalFeatureSupported( const TInt aFeature ) const |
142 TBool CBrowserPreferences::EngineLocalFeatureSupported( const TInt aFeature ) const |
143 { |
143 { |
144 LOG_ENTERFN("CBrowserPreferences::EngineLocalFeatureSupported"); |
144 LOG_ENTERFN("CBrowserPreferences::EngineLocalFeatureSupported"); |
145 BROWSER_LOG( ( _L( "EnginLocalFeatureSupported returns %d" ), |
145 BROWSER_LOG( ( _L( "EnginLocalFeatureSupported returns %d" ), |
146 (iEngineLocalFeaturesBitmask & aFeature) ) ); |
146 (iEngineLocalFeaturesBitmask & aFeature) ) ); |
147 return (iEngineLocalFeaturesBitmask & aFeature); |
147 return (iEngineLocalFeaturesBitmask & aFeature); |
148 } |
148 } |
149 |
149 |
150 // ---------------------------------------------------------------------------- |
150 // ---------------------------------------------------------------------------- |
151 // CBrowserPreferences::UiLocalFeatureSupported |
151 // CBrowserPreferences::UiLocalFeatureSupported |
152 // ---------------------------------------------------------------------------- |
152 // ---------------------------------------------------------------------------- |
186 { |
186 { |
187 LOG_ENTERFN("CBrowserPreferences::NewL"); |
187 LOG_ENTERFN("CBrowserPreferences::NewL"); |
188 CBrowserPreferences* result; |
188 CBrowserPreferences* result; |
189 result = CBrowserPreferences::NewLC( aCommsModel, aApiProvider, aSettings ); |
189 result = CBrowserPreferences::NewLC( aCommsModel, aApiProvider, aSettings ); |
190 CleanupStack::Pop(); |
190 CleanupStack::Pop(); |
191 return result; |
191 return result; |
192 } |
192 } |
193 |
193 |
194 // ---------------------------------------------------------------------------- |
194 // ---------------------------------------------------------------------------- |
195 // CBrowserPreferences::CBrowserPreferences |
195 // CBrowserPreferences::CBrowserPreferences |
196 // ---------------------------------------------------------------------------- |
196 // ---------------------------------------------------------------------------- |
197 // |
197 // |
198 CBrowserPreferences::CBrowserPreferences( MCommsModel& aCommsModel, |
198 CBrowserPreferences::CBrowserPreferences( MCommsModel& aCommsModel, |
199 MApiProvider& aApiProvider) : |
199 MApiProvider& aApiProvider) : |
200 iApiProvider( aApiProvider ), |
200 iApiProvider( aApiProvider ), |
201 iCommsModel( aCommsModel ), |
201 iCommsModel( aCommsModel ), |
202 iEmbeddedMode( EFalse ) |
202 iEmbeddedMode( EFalse ) |
203 { |
203 { |
204 LOG_ENTERFN("CBrowserPreferences::CBrowserPreferences"); |
204 LOG_ENTERFN("CBrowserPreferences::CBrowserPreferences"); |
205 iAllPreferences.iCookies = EWmlSettingsCookieAllow; |
205 iAllPreferences.iCookies = EWmlSettingsCookieAllow; |
206 iAllPreferences.iHttpSecurityWarnings = ETrue; |
206 iAllPreferences.iHttpSecurityWarnings = ETrue; |
207 iAllPreferences.iDownloadsOpen = ETrue; |
207 iAllPreferences.iDownloadsOpen = ETrue; |
208 iAllPreferences.iConnDialogs = ETrue; |
208 iAllPreferences.iConnDialogs = ETrue; |
209 iAllPreferences.iHomePgURL = NULL; |
209 iAllPreferences.iHomePgURL = NULL; |
210 iAllPreferences.iSearchPgURL = NULL; |
210 iAllPreferences.iSearchPgURL = NULL; |
211 iAllPreferences.iQueryOnExit = EFalse; |
211 iAllPreferences.iQueryOnExit = EFalse; |
212 iAllPreferences.iSendReferrer = EFalse; |
212 iAllPreferences.iSendReferrer = EFalse; |
252 delete iAllPreferences.iDefaultAPDetails; |
252 delete iAllPreferences.iDefaultAPDetails; |
253 delete iRepository; |
253 delete iRepository; |
254 |
254 |
255 // For short cut functions |
255 // For short cut functions |
256 delete iAllPreferences.iShortCutFuncHomePg; |
256 delete iAllPreferences.iShortCutFuncHomePg; |
257 iAllPreferences.iShortCutFuncHomePg = NULL; |
257 iAllPreferences.iShortCutFuncHomePg = NULL; |
258 |
258 |
259 delete iAllPreferences.iShortCutFuncBkMark; |
259 delete iAllPreferences.iShortCutFuncBkMark; |
260 iAllPreferences.iShortCutFuncBkMark = NULL; |
260 iAllPreferences.iShortCutFuncBkMark = NULL; |
261 |
261 |
262 delete iAllPreferences.iShortCutFuncFindKeyWord; |
262 delete iAllPreferences.iShortCutFuncFindKeyWord; |
263 iAllPreferences.iShortCutFuncFindKeyWord = NULL; |
263 iAllPreferences.iShortCutFuncFindKeyWord = NULL; |
264 |
264 |
265 delete iAllPreferences.iShortCutFuncPrePage; |
265 delete iAllPreferences.iShortCutFuncPrePage; |
266 iAllPreferences.iShortCutFuncPrePage = NULL; |
266 iAllPreferences.iShortCutFuncPrePage = NULL; |
267 |
267 |
268 delete iAllPreferences.iShortCutFuncSwitchWin; |
268 delete iAllPreferences.iShortCutFuncSwitchWin; |
269 iAllPreferences.iShortCutFuncSwitchWin = NULL; |
269 iAllPreferences.iShortCutFuncSwitchWin = NULL; |
270 |
270 |
271 delete iAllPreferences.iShortCutFuncMiniImage; |
271 delete iAllPreferences.iShortCutFuncMiniImage; |
272 iAllPreferences.iShortCutFuncMiniImage = NULL; |
272 iAllPreferences.iShortCutFuncMiniImage = NULL; |
273 |
273 |
274 delete iAllPreferences.iShortCutFuncFullScreen; |
274 delete iAllPreferences.iShortCutFuncFullScreen; |
275 iAllPreferences.iShortCutFuncFullScreen = NULL; |
275 iAllPreferences.iShortCutFuncFullScreen = NULL; |
276 |
276 |
277 delete iAllPreferences.iShortCutFuncGoAddr; |
277 delete iAllPreferences.iShortCutFuncGoAddr; |
278 iAllPreferences.iShortCutFuncGoAddr = NULL; |
278 iAllPreferences.iShortCutFuncGoAddr = NULL; |
279 |
279 |
280 delete iAllPreferences.iShortCutFuncZoomIn; |
280 delete iAllPreferences.iShortCutFuncZoomIn; |
281 iAllPreferences.iShortCutFuncZoomIn = NULL; |
281 iAllPreferences.iShortCutFuncZoomIn = NULL; |
282 |
282 |
283 delete iAllPreferences.iShortCutFuncZoomOut; |
283 delete iAllPreferences.iShortCutFuncZoomOut; |
284 iAllPreferences.iShortCutFuncZoomOut = NULL; |
284 iAllPreferences.iShortCutFuncZoomOut = NULL; |
285 |
285 |
286 delete iAllPreferences.iShortCutFuncZoomMode; |
286 delete iAllPreferences.iShortCutFuncZoomMode; |
287 iAllPreferences.iShortCutFuncZoomMode = NULL; |
287 iAllPreferences.iShortCutFuncZoomMode = NULL; |
288 |
288 |
289 delete iAllPreferences.iUrlSuffixList; |
289 delete iAllPreferences.iUrlSuffixList; |
290 iAllPreferences.iUrlSuffixList = NULL; |
290 iAllPreferences.iUrlSuffixList = NULL; |
291 } |
291 } |
292 |
292 |
293 // ---------------------------------------------------------------------------- |
293 // ---------------------------------------------------------------------------- |
294 // CBrowserPreferences::AddObserverL |
294 // CBrowserPreferences::AddObserverL |
295 // ---------------------------------------------------------------------------- |
295 // ---------------------------------------------------------------------------- |
348 { |
348 { |
349 LOG_ENTERFN("CBrowserPreferences::RestoreSettingsL"); |
349 LOG_ENTERFN("CBrowserPreferences::RestoreSettingsL"); |
350 // |
350 // |
351 // READ USER VARIATED SETTINGS |
351 // READ USER VARIATED SETTINGS |
352 // |
352 // |
353 |
353 |
354 //Read auto load content setting |
354 //Read auto load content setting |
355 iAllPreferences.iAutoLoadContent = GetIntValue( KBrowserNGImagesEnabled ); |
355 iAllPreferences.iAutoLoadContent = GetIntValue( KBrowserNGImagesEnabled ); |
356 |
356 |
357 //Read font size |
357 //Read font size |
358 iAllPreferences.iFontSize = GetIntValue( KBrowserNGFontSize ); |
358 iAllPreferences.iFontSize = GetIntValue( KBrowserNGFontSize ); |
359 |
359 |
360 // Read Allow Cookies setting |
360 // Read Allow Cookies setting |
361 if ( GetIntValue( KBrowserNGCookiesEnabled ) ) |
361 if ( GetIntValue( KBrowserNGCookiesEnabled ) ) |
362 { |
362 { |
363 iAllPreferences.iCookies = EWmlSettingsCookieAllow; |
363 iAllPreferences.iCookies = EWmlSettingsCookieAllow; |
364 } |
364 } |
365 else |
365 else |
366 { |
366 { |
367 iAllPreferences.iCookies = EWmlSettingsCookieReject; |
367 iAllPreferences.iCookies = EWmlSettingsCookieReject; |
368 } |
368 } |
369 |
369 |
370 // Read ECMA Setting |
370 // Read ECMA Setting |
371 if ( GetIntValue( KBrowserNGECMAScriptSupport ) ) |
371 if ( GetIntValue( KBrowserNGECMAScriptSupport ) ) |
372 { |
372 { |
373 iAllPreferences.iEcma = EWmlSettingsECMAEnable; |
373 iAllPreferences.iEcma = EWmlSettingsECMAEnable; |
374 } |
374 } |
431 |
431 |
432 switch(adBm) |
432 switch(adBm) |
433 { |
433 { |
434 case (KBrowserAdaptiveBookmarksSettingDataOn): |
434 case (KBrowserAdaptiveBookmarksSettingDataOn): |
435 { |
435 { |
436 iAllPreferences.iAdaptiveBookmarks = |
436 iAllPreferences.iAdaptiveBookmarks = |
437 EWmlSettingsAdaptiveBookmarksOn; |
437 EWmlSettingsAdaptiveBookmarksOn; |
438 break; |
438 break; |
439 } |
439 } |
440 case (KBrowserAdaptiveBookmarksSettingDataHideFolder): |
440 case (KBrowserAdaptiveBookmarksSettingDataHideFolder): |
441 { |
441 { |
442 iAllPreferences.iAdaptiveBookmarks = |
442 iAllPreferences.iAdaptiveBookmarks = |
443 EWmlSettingsAdaptiveBookmarksHideFolder; |
443 EWmlSettingsAdaptiveBookmarksHideFolder; |
444 break; |
444 break; |
445 } |
445 } |
446 case (KBrowserAdaptiveBookmarksSettingDataOff): |
446 case (KBrowserAdaptiveBookmarksSettingDataOff): |
447 { |
447 { |
448 iAllPreferences.iAdaptiveBookmarks = |
448 iAllPreferences.iAdaptiveBookmarks = |
449 EWmlSettingsAdaptiveBookmarksOff; |
449 EWmlSettingsAdaptiveBookmarksOff; |
450 break; |
450 break; |
451 } |
451 } |
452 default: |
452 default: |
453 { |
453 { |
454 break; |
454 break; |
455 } |
455 } |
456 } |
456 } |
457 } |
457 } |
458 |
458 |
459 // |
459 // |
460 // READ OPERATOR VARIATED SETTINGS |
460 // READ OPERATOR VARIATED SETTINGS |
461 // |
461 // |
462 |
462 |
463 iAllPreferences.iHomePgType = |
463 iAllPreferences.iHomePgType = |
464 ( TWmlSettingsHomePage ) GetIntValue( KBrowserNGHomepageType ); |
464 ( TWmlSettingsHomePage ) GetIntValue( KBrowserNGHomepageType ); |
465 iAllPreferences.iPageOverview = GetIntValue ( |
465 iAllPreferences.iPageOverview = GetIntValue ( |
466 KBrowserNGPageOverview ); |
466 KBrowserNGPageOverview ); |
467 iAllPreferences.iBackList = GetIntValue ( |
467 iAllPreferences.iBackList = GetIntValue ( |
468 KBrowserNGBackList ); |
468 KBrowserNGBackList ); |
469 iAllPreferences.iAutoRefresh = GetIntValue ( |
469 iAllPreferences.iAutoRefresh = GetIntValue ( |
470 KBrowserNGAutoRefresh ); |
470 KBrowserNGAutoRefresh ); |
471 |
471 |
472 if(PROGRESSIVE_DOWNLOAD) |
472 if(PROGRESSIVE_DOWNLOAD) |
473 { |
473 { |
474 iAllPreferences.iDownloadsOpen = GetIntValue ( KBrowserNGOpenDownloads ); |
474 iAllPreferences.iDownloadsOpen = GetIntValue ( KBrowserNGOpenDownloads ); |
475 } |
475 } |
476 else |
476 else |
477 { |
477 { |
478 iAllPreferences.iDownloadsOpen = EFalse; |
478 iAllPreferences.iDownloadsOpen = EFalse; |
479 } |
479 } |
480 |
480 |
481 //Read suppress security UI setting |
481 //Read suppress security UI setting |
482 iAllPreferences.iHTTPSecuritySupressed = GetIntValue ( KBrowserSecurityUI ); |
482 iAllPreferences.iHTTPSecuritySupressed = GetIntValue ( KBrowserSecurityUI ); |
483 |
483 |
484 //Read show connection queries setting |
484 //Read show connection queries setting |
485 iAllPreferences.iConnDialogs = GetIntValue( KBrowserConnectionDialogs ); |
485 iAllPreferences.iConnDialogs = GetIntValue( KBrowserConnectionDialogs ); |
486 |
486 |
487 if( !iAllPreferences.iHTTPSecuritySupressed ) |
487 if( !iAllPreferences.iHTTPSecuritySupressed ) |
488 { |
488 { |
489 // Read HTTP security warnings setting |
489 // Read HTTP security warnings setting |
490 iAllPreferences.iHttpSecurityWarnings = GetIntValue ( |
490 iAllPreferences.iHttpSecurityWarnings = GetIntValue ( |
491 KBrowserNGShowSecurityWarnings ); |
491 KBrowserNGShowSecurityWarnings ); |
492 } |
492 } |
493 else |
493 else |
494 { |
494 { |
495 //we don't want to see sec warning because they're supressed |
495 //we don't want to see sec warning because they're supressed |
496 iAllPreferences.iHttpSecurityWarnings = EFalse; |
496 iAllPreferences.iHttpSecurityWarnings = EFalse; |
497 } |
497 } |
498 |
498 |
499 // Media Volume uses different SD ini. Revert to Browser SD ini after use |
499 // Media Volume uses different SD ini. Revert to Browser SD ini after use |
500 iAllPreferences.iMediaVolume = GetIntValue( KBrowserMediaVolumeControl ); |
500 iAllPreferences.iMediaVolume = GetIntValue( KBrowserMediaVolumeControl ); |
501 |
501 |
502 // Pop up Blocking |
502 // Pop up Blocking |
503 iAllPreferences.iPopupBlocking = GetIntValue( KBrowserNGPopupBlocking ); |
503 iAllPreferences.iPopupBlocking = GetIntValue( KBrowserNGPopupBlocking ); |
504 |
504 |
505 // Form Data Saving |
505 // Form Data Saving |
506 iAllPreferences.iFormDataSaving = (TWmlSettingsFormData) GetIntValue( KBrowserFormDataSaving ); |
506 iAllPreferences.iFormDataSaving = (TWmlSettingsFormData) GetIntValue( KBrowserFormDataSaving ); |
507 |
507 |
508 // Access Keys |
508 // Access Keys |
509 iAllPreferences.iAccessKeys = (TBool) GetIntValue( KBrowserNGAccessKeys ); |
509 iAllPreferences.iAccessKeys = (TBool) GetIntValue( KBrowserNGAccessKeys ); |
510 |
510 |
511 // The leaving functions come at the end |
511 // The leaving functions come at the end |
512 |
512 |
513 // Search Page |
513 // Search Page |
514 if ( iAllPreferences.iSearchPgURL ) |
514 if ( iAllPreferences.iSearchPgURL ) |
515 { |
515 { |
516 delete iAllPreferences.iSearchPgURL; |
516 delete iAllPreferences.iSearchPgURL; |
517 iAllPreferences.iSearchPgURL = NULL; |
517 iAllPreferences.iSearchPgURL = NULL; |
518 } |
518 } |
519 |
519 |
520 // Web reed feeds settings - begin |
520 // Web reed feeds settings - begin |
521 iAllPreferences.iAutomaticUpdatingAP = GetIntValue( KBrowserNGAutomaticUpdatingAccessPoint ); |
521 iAllPreferences.iAutomaticUpdatingAP = GetIntValue( KBrowserNGAutomaticUpdatingAccessPoint ); |
522 |
522 |
523 iAllPreferences.iAutomaticUpdatingWhileRoaming = GetIntValue( KBrowserNGAutomaticUpdatingWhileRoaming ); |
523 iAllPreferences.iAutomaticUpdatingWhileRoaming = GetIntValue( KBrowserNGAutomaticUpdatingWhileRoaming ); |
524 |
524 |
525 // Web reed feeds settings - end |
525 // Web reed feeds settings - end |
526 if (CBrowserAppUi::Static()->OrientationCanBeChanged() ) |
526 if (CBrowserAppUi::Static()->OrientationCanBeChanged() ) |
527 { |
527 { |
528 iAllPreferences.iRotateDisplay = GetIntValue( KBrowserNGRotateDisplay ); |
528 iAllPreferences.iRotateDisplay = GetIntValue( KBrowserNGRotateDisplay ); |
529 } |
529 } |
545 |
545 |
546 // Read Accesss point selection mode for advanced settings |
546 // Read Accesss point selection mode for advanced settings |
547 const TInt selectionMode = GetIntValue( KBrowserAccessPointSelectionMode ); |
547 const TInt selectionMode = GetIntValue( KBrowserAccessPointSelectionMode ); |
548 switch ( selectionMode ) |
548 switch ( selectionMode ) |
549 { |
549 { |
550 case EBrowserCenRepApSelModeUserDefined: |
550 case EBrowserCenRepApSelModeUserDefined: |
551 { |
551 { |
552 iAllPreferences.iAccessPointSelectionMode = EConnectionMethod; |
552 iAllPreferences.iAccessPointSelectionMode = EConnectionMethod; |
553 break; |
553 break; |
554 } |
554 } |
555 case EBrowserCenRepApSelModeAlwaysAsk: |
555 case EBrowserCenRepApSelModeAlwaysAsk: |
556 { |
556 { |
557 iAllPreferences.iAccessPointSelectionMode = EAlwaysAsk; |
557 iAllPreferences.iAccessPointSelectionMode = EAlwaysAsk; |
558 break; |
558 break; |
559 } |
559 } |
560 case EBrowserCenRepApSelModeDestination: |
560 case EBrowserCenRepApSelModeDestination: |
561 { |
561 { |
562 iAllPreferences.iAccessPointSelectionMode = EDestination; |
562 iAllPreferences.iAccessPointSelectionMode = EDestination; |
563 break; |
563 break; |
564 } |
564 } |
565 default: // Default to Always ask. |
565 default: // Default to Always ask. |
566 { |
566 { |
567 iAllPreferences.iAccessPointSelectionMode = EAlwaysAsk; |
567 iAllPreferences.iAccessPointSelectionMode = EAlwaysAsk; |
568 break; |
568 break; |
569 } |
569 } |
570 } |
570 } |
571 |
571 |
572 //we differentiate by connecting with a Snap or an access point |
572 //we differentiate by connecting with a Snap or an access point |
573 if (iAllPreferences.iAccessPointSelectionMode == EConnectionMethod) |
573 if (iAllPreferences.iAccessPointSelectionMode == EConnectionMethod) |
574 { |
574 { |
575 //Read default AP setting |
575 //Read default AP setting |
576 ap = GetIntValue( KBrowserDefaultAccessPoint ); |
576 ap = GetIntValue( KBrowserDefaultAccessPoint ); |
577 |
577 |
578 SetDefaultAccessPointL( ap ); |
578 SetDefaultAccessPointL( ap ); |
579 } |
579 } |
580 else if (iAllPreferences.iAccessPointSelectionMode == EDestination) |
580 else if (iAllPreferences.iAccessPointSelectionMode == EDestination) |
581 { |
581 { |
582 iAllPreferences.iDefaultSnapId = GetIntValue( KBrowserNGDefaultSnapId ); |
582 iAllPreferences.iDefaultSnapId = GetIntValue( KBrowserNGDefaultSnapId ); |
583 } |
583 } |
584 |
584 |
585 // For Short Cut keys |
585 // For Short Cut keys |
586 if ( iAllPreferences.iShortCutFuncHomePg ) |
586 if ( iAllPreferences.iShortCutFuncHomePg ) |
587 { |
587 { |
588 delete iAllPreferences.iShortCutFuncHomePg; |
588 delete iAllPreferences.iShortCutFuncHomePg; |
589 iAllPreferences.iShortCutFuncHomePg = NULL; |
589 iAllPreferences.iShortCutFuncHomePg = NULL; |
684 TPtr func10 = iAllPreferences.iShortCutFuncFullScreen->Des(); |
684 TPtr func10 = iAllPreferences.iShortCutFuncFullScreen->Des(); |
685 GetStringValueL( KBrowserNGShortCutFuncFullScreen, KShortCutFuncStringLength, func10 ); |
685 GetStringValueL( KBrowserNGShortCutFuncFullScreen, KShortCutFuncStringLength, func10 ); |
686 |
686 |
687 // For Configuring Toolbar Buttons |
687 // For Configuring Toolbar Buttons |
688 iAllPreferences.iToolbarOnOff = GetIntValue( KToolbarOnOff ); |
688 iAllPreferences.iToolbarOnOff = GetIntValue( KToolbarOnOff ); |
689 |
689 |
690 iAllPreferences.iToolbarButton1Cmd = GetIntValue( KToolbarButton1Cmd ); |
690 iAllPreferences.iToolbarButton1Cmd = GetIntValue( KToolbarButton1Cmd ); |
691 iAllPreferences.iToolbarButton2Cmd = GetIntValue( KToolbarButton2Cmd ); |
691 iAllPreferences.iToolbarButton2Cmd = GetIntValue( KToolbarButton2Cmd ); |
692 iAllPreferences.iToolbarButton3Cmd = GetIntValue( KToolbarButton3Cmd ); |
692 iAllPreferences.iToolbarButton3Cmd = GetIntValue( KToolbarButton3Cmd ); |
693 iAllPreferences.iToolbarButton4Cmd = GetIntValue( KToolbarButton4Cmd ); |
693 iAllPreferences.iToolbarButton4Cmd = GetIntValue( KToolbarButton4Cmd ); |
694 iAllPreferences.iToolbarButton5Cmd = GetIntValue( KToolbarButton5Cmd ); |
694 iAllPreferences.iToolbarButton5Cmd = GetIntValue( KToolbarButton5Cmd ); |
695 iAllPreferences.iToolbarButton6Cmd = GetIntValue( KToolbarButton6Cmd ); |
695 iAllPreferences.iToolbarButton6Cmd = GetIntValue( KToolbarButton6Cmd ); |
696 iAllPreferences.iToolbarButton7Cmd = GetIntValue( KToolbarButton7Cmd ); |
696 iAllPreferences.iToolbarButton7Cmd = GetIntValue( KToolbarButton7Cmd ); |
697 |
697 |
698 // For configuring Shortcut Keys |
698 // For configuring Shortcut Keys |
699 iAllPreferences.iShortcutKeysForQwerty = GetIntValue( KShortcutKeysForQwerty ); |
699 iAllPreferences.iShortcutKeysForQwerty = GetIntValue( KShortcutKeysForQwerty ); |
700 |
700 |
701 iAllPreferences.iShortcutKey1Cmd = GetIntValue( KShortcutKey1Cmd ); |
701 iAllPreferences.iShortcutKey1Cmd = GetIntValue( KShortcutKey1Cmd ); |
702 iAllPreferences.iShortcutKey2Cmd = GetIntValue( KShortcutKey2Cmd ); |
702 iAllPreferences.iShortcutKey2Cmd = GetIntValue( KShortcutKey2Cmd ); |
703 iAllPreferences.iShortcutKey3Cmd = GetIntValue( KShortcutKey3Cmd ); |
703 iAllPreferences.iShortcutKey3Cmd = GetIntValue( KShortcutKey3Cmd ); |
704 iAllPreferences.iShortcutKey4Cmd = GetIntValue( KShortcutKey4Cmd ); |
704 iAllPreferences.iShortcutKey4Cmd = GetIntValue( KShortcutKey4Cmd ); |
705 iAllPreferences.iShortcutKey5Cmd = GetIntValue( KShortcutKey5Cmd ); |
705 iAllPreferences.iShortcutKey5Cmd = GetIntValue( KShortcutKey5Cmd ); |
713 |
713 |
714 |
714 |
715 iAllPreferences.iZoomLevelMin = GetIntValue( KBrowserNGZoomMin ); |
715 iAllPreferences.iZoomLevelMin = GetIntValue( KBrowserNGZoomMin ); |
716 iAllPreferences.iZoomLevelMax = GetIntValue( KBrowserNGZoomMax ); |
716 iAllPreferences.iZoomLevelMax = GetIntValue( KBrowserNGZoomMax ); |
717 iAllPreferences.iZoomLevelDefault = GetIntValue( KBrowserNGZoomDefault ); |
717 iAllPreferences.iZoomLevelDefault = GetIntValue( KBrowserNGZoomDefault ); |
718 |
718 |
719 iAllPreferences.iMaxRecentUrlsToShow = GetIntValue( KBrowserNGMaxRecentUrls ); |
719 iAllPreferences.iMaxRecentUrlsToShow = GetIntValue( KBrowserNGMaxRecentUrls ); |
720 |
720 |
721 iAllPreferences.iSearch = GetIntValue( KBrowserSearch ); |
721 iAllPreferences.iSearch = GetIntValue( KBrowserSearch ); |
722 iAllPreferences.iService = GetIntValue( KBrowserServices ); |
722 iAllPreferences.iService = GetIntValue( KBrowserServices ); |
723 } |
723 iAllPreferences.iCursorShowMode = (TBrCtlDefs::TCursorSettings)GetIntValue( KBrowserCursorShowMode ); |
|
724 } |
724 |
725 |
725 |
726 |
726 // ---------------------------------------------------------------------------- |
727 // ---------------------------------------------------------------------------- |
727 // CBrowserPreferences::AllPreferencesL |
728 // CBrowserPreferences::AllPreferencesL |
728 // ---------------------------------------------------------------------------- |
729 // ---------------------------------------------------------------------------- |
769 |
770 |
770 // if user-defined destination then check that destination still exists. |
771 // if user-defined destination then check that destination still exists. |
771 // if it doesn't, reset access point to always ask and homepage to blank access point home page. |
772 // if it doesn't, reset access point to always ask and homepage to blank access point home page. |
772 TUint snapId = iAllPreferences.iDefaultSnapId; |
773 TUint snapId = iAllPreferences.iDefaultSnapId; |
773 if (snapId != KWmlNoDefaultSnapId) |
774 if (snapId != KWmlNoDefaultSnapId) |
774 { |
775 { |
775 TRAPD(err, RCmDestination dest = cmManager.DestinationL( snapId )); |
776 TRAPD(err, RCmDestination dest = cmManager.DestinationL( snapId )); |
776 if (err != KErrNone) |
777 if (err != KErrNone) |
777 { |
778 { |
778 aDefaultAccessPoint = KWmlNoDefaultAccessPoint; |
779 aDefaultAccessPoint = KWmlNoDefaultAccessPoint; |
779 aAssocVpn = KWmlNoDefaultAccessPoint; |
780 aAssocVpn = KWmlNoDefaultAccessPoint; |
780 |
781 |
781 SetAccessPointSelectionModeL(EAlwaysAsk ); |
782 SetAccessPointSelectionModeL(EAlwaysAsk ); |
782 if (iAllPreferences.iHomePgType == EWmlSettingsHomePageAccessPoint) |
783 if (iAllPreferences.iHomePgType == EWmlSettingsHomePageAccessPoint) |
783 { |
784 { |
784 HBufC* buf = HBufC::NewLC( KMaxHomePgUrlLength ); // cleanupstack |
785 HBufC* buf = HBufC::NewLC( KMaxHomePgUrlLength ); // cleanupstack |
785 TPtr ptr( buf->Des() ); |
786 TPtr ptr( buf->Des() ); |
792 } |
793 } |
793 cmManager.Close(); |
794 cmManager.Close(); |
794 |
795 |
795 break; |
796 break; |
796 } |
797 } |
797 |
798 |
798 //if connecting with Iap Id |
799 //if connecting with Iap Id |
799 case EConnectionMethod: |
800 case EConnectionMethod: |
800 { |
801 { |
801 // if user-defined access point then check that access point still exists. |
802 // if user-defined access point then check that access point still exists. |
802 // if it doesn't, reset access point to always ask and homepage to blank access point home page. |
803 // if it doesn't, reset access point to always ask and homepage to blank access point home page. |
803 CApListItem* apItem = iCommsModel.AccessPointsL()->ItemForUid( aDefaultAccessPoint ); |
804 CApListItem* apItem = iCommsModel.AccessPointsL()->ItemForUid( aDefaultAccessPoint ); |
804 if (apItem == NULL) |
805 if (apItem == NULL) |
805 { |
806 { |
806 TBool isVpn = EFalse; |
807 TBool isVpn = EFalse; |
807 TRAPD(leaveCode, isVpn = iVpnEngine->IsVpnApL( aDefaultAccessPoint )) |
808 TRAPD(leaveCode, isVpn = iVpnEngine->IsVpnApL( aDefaultAccessPoint )) |
808 if ( leaveCode == KErrNone ) |
809 if ( leaveCode == KErrNone ) |
809 { |
810 { |
810 if ( isVpn ) |
811 if ( isVpn ) |
811 { |
812 { |
812 BROWSER_LOG( ( _L( " This is VPN AP which has a snap in it" ) ) ); |
813 BROWSER_LOG( ( _L( " This is VPN AP which has a snap in it" ) ) ); |
813 break; |
814 break; |
814 } |
815 } |
815 } |
816 } |
816 aDefaultAccessPoint = KWmlNoDefaultAccessPoint; |
817 aDefaultAccessPoint = KWmlNoDefaultAccessPoint; |
817 aAssocVpn = KWmlNoDefaultAccessPoint; |
818 aAssocVpn = KWmlNoDefaultAccessPoint; |
818 delete iAllPreferences.iDefaultAPDetails; |
819 delete iAllPreferences.iDefaultAPDetails; |
819 iAllPreferences.iDefaultAPDetails = NULL; |
820 iAllPreferences.iDefaultAPDetails = NULL; |
856 |
857 |
857 iVpnEngine->VpnDataL( aDefaultAccessPoint, *iVpnItem ); |
858 iVpnEngine->VpnDataL( aDefaultAccessPoint, *iVpnItem ); |
858 |
859 |
859 TUint32 ass( aDefaultAccessPoint ); |
860 TUint32 ass( aDefaultAccessPoint ); |
860 iVpnItem->ReadUint( EApVpnWapAccessPointID, ass ); |
861 iVpnItem->ReadUint( EApVpnWapAccessPointID, ass ); |
861 aAssocVpn = ass; |
862 aAssocVpn = ass; |
862 |
863 |
863 // get real WAP id |
864 // get real WAP id |
864 TUint32 ap( aDefaultAccessPoint ); |
865 TUint32 ap( aDefaultAccessPoint ); |
865 iVpnItem->ReadUint( EApVpnRealWapID, ap ); |
866 iVpnItem->ReadUint( EApVpnRealWapID, ap ); |
866 aDefaultAccessPoint = ap; |
867 aDefaultAccessPoint = ap; |
867 } |
868 } |
868 BROWSER_LOG( ( _L( "VPN OK" ) ) ); |
869 BROWSER_LOG( ( _L( "VPN OK" ) ) ); |
869 iAllPreferences.iDefaultAccessPoint = aDefaultAccessPoint; |
870 iAllPreferences.iDefaultAccessPoint = aDefaultAccessPoint; |
870 iAllPreferences.iAssocVpn = aAssocVpn; |
871 iAllPreferences.iAssocVpn = aAssocVpn; |
871 |
872 |
872 CApAccessPointItem* api = CApAccessPointItem::NewLC();//maybe we can optimise this too |
873 CApAccessPointItem* api = CApAccessPointItem::NewLC();//maybe we can optimise this too |
873 BROWSER_LOG( ( _L( "CApAccessPointItem OK" ) ) ); |
874 BROWSER_LOG( ( _L( "CApAccessPointItem OK" ) ) ); |
874 TInt err; |
875 TInt err; |
875 if ( iOverridenSettings ) |
876 if ( iOverridenSettings ) |
876 { |
877 { |
877 iCustomAp = iOverridenSettings->GetBrowserSetting( |
878 iCustomAp = iOverridenSettings->GetBrowserSetting( |
878 EBrowserOverSettingsCustomAp ); |
879 EBrowserOverSettingsCustomAp ); |
879 } |
880 } |
880 if ( ( iOverridenSettings ) && iCustomAp ) |
881 if ( ( iOverridenSettings ) && iCustomAp ) |
881 { |
882 { |
882 TRAP( err, iApDH->AccessPointDataL( iCustomAp, *api ) ); |
883 TRAP( err, iApDH->AccessPointDataL( iCustomAp, *api ) ); |
886 TRAP( err, iApDH->AccessPointDataL( iAllPreferences.iDefaultAccessPoint, *api ) ); |
887 TRAP( err, iApDH->AccessPointDataL( iAllPreferences.iDefaultAccessPoint, *api ) ); |
887 } |
888 } |
888 } |
889 } |
889 else |
890 else |
890 { |
891 { |
891 TRAP( err, iApDH->AccessPointDataL( |
892 TRAP( err, iApDH->AccessPointDataL( |
892 iAllPreferences.iDefaultAccessPoint, *api ) ); |
893 iAllPreferences.iDefaultAccessPoint, *api ) ); |
893 } |
894 } |
894 BROWSER_LOG( ( _L( " AccessPointDataL: %d" ), err ) ); |
895 BROWSER_LOG( ( _L( " AccessPointDataL: %d" ), err ) ); |
895 //Reset default AP pointer and delete the data |
896 //Reset default AP pointer and delete the data |
896 delete iAllPreferences.iDefaultAPDetails; |
897 delete iAllPreferences.iDefaultAPDetails; |
897 iAllPreferences.iDefaultAPDetails = NULL; |
898 iAllPreferences.iDefaultAPDetails = NULL; |
898 if ( err != KErrNone )//Let's select the first |
899 if ( err != KErrNone )//Let's select the first |
899 { |
900 { |
900 #ifndef __WINSCW__ //we will not select on Wins (defaultap will be assigned a uid indicating that there is |
901 #ifndef __WINSCW__ //we will not select on Wins (defaultap will be assigned a uid indicating that there is |
901 //no default ap) but rather let ConnMan show the Conn Dlg |
902 //no default ap) but rather let ConnMan show the Conn Dlg |
902 // The first valid access point has to be selected if exists |
903 // The first valid access point has to be selected if exists |
903 LOG_WRITE("WE SHOULD NOT BE HERE!!!"); |
904 LOG_WRITE("WE SHOULD NOT BE HERE!!!"); |
904 CApSelect* apSelect = CApSelect::NewLC |
905 CApSelect* apSelect = CApSelect::NewLC |
905 ( |
906 ( |
906 iCommsModel.CommsDb(), |
907 iCommsModel.CommsDb(), |
907 KEApIspTypeAll, //KEApIspTypeWAPMandatory, |
908 KEApIspTypeAll, //KEApIspTypeWAPMandatory, |
908 EApBearerTypeAll, |
909 EApBearerTypeAll, |
909 KEApSortNameAscending, |
910 KEApSortNameAscending, |
910 EIPv4 | EIPv6 |
911 EIPv4 | EIPv6 |
911 ); |
912 ); |
912 if ( apSelect->MoveToFirst() ) |
913 if ( apSelect->MoveToFirst() ) |
924 CleanupStack::PopAndDestroy(); // apSelect |
925 CleanupStack::PopAndDestroy(); // apSelect |
925 CleanupStack::Pop();//api |
926 CleanupStack::Pop();//api |
926 #else |
927 #else |
927 iAllPreferences.iDefaultAccessPoint = KWmlNoDefaultAccessPoint; |
928 iAllPreferences.iDefaultAccessPoint = KWmlNoDefaultAccessPoint; |
928 iAllPreferences.iDefaultAPDetails = NULL; |
929 iAllPreferences.iDefaultAPDetails = NULL; |
929 CleanupStack::PopAndDestroy( api ); |
930 CleanupStack::PopAndDestroy( api ); |
930 #endif//WINSCW |
931 #endif//WINSCW |
931 } |
932 } |
932 else |
933 else |
933 { |
934 { |
934 iAllPreferences.iDefaultAPDetails = api;//store new default accesspoint details |
935 iAllPreferences.iDefaultAPDetails = api;//store new default accesspoint details |
935 CleanupStack::Pop( ); // api |
936 CleanupStack::Pop( ); // api |
936 } |
937 } |
937 /* |
938 /* |
938 * If VPN set VPN AP ID to default access point! |
939 * If VPN set VPN AP ID to default access point! |
939 */ |
940 */ |
940 if( KWmlNoDefaultAccessPoint != iAllPreferences.iAssocVpn ) |
941 if( KWmlNoDefaultAccessPoint != iAllPreferences.iAssocVpn ) |
941 { |
942 { |
942 iAllPreferences.iDefaultAccessPoint = iAllPreferences.iAssocVpn; |
943 iAllPreferences.iDefaultAccessPoint = iAllPreferences.iAssocVpn; |
943 } |
944 } |
944 if( !iEmbeddedMode ) |
945 if( !iEmbeddedMode ) |
945 { |
946 { |
946 //Store ini value / gateway |
947 //Store ini value / gateway |
947 SetIntValueL ( KBrowserDefaultAccessPoint, |
948 SetIntValueL ( KBrowserDefaultAccessPoint, |
948 iAllPreferences.iDefaultAccessPoint ); |
949 iAllPreferences.iDefaultAccessPoint ); |
949 } |
950 } |
950 NotifyObserversL( EPreferencesItemChange ); |
951 NotifyObserversL( EPreferencesItemChange ); |
951 |
952 |
952 // LOG_LEAVEFN("CBrowserPreferences::SetDefaultAccessPointL"); |
953 // LOG_LEAVEFN("CBrowserPreferences::SetDefaultAccessPointL"); |
953 } |
954 } |
954 |
955 |
955 |
956 |
956 // ---------------------------------------------------------------------------- |
957 // ---------------------------------------------------------------------------- |
957 // CBrowserPreferences::SetDefaultSnapId: DestNetChange |
958 // CBrowserPreferences::SetDefaultSnapId: DestNetChange |
958 // ---------------------------------------------------------------------------- |
959 // ---------------------------------------------------------------------------- |
959 // |
960 // |
960 void CBrowserPreferences::SetDefaultSnapId (TUint aSnapId) |
961 void CBrowserPreferences::SetDefaultSnapId (TUint aSnapId) |
961 { |
962 { |
962 |
963 |
963 //storing the value of the default snap ID |
964 //storing the value of the default snap ID |
964 iAllPreferences.iDefaultSnapId = aSnapId; |
965 iAllPreferences.iDefaultSnapId = aSnapId; |
965 |
966 |
966 SetIntValueL ( KBrowserNGDefaultSnapId, |
967 SetIntValueL ( KBrowserNGDefaultSnapId, |
967 iAllPreferences.iDefaultSnapId ); |
968 iAllPreferences.iDefaultSnapId ); |
968 |
969 |
969 } |
970 } |
970 |
971 |
971 |
972 |
972 // ---------------------------------------------------------------------------- |
973 // ---------------------------------------------------------------------------- |
973 // CBrowserPreferences::SetAutoLoadContentL |
974 // CBrowserPreferences::SetAutoLoadContentL |
1003 iAllPreferences.iPageOverview = aPageOverview; |
1004 iAllPreferences.iPageOverview = aPageOverview; |
1004 |
1005 |
1005 // Store value in Shared Data and forward new setting to BrCtl |
1006 // Store value in Shared Data and forward new setting to BrCtl |
1006 if( !iEmbeddedMode ) |
1007 if( !iEmbeddedMode ) |
1007 { |
1008 { |
1008 SetIntValueL( KBrowserNGPageOverview, |
1009 SetIntValueL( KBrowserNGPageOverview, |
1009 iAllPreferences.iPageOverview ); |
1010 iAllPreferences.iPageOverview ); |
1010 } |
1011 } |
1011 NotifyObserversL( EPreferencesItemChange, |
1012 NotifyObserversL( EPreferencesItemChange, |
1012 TBrCtlDefs::ESettingsPageOverview); |
1013 TBrCtlDefs::ESettingsPageOverview); |
1013 } |
1014 } |
1014 } |
1015 } |
1015 |
1016 |
1016 // ---------------------------------------------------------------------------- |
1017 // ---------------------------------------------------------------------------- |
1017 // CBrowserPreferences::SetBackListL |
1018 // CBrowserPreferences::SetBackListL |
1018 // ---------------------------------------------------------------------------- |
1019 // ---------------------------------------------------------------------------- |
1019 // |
1020 // |
1020 void CBrowserPreferences::SetBackListL( TBool aBackList ) |
1021 void CBrowserPreferences::SetBackListL( TBool aBackList ) |
1025 iAllPreferences.iBackList = aBackList; |
1026 iAllPreferences.iBackList = aBackList; |
1026 |
1027 |
1027 // Store value in Shared Data and forward new setting to BrCtl |
1028 // Store value in Shared Data and forward new setting to BrCtl |
1028 if( !iEmbeddedMode ) |
1029 if( !iEmbeddedMode ) |
1029 { |
1030 { |
1030 SetIntValueL( KBrowserNGBackList, |
1031 SetIntValueL( KBrowserNGBackList, |
1031 iAllPreferences.iBackList ); |
1032 iAllPreferences.iBackList ); |
1032 } |
1033 } |
1033 NotifyObserversL( EPreferencesItemChange, |
1034 NotifyObserversL( EPreferencesItemChange, |
1034 TBrCtlDefs::ESettingsBackList); |
1035 TBrCtlDefs::ESettingsBackList); |
1035 } |
1036 } |
1036 } |
1037 } |
1037 |
1038 |
1038 // ---------------------------------------------------------------------------- |
1039 // ---------------------------------------------------------------------------- |
1039 // CBrowserPreferences::SetAutoRefreshL |
1040 // CBrowserPreferences::SetAutoRefreshL |
1040 // ---------------------------------------------------------------------------- |
1041 // ---------------------------------------------------------------------------- |
1041 // |
1042 // |
1042 void CBrowserPreferences::SetAutoRefreshL( TBool aAutoRefresh ) |
1043 void CBrowserPreferences::SetAutoRefreshL( TBool aAutoRefresh ) |
1047 iAllPreferences.iAutoRefresh = aAutoRefresh; |
1048 iAllPreferences.iAutoRefresh = aAutoRefresh; |
1048 |
1049 |
1049 // Store value in Shared Data and forward new setting to BrCtl |
1050 // Store value in Shared Data and forward new setting to BrCtl |
1050 if( !iEmbeddedMode ) |
1051 if( !iEmbeddedMode ) |
1051 { |
1052 { |
1052 SetIntValueL( KBrowserNGAutoRefresh, |
1053 SetIntValueL( KBrowserNGAutoRefresh, |
1053 iAllPreferences.iAutoRefresh ); |
1054 iAllPreferences.iAutoRefresh ); |
1054 } |
1055 } |
1055 NotifyObserversL( EPreferencesItemChange, |
1056 NotifyObserversL( EPreferencesItemChange, |
1056 TBrCtlDefs::ESettingsAutoRefresh); |
1057 TBrCtlDefs::ESettingsAutoRefresh); |
1057 } |
1058 } |
1058 } |
1059 } |
1059 |
1060 |
1060 // ---------------------------------------------------------------------------- |
1061 // ---------------------------------------------------------------------------- |
1061 // CBrowserPreferences::SetTextWrapL |
1062 // CBrowserPreferences::SetTextWrapL |
1062 // ---------------------------------------------------------------------------- |
1063 // ---------------------------------------------------------------------------- |
1063 // |
1064 // |
1107 { |
1108 { |
1108 LOG_ENTERFN("CBrowserPreferences::SetEncodingL"); |
1109 LOG_ENTERFN("CBrowserPreferences::SetEncodingL"); |
1109 if ( aEncoding != iAllPreferences.iEncoding ) |
1110 if ( aEncoding != iAllPreferences.iEncoding ) |
1110 { |
1111 { |
1111 iAllPreferences.iEncoding = aEncoding; |
1112 iAllPreferences.iEncoding = aEncoding; |
1112 |
1113 |
1113 // Store value in Shared Data and forward new setting to BrCtl |
1114 // Store value in Shared Data and forward new setting to BrCtl |
1114 if( !iEmbeddedMode ) |
1115 if( !iEmbeddedMode ) |
1115 { |
1116 { |
1116 SetIntValueL ( KBrowserNGEncoding, |
1117 SetIntValueL ( KBrowserNGEncoding, |
1117 ( TInt ) iAllPreferences.iEncoding ); |
1118 ( TInt ) iAllPreferences.iEncoding ); |
1118 } |
1119 } |
1119 NotifyObserversL( EPreferencesItemChange, |
1120 NotifyObserversL( EPreferencesItemChange, |
1120 TBrCtlDefs::ESettingsCharacterset ); |
1121 TBrCtlDefs::ESettingsCharacterset ); |
1121 } |
1122 } |
1122 } |
1123 } |
1123 |
1124 |
1124 // ---------------------------------------------------------------------------- |
1125 // ---------------------------------------------------------------------------- |
1129 { |
1130 { |
1130 LOG_ENTERFN("CBrowserPreferences::SetScriptLogL"); |
1131 LOG_ENTERFN("CBrowserPreferences::SetScriptLogL"); |
1131 if ( aScriptLog != iAllPreferences.iScriptLog ) |
1132 if ( aScriptLog != iAllPreferences.iScriptLog ) |
1132 { |
1133 { |
1133 iAllPreferences.iScriptLog = aScriptLog; |
1134 iAllPreferences.iScriptLog = aScriptLog; |
1134 |
1135 |
1135 // Store value in Shared Data and forward new setting to BrCtl |
1136 // Store value in Shared Data and forward new setting to BrCtl |
1136 if( !iEmbeddedMode ) |
1137 if( !iEmbeddedMode ) |
1137 { |
1138 { |
1138 TBool ret = SetIntValueL ( KBrowserNGScriptLog, |
1139 TBool ret = SetIntValueL ( KBrowserNGScriptLog, |
1139 ( TInt ) iAllPreferences.iScriptLog ); |
1140 ( TInt ) iAllPreferences.iScriptLog ); |
1140 } |
1141 } |
1141 NotifyObserversL( EPreferencesItemChange, |
1142 NotifyObserversL( EPreferencesItemChange, |
1142 TBrCtlDefs::ESettingsScriptLog ); |
1143 TBrCtlDefs::ESettingsScriptLog ); |
1143 } |
1144 } |
1144 } |
1145 } |
1145 |
1146 |
1146 // ---------------------------------------------------------------------------- |
1147 // ---------------------------------------------------------------------------- |
1147 // CBrowserPreferences::SetAdaptiveBookmarksL |
1148 // CBrowserPreferences::SetAdaptiveBookmarksL |
1148 // ---------------------------------------------------------------------------- |
1149 // ---------------------------------------------------------------------------- |
1149 // |
1150 // |
1150 void CBrowserPreferences::SetAdaptiveBookmarksL( |
1151 void CBrowserPreferences::SetAdaptiveBookmarksL( |
1151 TWmlSettingsAdaptiveBookmarks aAdaptiveBookmarks ) |
1152 TWmlSettingsAdaptiveBookmarks aAdaptiveBookmarks ) |
1152 { |
1153 { |
1153 LOG_ENTERFN( "CBrowserPreferences::SetAdaptiveBookmarksL" ); |
1154 LOG_ENTERFN( "CBrowserPreferences::SetAdaptiveBookmarksL" ); |
1154 |
1155 |
1155 if ( ADAPTIVEBOOKMARKS ) |
1156 if ( ADAPTIVEBOOKMARKS ) |
1156 { |
1157 { |
1157 if ( aAdaptiveBookmarks != iAllPreferences.iAdaptiveBookmarks ) |
1158 if ( aAdaptiveBookmarks != iAllPreferences.iAdaptiveBookmarks ) |
1158 { |
1159 { |
1159 iAllPreferences.iAdaptiveBookmarks = aAdaptiveBookmarks; |
1160 iAllPreferences.iAdaptiveBookmarks = aAdaptiveBookmarks; |
1160 |
1161 |
1161 if( !iEmbeddedMode ) |
1162 if( !iEmbeddedMode ) |
1162 { |
1163 { |
1163 |
1164 |
1164 switch( iAllPreferences.iAdaptiveBookmarks ) |
1165 switch( iAllPreferences.iAdaptiveBookmarks ) |
1165 { |
1166 { |
1166 case (EWmlSettingsAdaptiveBookmarksOn): |
1167 case (EWmlSettingsAdaptiveBookmarksOn): |
1167 { |
1168 { |
1168 |
1169 |
1169 SetIntValueL ( KBrowserNGAdaptiveBookmarks, |
1170 SetIntValueL ( KBrowserNGAdaptiveBookmarks, |
1170 KBrowserAdaptiveBookmarksSettingDataOn ); |
1171 KBrowserAdaptiveBookmarksSettingDataOn ); |
1171 break; |
1172 break; |
1172 } |
1173 } |
1173 case (EWmlSettingsAdaptiveBookmarksHideFolder): |
1174 case (EWmlSettingsAdaptiveBookmarksHideFolder): |
1174 { |
1175 { |
1175 SetIntValueL ( KBrowserNGAdaptiveBookmarks, |
1176 SetIntValueL ( KBrowserNGAdaptiveBookmarks, |
1176 KBrowserAdaptiveBookmarksSettingDataHideFolder ); |
1177 KBrowserAdaptiveBookmarksSettingDataHideFolder ); |
1177 break; |
1178 break; |
1178 } |
1179 } |
1179 case (EWmlSettingsAdaptiveBookmarksOff): |
1180 case (EWmlSettingsAdaptiveBookmarksOff): |
1180 { |
1181 { |
1181 SetIntValueL ( KBrowserNGAdaptiveBookmarks, |
1182 SetIntValueL ( KBrowserNGAdaptiveBookmarks, |
1182 KBrowserAdaptiveBookmarksSettingDataOff ); |
1183 KBrowserAdaptiveBookmarksSettingDataOff ); |
1183 break; |
1184 break; |
1184 } |
1185 } |
1185 default: |
1186 default: |
1186 { |
1187 { |
1198 // --------------------------------------------------------- |
1199 // --------------------------------------------------------- |
1199 // |
1200 // |
1200 void CBrowserPreferences::SetFullScreenL( TWmlSettingsFullScreen aFullScreen ) |
1201 void CBrowserPreferences::SetFullScreenL( TWmlSettingsFullScreen aFullScreen ) |
1201 { |
1202 { |
1202 LOG_ENTERFN("CBrowserPreferences::SetFullScreenL"); |
1203 LOG_ENTERFN("CBrowserPreferences::SetFullScreenL"); |
1203 |
1204 |
1204 if ( aFullScreen != iAllPreferences.iFullScreen ) |
1205 if ( aFullScreen != iAllPreferences.iFullScreen ) |
1205 { |
1206 { |
1206 iAllPreferences.iFullScreen = aFullScreen; |
1207 iAllPreferences.iFullScreen = aFullScreen; |
1207 if( !iEmbeddedMode ) |
1208 if( !iEmbeddedMode ) |
1208 { |
1209 { |
1209 switch ( iAllPreferences.iFullScreen ) |
1210 switch ( iAllPreferences.iFullScreen ) |
1210 { |
1211 { |
1211 case EWmlSettingsFullScreenSoftkeysOnly: |
1212 case EWmlSettingsFullScreenSoftkeysOnly: |
1212 { |
1213 { |
1213 SetIntValueL ( KBrowserNGFullScreen, |
1214 SetIntValueL ( KBrowserNGFullScreen, |
1214 KBrowserFullScreenSettingDataSoftkeysOn ); |
1215 KBrowserFullScreenSettingDataSoftkeysOn ); |
1215 break; |
1216 break; |
1216 } |
1217 } |
1217 case EWmlSettingsFullScreenFullScreen: |
1218 case EWmlSettingsFullScreenFullScreen: |
1218 { |
1219 { |
1219 SetIntValueL ( KBrowserNGFullScreen, |
1220 SetIntValueL ( KBrowserNGFullScreen, |
1220 KBrowserFullScreenSettingDataSoftkeysOff ); |
1221 KBrowserFullScreenSettingDataSoftkeysOff ); |
1221 break; |
1222 break; |
1222 } |
1223 } |
1223 default: |
1224 default: |
1224 { |
1225 { |
1225 break; |
1226 break; |
1226 } |
1227 } |
1227 } |
1228 } |
1228 } |
1229 } |
1229 NotifyObserversL( EPreferencesItemChange ); // ContentView is interested |
1230 NotifyObserversL( EPreferencesItemChange ); // ContentView is interested |
1230 } |
1231 } |
1231 } |
1232 } |
1305 if ( aWarningsOn != iAllPreferences.iHttpSecurityWarnings ) |
1306 if ( aWarningsOn != iAllPreferences.iHttpSecurityWarnings ) |
1306 { |
1307 { |
1307 iAllPreferences.iHttpSecurityWarnings = aWarningsOn; |
1308 iAllPreferences.iHttpSecurityWarnings = aWarningsOn; |
1308 if( !iEmbeddedMode ) |
1309 if( !iEmbeddedMode ) |
1309 { |
1310 { |
1310 SetIntValueL ( KBrowserNGShowSecurityWarnings, |
1311 SetIntValueL ( KBrowserNGShowSecurityWarnings, |
1311 (TInt) iAllPreferences.iHttpSecurityWarnings ); |
1312 (TInt) iAllPreferences.iHttpSecurityWarnings ); |
1312 } |
1313 } |
1313 NotifyObserversL( EPreferencesItemChange, |
1314 NotifyObserversL( EPreferencesItemChange, |
1314 TBrCtlDefs::ESettingsSecurityWarnings ); |
1315 TBrCtlDefs::ESettingsSecurityWarnings ); |
1315 } |
1316 } |
1316 } |
1317 } |
1317 |
1318 |
1318 // ---------------------------------------------------------------------------- |
1319 // ---------------------------------------------------------------------------- |
1319 // CBrowserPreferences::SetIMEINotification |
1320 // CBrowserPreferences::SetIMEINotification |
1320 // ---------------------------------------------------------------------------- |
1321 // ---------------------------------------------------------------------------- |
1321 // |
1322 // |
1322 void CBrowserPreferences::SetIMEINotificationL( |
1323 void CBrowserPreferences::SetIMEINotificationL( |
1323 TWmlSettingsIMEI aIMEINotification ) |
1324 TWmlSettingsIMEI aIMEINotification ) |
1324 { |
1325 { |
1325 LOG_ENTERFN("CBrowserPreferences::SetIMEINotificationL"); |
1326 LOG_ENTERFN("CBrowserPreferences::SetIMEINotificationL"); |
1326 if ( IMEI_NOTIFICATION ) |
1327 if ( IMEI_NOTIFICATION ) |
1327 { |
1328 { |
1328 if ( aIMEINotification != iAllPreferences.iIMEINotification ) |
1329 if ( aIMEINotification != iAllPreferences.iIMEINotification ) |
1329 { |
1330 { |
1330 iAllPreferences.iIMEINotification = aIMEINotification; |
1331 iAllPreferences.iIMEINotification = aIMEINotification; |
1331 |
1332 |
1332 // Store value in Shared Data and forward new setting to BrCtl |
1333 // Store value in Shared Data and forward new setting to BrCtl |
1333 if( !iEmbeddedMode ) |
1334 if( !iEmbeddedMode ) |
1334 { |
1335 { |
1335 SetIntValueL( KBrowserIMEINotification, |
1336 SetIntValueL( KBrowserIMEINotification, |
1336 iAllPreferences.iIMEINotification ); |
1337 iAllPreferences.iIMEINotification ); |
1337 } |
1338 } |
1338 NotifyObserversL( EPreferencesItemChange, |
1339 NotifyObserversL( EPreferencesItemChange, |
1339 TBrCtlDefs::ESettingsIMEINotifyEnabled ); |
1340 TBrCtlDefs::ESettingsIMEINotifyEnabled ); |
1340 } |
1341 } |
1341 } |
1342 } |
1342 } |
1343 } |
1343 |
1344 |
1374 // if we are requiring a force load from the shared data, or our homepage |
1375 // if we are requiring a force load from the shared data, or our homepage |
1375 // is set to be something other than the access point's home page, get |
1376 // is set to be something other than the access point's home page, get |
1376 // the value of the home page from the shared data |
1377 // the value of the home page from the shared data |
1377 homePgFound = GetStringValueL( KBrowserNGHomepageURL, KMaxHomePgUrlLength, aUrl ); |
1378 homePgFound = GetStringValueL( KBrowserNGHomepageURL, KMaxHomePgUrlLength, aUrl ); |
1378 } |
1379 } |
1379 else if ((iAllPreferences.iAccessPointSelectionMode == EConnectionMethod) && |
1380 else if ((iAllPreferences.iAccessPointSelectionMode == EConnectionMethod) && |
1380 (pgtype == EWmlSettingsHomePageAccessPoint)) |
1381 (pgtype == EWmlSettingsHomePageAccessPoint)) |
1381 { |
1382 { |
1382 // The user has a defined access point, and wants to use the access point's |
1383 // The user has a defined access point, and wants to use the access point's |
1383 // home page |
1384 // home page |
1384 BROWSER_LOG( ( _L( "HomePageUrl, Access Point" ) ) ); |
1385 BROWSER_LOG( ( _L( "HomePageUrl, Access Point" ) ) ); |
1385 |
1386 |
1386 TUint defaultAp = DefaultAccessPoint(); |
1387 TUint defaultAp = DefaultAccessPoint(); |
1387 if ( defaultAp != KWmlNoDefaultAccessPoint ) // There is an access point defined |
1388 if ( defaultAp != KWmlNoDefaultAccessPoint ) // There is an access point defined |
1388 { |
1389 { |
1389 CApAccessPointItem* apItem = iAllPreferences.iDefaultAPDetails; |
1390 CApAccessPointItem* apItem = iAllPreferences.iDefaultAPDetails; |
1390 if ( apItem ) |
1391 if ( apItem ) |
1515 { |
1516 { |
1516 iAllPreferences.iFormDataSaving = aFormDataSaving; |
1517 iAllPreferences.iFormDataSaving = aFormDataSaving; |
1517 |
1518 |
1518 |
1519 |
1519 // TO DO: Add to cenrep |
1520 // TO DO: Add to cenrep |
1520 SetIntValueL( KBrowserFormDataSaving, |
1521 SetIntValueL( KBrowserFormDataSaving, |
1521 iAllPreferences.iFormDataSaving ); |
1522 iAllPreferences.iFormDataSaving ); |
1522 } |
1523 } |
1523 NotifyObserversL( EPreferencesItemChange, |
1524 NotifyObserversL( EPreferencesItemChange, |
1524 TBrCtlDefs::ESettingsAutoFormFillEnabled ); |
1525 TBrCtlDefs::ESettingsAutoFormFillEnabled ); |
1525 } |
1526 } |
1526 |
1527 |
1527 // ---------------------------------------------------------------------------- |
1528 // ---------------------------------------------------------------------------- |
1528 // CBrowserPreferences::GetIntValue |
1529 // CBrowserPreferences::GetIntValue |
1529 // ---------------------------------------------------------------------------- |
1530 // ---------------------------------------------------------------------------- |
1530 // |
1531 // |
1531 TInt CBrowserPreferences::GetIntValue( TUint32 aKey) const |
1532 TInt CBrowserPreferences::GetIntValue( TUint32 aKey) const |
1532 { |
1533 { |
1533 LOG_ENTERFN("CBrowserPreferences::GetIntValue"); |
1534 LOG_ENTERFN("CBrowserPreferences::GetIntValue"); |
1534 TInt retVal = 0; |
1535 TInt retVal = 0; |
1535 |
1536 |
1536 if ( iRepository ) |
1537 if ( iRepository ) |
1537 { |
1538 { |
1538 iRepository->Get(aKey, retVal); |
1539 iRepository->Get(aKey, retVal); |
1539 } |
1540 } |
1540 |
1541 |
1541 BROWSER_LOG( ( _L( "CBrowserPreferences::GetIntValue returns %d" ), retVal ) ); |
1542 BROWSER_LOG( ( _L( "CBrowserPreferences::GetIntValue returns %d" ), retVal ) ); |
1542 return retVal; |
1543 return retVal; |
1543 } |
1544 } |
1544 |
1545 |
1545 // ---------------------------------------------------------------------------- |
1546 // ---------------------------------------------------------------------------- |
1546 // CBrowserPreferences::SetIntValueL |
1547 // CBrowserPreferences::SetIntValueL |
1547 // ---------------------------------------------------------------------------- |
1548 // ---------------------------------------------------------------------------- |
1548 // |
1549 // |
1549 TBool CBrowserPreferences::SetIntValueL ( TUint32 aKey, const TInt& aValue ) |
1550 TBool CBrowserPreferences::SetIntValueL ( TUint32 aKey, const TInt& aValue ) |
1550 { |
1551 { |
1551 LOG_ENTERFN("CBrowserPreferences::SetIntValueL"); |
1552 LOG_ENTERFN("CBrowserPreferences::SetIntValueL"); |
1552 BROWSER_LOG( ( _L( "aValue: %d" ), aValue ) ); |
1553 BROWSER_LOG( ( _L( "aValue: %d" ), aValue ) ); |
1553 |
1554 |
1554 // Log setting value BEFORE the change |
1555 // Log setting value BEFORE the change |
1555 #ifdef I__BROWSER_LOG_ENABLED |
1556 #ifdef I__BROWSER_LOG_ENABLED |
1556 TInt preValue; |
1557 TInt preValue; |
1557 iRepository->Get( aKey, preValue ); |
1558 iRepository->Get( aKey, preValue ); |
1558 BROWSER_LOG( ( _L( "Prechange CenRep setting value: %d" ), preValue ) ); |
1559 BROWSER_LOG( ( _L( "Prechange CenRep setting value: %d" ), preValue ) ); |
1559 #endif // I__BROWSER_LOG_ENABLED |
1560 #endif // I__BROWSER_LOG_ENABLED |
1560 |
1561 |
1561 TBool retVal=EFalse; |
1562 TBool retVal=EFalse; |
1562 if ( iRepository && ( KErrNone == iRepository->Set( aKey, aValue ) ) ) |
1563 if ( iRepository && ( KErrNone == iRepository->Set( aKey, aValue ) ) ) |
1563 { |
1564 { |
1564 retVal = ETrue; |
1565 retVal = ETrue; |
1565 } |
1566 } |
1566 |
1567 |
1567 // Log setting value AFTER the change |
1568 // Log setting value AFTER the change |
1568 #ifdef I__BROWSER_LOG_ENABLED |
1569 #ifdef I__BROWSER_LOG_ENABLED |
1569 TInt postValue; |
1570 TInt postValue; |
1570 iRepository->Get( aKey, postValue ); |
1571 iRepository->Get( aKey, postValue ); |
1571 BROWSER_LOG( ( _L( "Postchange CenRep setting value: %d" ), postValue ) ); |
1572 BROWSER_LOG( ( _L( "Postchange CenRep setting value: %d" ), postValue ) ); |
1572 #endif // I__BROWSER_LOG_ENABLED |
1573 #endif // I__BROWSER_LOG_ENABLED |
1573 |
1574 |
1574 BROWSER_LOG( ( _L( "CBrowserPreferences::SetIntValueL returns %d" ), retVal ) ); |
1575 BROWSER_LOG( ( _L( "CBrowserPreferences::SetIntValueL returns %d" ), retVal ) ); |
1575 return retVal; |
1576 return retVal; |
1576 } |
1577 } |
1577 |
1578 |
1578 // ---------------------------------------------------------------------------- |
1579 // ---------------------------------------------------------------------------- |
1579 // CBrowserPreferences::GetStringValueL |
1580 // CBrowserPreferences::GetStringValueL |
1580 // ---------------------------------------------------------------------------- |
1581 // ---------------------------------------------------------------------------- |
1581 // |
1582 // |
1596 { |
1597 { |
1597 retVal = HBufC::NewL( value.Length() ); |
1598 retVal = HBufC::NewL( value.Length() ); |
1598 TPtr ptr = retVal->Des(); |
1599 TPtr ptr = retVal->Des(); |
1599 ptr.Copy ( value ); |
1600 ptr.Copy ( value ); |
1600 } |
1601 } |
1601 |
1602 |
1602 #ifdef _DEBUG |
1603 #ifdef _DEBUG |
1603 TPtrC logString = *retVal; |
1604 TPtrC logString = *retVal; |
1604 BROWSER_LOG( ( _L( "CBrowserPreferences::GetStringValueL returns %S" ), &logString ) ); |
1605 BROWSER_LOG( ( _L( "CBrowserPreferences::GetStringValueL returns %S" ), &logString ) ); |
1605 #endif // _DEBUG |
1606 #endif // _DEBUG |
1606 |
1607 |
1607 return retVal; |
1608 return retVal; |
1608 } |
1609 } |
1609 |
1610 |
1610 // ---------------------------------------------------------------------------- |
1611 // ---------------------------------------------------------------------------- |
1611 // CBrowserPreferences::GetStringValueL |
1612 // CBrowserPreferences::GetStringValueL |
1612 // ---------------------------------------------------------------------------- |
1613 // ---------------------------------------------------------------------------- |
1613 // |
1614 // |
1614 TInt CBrowserPreferences::GetStringValueL( |
1615 TInt CBrowserPreferences::GetStringValueL( |
1615 TUint32 aKey, TInt aMaxBufSize, |
1616 TUint32 aKey, TInt aMaxBufSize, |
1616 TDes& aBuf) const |
1617 TDes& aBuf) const |
1617 { |
1618 { |
1618 LOG_ENTERFN("CBrowserPreferences::GetStringValueL(TUint32,TInt,TDes&)"); |
1619 LOG_ENTERFN("CBrowserPreferences::GetStringValueL(TUint32,TInt,TDes&)"); |
1619 // Not sure this works, but CRepository has no information about the return |
1620 // Not sure this works, but CRepository has no information about the return |
1620 // values of the methods. |
1621 // values of the methods. |
1621 // So dont know if iRepository->Get returns with an errorid on error,therefore |
1622 // So dont know if iRepository->Get returns with an errorid on error,therefore |
1622 // error = iRepository->Get( aKey, ptr ) may not work. |
1623 // error = iRepository->Get( aKey, ptr ) may not work. |
1623 TInt length( 256 ); |
1624 TInt length( 256 ); |
1624 HBufC* value = HBufC::NewL( length ); |
1625 HBufC* value = HBufC::NewL( length ); |
1625 TPtr ptr = value->Des(); |
1626 TPtr ptr = value->Des(); |
1626 TInt error; |
1627 TInt error; |
1627 |
1628 |
1628 error = iRepository->Get( aKey, ptr ); |
1629 error = iRepository->Get( aKey, ptr ); |
1629 |
1630 |
1630 for( length=length*2; (error==KErrTooBig) && (length<aMaxBufSize); length=length*2) |
1631 for( length=length*2; (error==KErrTooBig) && (length<aMaxBufSize); length=length*2) |
1631 { |
1632 { |
1632 delete value; |
1633 delete value; |
1633 value = HBufC::NewL( length ); |
1634 value = HBufC::NewL( length ); |
1634 ptr = value->Des(); |
1635 ptr = value->Des(); |
1635 |
1636 |
1636 error = iRepository->Get( aKey, ptr ); |
1637 error = iRepository->Get( aKey, ptr ); |
1637 } |
1638 } |
1638 if( error == KErrNone ) |
1639 if( error == KErrNone ) |
1639 { |
1640 { |
1640 aBuf.Zero(); |
1641 aBuf.Zero(); |
1641 aBuf.Append( ptr ); |
1642 aBuf.Append( ptr ); |
1642 } |
1643 } |
1643 delete value; |
1644 delete value; |
1644 |
1645 |
1645 BROWSER_LOG( ( _L( "CBrowserPreferences::GetStringValueL(TUint32,TInt,TDes&) returns %d" ), |
1646 BROWSER_LOG( ( _L( "CBrowserPreferences::GetStringValueL(TUint32,TInt,TDes&) returns %d" ), |
1646 error ) ); |
1647 error ) ); |
1647 return error; |
1648 return error; |
1648 } |
1649 } |
1649 |
1650 |
1660 #ifdef _DEBUG |
1661 #ifdef _DEBUG |
1661 TPtrC paramVal = aValue; |
1662 TPtrC paramVal = aValue; |
1662 BROWSER_LOG( ( _L( "aValue %S" ), ¶mVal ) ); |
1663 BROWSER_LOG( ( _L( "aValue %S" ), ¶mVal ) ); |
1663 HBufC* doNothing = HBufC::NewL( 512 ); |
1664 HBufC* doNothing = HBufC::NewL( 512 ); |
1664 TPtr preChange = doNothing->Des(); |
1665 TPtr preChange = doNothing->Des(); |
1665 iRepository->Get( aKey, preChange ); |
1666 iRepository->Get( aKey, preChange ); |
1666 BROWSER_LOG( ( _L( "Prechange CenRep setting value: %S" ), &preChange ) ); |
1667 BROWSER_LOG( ( _L( "Prechange CenRep setting value: %S" ), &preChange ) ); |
1667 delete doNothing; |
1668 delete doNothing; |
1668 #endif // _DEBUG |
1669 #endif // _DEBUG |
1669 |
1670 |
1670 TBool retVal=EFalse; |
1671 TBool retVal=EFalse; |
1671 |
1672 |
1672 if ( iRepository && ( KErrNone == iRepository->Set( aKey, aValue ) ) ) |
1673 if ( iRepository && ( KErrNone == iRepository->Set( aKey, aValue ) ) ) |
1673 { |
1674 { |
1674 retVal = ETrue; |
1675 retVal = ETrue; |
1675 } |
1676 } |
1676 // Log setting value AFTER the change |
1677 // Log setting value AFTER the change |
1677 #ifdef _DEBUG |
1678 #ifdef _DEBUG |
1678 HBufC* doNothing2 = HBufC::NewL( 512 ); |
1679 HBufC* doNothing2 = HBufC::NewL( 512 ); |
1679 TPtr postChange = doNothing2->Des(); |
1680 TPtr postChange = doNothing2->Des(); |
1680 iRepository->Get( aKey, postChange ); |
1681 iRepository->Get( aKey, postChange ); |
1681 |
1682 |
1682 BROWSER_LOG( ( _L( "Postchange CenRep setting value: %S" ), &postChange ) ); |
1683 BROWSER_LOG( ( _L( "Postchange CenRep setting value: %S" ), &postChange ) ); |
1683 delete doNothing2; |
1684 delete doNothing2; |
1684 #endif // _DEBUG |
1685 #endif // _DEBUG |
1685 |
1686 |
1686 BROWSER_LOG( ( _L( "CBrowserPreferences::SetStringValueL returns %d" ), retVal) ); |
1687 BROWSER_LOG( ( _L( "CBrowserPreferences::SetStringValueL returns %d" ), retVal) ); |
1687 return retVal; |
1688 return retVal; |
1688 } |
1689 } |
1689 |
1690 |
1690 // ---------------------------------------------------------------------------- |
1691 // ---------------------------------------------------------------------------- |
1790 LOG_ENTERFN("CBrowserPreferences::SetHomePageUrlL"); |
1791 LOG_ENTERFN("CBrowserPreferences::SetHomePageUrlL"); |
1791 |
1792 |
1792 if( aHomePageURL.Length() ) |
1793 if( aHomePageURL.Length() ) |
1793 { |
1794 { |
1794 // Save the homepage with a scheme (default is http if not specified). |
1795 // Save the homepage with a scheme (default is http if not specified). |
1795 HBufC* temp = Util::AllocateUrlWithSchemeL( aHomePageURL ); |
1796 HBufC* temp = Util::AllocateUrlWithSchemeL( aHomePageURL ); |
1796 delete iAllPreferences.iHomePgURL; |
1797 delete iAllPreferences.iHomePgURL; |
1797 iAllPreferences.iHomePgURL = temp; |
1798 iAllPreferences.iHomePgURL = temp; |
1798 SetStringValueL( KBrowserNGHomepageURL, |
1799 SetStringValueL( KBrowserNGHomepageURL, |
1799 iAllPreferences.iHomePgURL->Des() ); |
1800 iAllPreferences.iHomePgURL->Des() ); |
1800 } |
1801 } |
1801 } |
1802 } |
1802 |
1803 |
1803 // ---------------------------------------------------------------------------- |
1804 // ---------------------------------------------------------------------------- |
1807 void CBrowserPreferences::SetSearchPageUrlL( const TDesC& aSearchPageURL ) |
1808 void CBrowserPreferences::SetSearchPageUrlL( const TDesC& aSearchPageURL ) |
1808 { |
1809 { |
1809 LOG_ENTERFN("CBrowserPreferences::SetSearchPageUrlL"); |
1810 LOG_ENTERFN("CBrowserPreferences::SetSearchPageUrlL"); |
1810 |
1811 |
1811 // Save the searchpage with a scheme (default is http if not specified). |
1812 // Save the searchpage with a scheme (default is http if not specified). |
1812 HBufC* temp = Util::AllocateUrlWithSchemeL( aSearchPageURL ); |
1813 HBufC* temp = Util::AllocateUrlWithSchemeL( aSearchPageURL ); |
1813 delete iAllPreferences.iSearchPgURL; |
1814 delete iAllPreferences.iSearchPgURL; |
1814 iAllPreferences.iSearchPgURL = temp; |
1815 iAllPreferences.iSearchPgURL = temp; |
1815 SetStringValueL( KBrowserNGSearchPageURL, |
1816 SetStringValueL( KBrowserNGSearchPageURL, |
1816 iAllPreferences.iSearchPgURL->Des() ); |
1817 iAllPreferences.iSearchPgURL->Des() ); |
1817 } |
1818 } |
1818 |
1819 |
1819 // ---------------------------------------------------------------------------- |
1820 // ---------------------------------------------------------------------------- |
1820 // CBrowserPreferences::FlushSD() |
1821 // CBrowserPreferences::FlushSD() |
1887 |
1888 |
1888 // ---------------------------------------------------------------------------- |
1889 // ---------------------------------------------------------------------------- |
1889 // CBrowserPreferences::SetAccessPointSelectionModeL |
1890 // CBrowserPreferences::SetAccessPointSelectionModeL |
1890 // ---------------------------------------------------------------------------- |
1891 // ---------------------------------------------------------------------------- |
1891 // |
1892 // |
1892 void CBrowserPreferences::SetAccessPointSelectionModeL( |
1893 void CBrowserPreferences::SetAccessPointSelectionModeL( |
1893 TCmSettingSelectionMode aAccessPointSelectionMode ) |
1894 TCmSettingSelectionMode aAccessPointSelectionMode ) |
1894 { |
1895 { |
1895 LOG_ENTERFN("CBrowserPreferences::SetAccessPointSelectionModeL"); |
1896 LOG_ENTERFN("CBrowserPreferences::SetAccessPointSelectionModeL"); |
1896 |
1897 |
1897 if ( aAccessPointSelectionMode != iAllPreferences.iAccessPointSelectionMode ) |
1898 if ( aAccessPointSelectionMode != iAllPreferences.iAccessPointSelectionMode ) |
1898 { |
1899 { |
1899 iAllPreferences.iAccessPointSelectionMode = aAccessPointSelectionMode; |
1900 iAllPreferences.iAccessPointSelectionMode = aAccessPointSelectionMode; |
1900 |
1901 |
1901 switch ( aAccessPointSelectionMode ) |
1902 switch ( aAccessPointSelectionMode ) |
1902 { |
1903 { |
1903 case EAlwaysAsk: |
1904 case EAlwaysAsk: |
1904 { |
1905 { |
1905 SetIntValueL ( KBrowserAccessPointSelectionMode, EBrowserCenRepApSelModeAlwaysAsk ); |
1906 SetIntValueL ( KBrowserAccessPointSelectionMode, EBrowserCenRepApSelModeAlwaysAsk ); |
1906 break; |
1907 break; |
1907 } |
1908 } |
1908 case EDestination: |
1909 case EDestination: |
1909 { |
1910 { |
1910 SetIntValueL ( KBrowserAccessPointSelectionMode, EBrowserCenRepApSelModeDestination ); |
1911 SetIntValueL ( KBrowserAccessPointSelectionMode, EBrowserCenRepApSelModeDestination ); |
1911 break; |
1912 break; |
1912 } |
1913 } |
1913 case EConnectionMethod: |
1914 case EConnectionMethod: |
1914 { |
1915 { |
1915 SetIntValueL ( KBrowserAccessPointSelectionMode, EBrowserCenRepApSelModeUserDefined ); |
1916 SetIntValueL ( KBrowserAccessPointSelectionMode, EBrowserCenRepApSelModeUserDefined ); |
1916 break; |
1917 break; |
1917 } |
1918 } |
1918 default: |
1919 default: |
1919 { |
1920 { |
1920 SetIntValueL ( KBrowserAccessPointSelectionMode, EBrowserCenRepApSelModeAlwaysAsk ); |
1921 SetIntValueL ( KBrowserAccessPointSelectionMode, EBrowserCenRepApSelModeAlwaysAsk ); |
1921 break; |
1922 break; |
1922 } |
1923 } |
1923 } |
1924 } |
1924 } |
1925 } |
1925 } |
1926 } |
1926 |
1927 |
1927 // ---------------------------------------------------------------------------- |
1928 // ---------------------------------------------------------------------------- |
1928 // CBrowserPreferences::SetAutomaticUpdatingApL |
1929 // CBrowserPreferences::SetAutomaticUpdatingApL |
1929 // ---------------------------------------------------------------------------- |
1930 // ---------------------------------------------------------------------------- |
1941 { |
1942 { |
1942 LOG_ENTERFN("CBrowserPreferences::SetAutomaticUpdatingWhileRoamingL"); |
1943 LOG_ENTERFN("CBrowserPreferences::SetAutomaticUpdatingWhileRoamingL"); |
1943 if ( aAutoUpdateRoaming != iAllPreferences.iAutomaticUpdatingWhileRoaming ) |
1944 if ( aAutoUpdateRoaming != iAllPreferences.iAutomaticUpdatingWhileRoaming ) |
1944 { |
1945 { |
1945 iAllPreferences.iAutomaticUpdatingWhileRoaming = aAutoUpdateRoaming; |
1946 iAllPreferences.iAutomaticUpdatingWhileRoaming = aAutoUpdateRoaming; |
1946 SetIntValueL( KBrowserNGAutomaticUpdatingWhileRoaming, |
1947 SetIntValueL( KBrowserNGAutomaticUpdatingWhileRoaming, |
1947 iAllPreferences.iAutomaticUpdatingWhileRoaming ); |
1948 iAllPreferences.iAutomaticUpdatingWhileRoaming ); |
1948 } |
1949 } |
1949 |
1950 |
1950 } |
1951 } |
1951 |
1952 |
1952 |
1953 |
1953 |
1954 |
1954 // --------------------------------------------------------- |
1955 // --------------------------------------------------------- |
1955 // CBrowserPreferences::SetToolbarOnOffL() |
1956 // CBrowserPreferences::SetToolbarOnOffL() |
1956 // --------------------------------------------------------- |
1957 // --------------------------------------------------------- |
1957 // |
1958 // |
1958 void CBrowserPreferences::SetToolbarOnOffL(TInt aCommand) |
1959 void CBrowserPreferences::SetToolbarOnOffL(TInt aCommand) |
1959 { |
1960 { |
1960 if ( aCommand != iAllPreferences.iToolbarOnOff ) |
1961 if ( aCommand != iAllPreferences.iToolbarOnOff ) |
1961 { |
1962 { |
1962 iAllPreferences.iToolbarOnOff = aCommand; |
1963 iAllPreferences.iToolbarOnOff = aCommand; |
1963 SetIntValueL( KToolbarOnOff, iAllPreferences.iToolbarOnOff ); |
1964 SetIntValueL( KToolbarOnOff, iAllPreferences.iToolbarOnOff ); |
1964 |
1965 |
1965 NotifyObserversL( EPreferencesItemChange, |
1966 NotifyObserversL( EPreferencesItemChange, |
1966 TBrCtlDefs::ESettingsToolbarOnOff ); |
1967 TBrCtlDefs::ESettingsToolbarOnOff ); |
1967 } |
1968 } |
1968 } |
1969 } |
1969 |
1970 |
1970 |
1971 |
1971 |
1972 |
1972 // --------------------------------------------------------- |
1973 // --------------------------------------------------------- |
1973 // CBrowserPreferences::SetToolbarButton1CmdL() |
1974 // CBrowserPreferences::SetToolbarButton1CmdL() |
1974 // --------------------------------------------------------- |
1975 // --------------------------------------------------------- |
1975 // |
1976 // |
1976 void CBrowserPreferences::SetToolbarButton1CmdL(TInt aCommand) |
1977 void CBrowserPreferences::SetToolbarButton1CmdL(TInt aCommand) |
1977 { |
1978 { |
1978 if ( aCommand != iAllPreferences.iToolbarButton1Cmd ) |
1979 if ( aCommand != iAllPreferences.iToolbarButton1Cmd ) |
1979 { |
1980 { |
1980 iAllPreferences.iToolbarButton1Cmd = aCommand; |
1981 iAllPreferences.iToolbarButton1Cmd = aCommand; |
1981 SetIntValueL( KToolbarButton1Cmd, iAllPreferences.iToolbarButton1Cmd ); |
1982 SetIntValueL( KToolbarButton1Cmd, iAllPreferences.iToolbarButton1Cmd ); |
1982 |
1983 |
1983 NotifyObserversL( EPreferencesItemChange, |
1984 NotifyObserversL( EPreferencesItemChange, |
1984 TBrCtlDefs::ESettingsToolbarButton1Cmd ); |
1985 TBrCtlDefs::ESettingsToolbarButton1Cmd ); |
1985 } |
1986 } |
1986 } |
1987 } |
1987 |
1988 |
1988 |
1989 |
2236 iAllPreferences.iShortcutKeyHashCmd = aCommand; |
2237 iAllPreferences.iShortcutKeyHashCmd = aCommand; |
2237 SetIntValueL( KShortcutKeyHashCmd, iAllPreferences.iShortcutKeyHashCmd ); |
2238 SetIntValueL( KShortcutKeyHashCmd, iAllPreferences.iShortcutKeyHashCmd ); |
2238 } |
2239 } |
2239 } |
2240 } |
2240 |
2241 |
2241 |
2242 |
2242 // ---------------------------------------------------------------------------- |
2243 // ---------------------------------------------------------------------------- |
2243 // CBrowserPreferences::SetURLSuffixList |
2244 // CBrowserPreferences::SetURLSuffixList |
2244 // ---------------------------------------------------------------------------- |
2245 // ---------------------------------------------------------------------------- |
2245 // |
2246 // |
2246 void CBrowserPreferences::SetURLSuffixList( HBufC* aSetting ) |
2247 void CBrowserPreferences::SetURLSuffixList( HBufC* aSetting ) |
2247 { |
2248 { |
2248 LOG_ENTERFN("CBrowserPreferences::SetUpdateHoursDefined"); |
2249 LOG_ENTERFN("CBrowserPreferences::SetUpdateHoursDefined"); |
2249 |
2250 |
2250 SetStringValueL ( KBrowserUrlSuffix, aSetting->Des() ); |
2251 SetStringValueL ( KBrowserUrlSuffix, aSetting->Des() ); |
2251 |
2252 |
2252 TPtr ptr = iAllPreferences.iUrlSuffixList->Des(); |
2253 TPtr ptr = iAllPreferences.iUrlSuffixList->Des(); |
2253 ptr.Copy( aSetting->Des() ); |
2254 ptr.Copy( aSetting->Des() ); |
2254 } |
2255 } |
2255 |
2256 |