118 CleanupStack::Pop(self); |
133 CleanupStack::Pop(self); |
119 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::NewL()" ) |
134 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::NewL()" ) |
120 return self; |
135 return self; |
121 } |
136 } |
122 |
137 |
123 |
138 // ----------------------------------------------------------------------------- |
124 // ---------------------------------------------------------------------------- |
|
125 // From class CAknView. |
139 // From class CAknView. |
126 // Returns UID of *this* settings plugin. |
140 // Returns UID of *this* settings plugin. |
127 // ---------------------------------------------------------------------------- |
141 // ----------------------------------------------------------------------------- |
128 // |
142 // |
129 TUid CMusSettingsPlugin::Id() const |
143 TUid CMusSettingsPlugin::Id() const |
130 { |
144 { |
131 MUS_LOG1( "[MUSSET] <- CMusSettingsPlugin::Id()( %d )", |
145 MUS_LOG1( "[MUSSET] <- CMusSettingsPlugin::Id()( %d )", |
132 KGSVSSettingsPluginUID.iUid ) |
146 KGSVSSettingsPluginUID.iUid ) |
133 return KGSVSSettingsPluginUID; |
147 return KGSVSSettingsPluginUID; |
134 } |
148 } |
135 |
149 |
136 |
150 // ----------------------------------------------------------------------------- |
137 // ---------------------------------------------------------------------------- |
|
138 // Hides non-virtual member from base class CGSBaseView. |
151 // Hides non-virtual member from base class CGSBaseView. |
139 // Handles a change in client rectangle size. |
152 // Handles a change in client rectangle size. |
140 // ---------------------------------------------------------------------------- |
153 // ----------------------------------------------------------------------------- |
141 // |
154 // |
142 void CMusSettingsPlugin::HandleClientRectChange() |
155 void CMusSettingsPlugin::HandleClientRectChange() |
143 { |
156 { |
144 MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::HandleClientRectChange()" ) |
157 MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::HandleClientRectChange()" ) |
145 if ( iContainer && iContainer->iListBox ) |
158 if ( iContainer && iContainer->iListBox ) |
164 OpenResourceFileL(); |
176 OpenResourceFileL(); |
165 CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); |
177 CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); |
166 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::DoActivateL()" ) |
178 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::DoActivateL()" ) |
167 } |
179 } |
168 |
180 |
169 |
181 // ----------------------------------------------------------------------------- |
170 // ---------------------------------------------------------------------------- |
|
171 // From class CAknView. |
182 // From class CAknView. |
172 // Called by framework when *this* control is to be deactivated. |
183 // Called by framework when *this* control is to be deactivated. |
173 // ---------------------------------------------------------------------------- |
184 // ----------------------------------------------------------------------------- |
174 // |
185 // |
175 void CMusSettingsPlugin::DoDeactivate() |
186 void CMusSettingsPlugin::DoDeactivate() |
176 { |
187 { |
177 MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::DoDeactivate()" ) |
188 MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::DoDeactivate()" ) |
178 CGSBaseView::DoDeactivate(); |
189 CGSBaseView::DoDeactivate(); |
179 CloseResourceFile(); |
190 CloseResourceFile(); |
180 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::DoDeactivate()" ) |
191 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::DoDeactivate()" ) |
181 } |
192 } |
182 |
193 |
183 |
194 // ----------------------------------------------------------------------------- |
184 // ---------------------------------------------------------------------------- |
|
185 // From class CAknView. |
195 // From class CAknView. |
186 // Handles a user selected menu command. |
196 // Handles a user selected menu command. |
187 // ---------------------------------------------------------------------------- |
197 // ----------------------------------------------------------------------------- |
188 // |
198 // |
189 void CMusSettingsPlugin::HandleCommandL( TInt aCommand ) |
199 void CMusSettingsPlugin::HandleCommandL( TInt aCommand ) |
190 { |
200 { |
191 MUS_LOG1( "[MUSSET] -> CMusSettingsPlugin::HandleCommandL()( %d )", |
201 MUS_LOG1( "[MUSSET] -> CMusSettingsPlugin::HandleCommandL()( %d )", |
192 aCommand ) |
202 aCommand ) |
239 } |
248 } |
240 |
249 |
241 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::GetCaptionL()" ) |
250 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::GetCaptionL()" ) |
242 } |
251 } |
243 |
252 |
244 |
253 // ----------------------------------------------------------------------------- |
245 // ---------------------------------------------------------------------------- |
|
246 // From class CGSPluginInterface. |
254 // From class CGSPluginInterface. |
247 // Returns provider category of *this* plugin. |
255 // Returns provider category of *this* plugin. |
248 // ---------------------------------------------------------------------------- |
256 // ----------------------------------------------------------------------------- |
249 // |
257 // |
250 TInt CMusSettingsPlugin::PluginProviderCategory() const |
258 TInt CMusSettingsPlugin::PluginProviderCategory() const |
251 { |
259 { |
252 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::PluginProviderCategory()" ) |
260 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::PluginProviderCategory()" ) |
253 return KGSPluginProviderInternal; |
261 return KGSPluginProviderInternal; |
254 } |
262 } |
255 |
263 |
256 |
264 // ----------------------------------------------------------------------------- |
257 // ---------------------------------------------------------------------------- |
|
258 // From class MEikMenuObserver. |
265 // From class MEikMenuObserver. |
259 // Called by framework before creating menus |
266 // Called by framework before creating menus |
260 // ---------------------------------------------------------------------------- |
267 // ----------------------------------------------------------------------------- |
261 // |
268 // |
262 void CMusSettingsPlugin::DynInitMenuPaneL( TInt aResourceId, |
269 void CMusSettingsPlugin::DynInitMenuPaneL( TInt aResourceId, |
263 CEikMenuPane* aMenuPane ) |
270 CEikMenuPane* aMenuPane ) |
264 { |
271 { |
265 // Delete Help item if feature is not supported |
272 // Delete Help item if feature is not supported |
294 } |
300 } |
295 |
301 |
296 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::HandleNotifyDisk()" ) |
302 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::HandleNotifyDisk()" ) |
297 } |
303 } |
298 |
304 |
299 |
305 // ----------------------------------------------------------------------------- |
300 // ---------------------------------------------------------------------------- |
|
301 // From class CGSBaseView. |
306 // From class CGSBaseView. |
302 // Called by GS framework to create a GS container for *this* plugin. |
307 // Called by GS framework to create a GS container for *this* plugin. |
303 // ---------------------------------------------------------------------------- |
308 // ----------------------------------------------------------------------------- |
304 // |
309 // |
305 void CMusSettingsPlugin::NewContainerL() |
310 void CMusSettingsPlugin::NewContainerL() |
306 { |
311 { |
307 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::NewContainerL()" ) |
312 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::NewContainerL()" ) |
308 iContainer = new( ELeave ) CMusSettingsContainer( *iModel ); |
313 iContainer = new( ELeave ) CMusSettingsContainer( *iModel ); |
309 } |
314 } |
310 |
315 |
311 |
316 // ----------------------------------------------------------------------------- |
312 // ---------------------------------------------------------------------------- |
|
313 // From class CGSBaseView. |
317 // From class CGSBaseView. |
314 // Handles users "middle click" aka MSK on selected feature. |
318 // Handles users "middle click" aka MSK on selected feature. |
315 // ---------------------------------------------------------------------------- |
319 // ----------------------------------------------------------------------------- |
316 // |
320 // |
317 void CMusSettingsPlugin::HandleListBoxSelectionL() |
321 void CMusSettingsPlugin::HandleListBoxSelectionL() |
318 { |
322 { |
319 MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::HandleListBoxSelectionL()" ) |
323 MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::HandleListBoxSelectionL()" ) |
320 CMusSettingsContainer& container = |
324 CMusSettingsContainer& container = |
321 *static_cast<CMusSettingsContainer*>( iContainer ); |
325 *static_cast<CMusSettingsContainer*>( iContainer ); |
322 const TInt currentItem = container.CurrentFeatureId(); |
326 const TInt currentItem = container.CurrentFeatureId(); |
323 |
327 MUS_LOG1( "[MUSSET] Item selected: ", currentItem ) |
324 RDebug::Print( _L( |
|
325 "[CMusSettingsPlugin] Item selected: %d" ), |
|
326 currentItem ); |
|
327 |
|
328 MusSettingsKeys::TOperatorVariant operatorVarValue = |
|
329 iModel->VSSettingsOperatorVariantL(); |
|
330 |
328 |
331 switch ( currentItem ) |
329 switch ( currentItem ) |
332 { |
330 { |
333 case KGSSettIdVSActivation: |
331 case KGSSettIdVSActivation: |
334 { |
332 { |
335 if ( operatorVarValue == MusSettingsKeys::EOperatorSpecific ) |
333 SwitchOnOffValueL( KGSSettIdVSActivation ); |
336 { |
|
337 SwitchOnOffValueL( KGSSettIdVSActivation ); |
|
338 container.UpdateListBoxL( KGSSettIdVSActivation ); |
|
339 } |
|
340 else |
|
341 { |
|
342 ShowVSSettingsActivationSettingDialogL(); |
|
343 } |
|
344 break; |
334 break; |
345 } |
335 } |
346 |
|
347 case KGSSettIdSIPProfile: |
336 case KGSSettIdSIPProfile: |
348 { |
337 { |
349 ShowVSSettingsProfileSettingDialogL(); |
338 ShowVSSettingsProfileSettingDialogL(); |
350 break; |
339 break; |
351 } |
340 } |
352 |
|
353 case KGSSettIdAutoRecord: |
341 case KGSSettIdAutoRecord: |
354 { |
342 { |
355 SwitchOnOffValueL( KGSSettIdAutoRecord ); |
343 SwitchOnOffValueL( KGSSettIdAutoRecord ); |
356 container.UpdateListBoxL( KGSSettIdAutoRecord ); |
|
357 break; |
344 break; |
358 } |
345 } |
359 |
|
360 case KGSSettIdRecordedVideoSaving: |
346 case KGSSettIdRecordedVideoSaving: |
361 { |
347 { |
362 |
|
363 ShowVSSettingsRecordedVideoSavingSettingDialogL(); |
348 ShowVSSettingsRecordedVideoSavingSettingDialogL(); |
364 |
|
365 // SwitchOnOffValueL( KGSSettIdRecordedVideoSaving ); |
|
366 // container.UpdateListBoxL( KGSSettIdRecordedVideoSaving ); |
|
367 |
|
368 break; |
349 break; |
369 } |
350 } |
370 |
|
371 case KGSSettIdNote: |
351 case KGSSettIdNote: |
372 { |
352 { |
373 SwitchOnOffValueL( KGSSettIdNote ); |
353 SwitchOnOffValueL( KGSSettIdNote ); |
374 container.UpdateListBoxL( KGSSettIdNote ); |
|
375 break; |
354 break; |
376 } |
355 } |
377 |
|
378 default: |
356 default: |
379 { |
357 { |
380 break; |
358 break; |
381 } |
359 } |
382 } |
360 } |
383 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::HandleListBoxSelectionL()" ) |
361 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::HandleListBoxSelectionL()" ) |
384 } |
362 } |
385 |
363 |
386 |
364 // ----------------------------------------------------------------------------- |
387 // ---------------------------------------------------------------------------- |
|
388 // From class CGSBaseView. |
365 // From class CGSBaseView. |
389 // Returns container class of *this* plugin. iContainer is always garanteed to |
366 // Returns container class of *this* plugin. iContainer is always garanteed to |
390 // be of type CMusSettingsContainer*. |
367 // be of type CMusSettingsContainer*. |
391 // ---------------------------------------------------------------------------- |
368 // ----------------------------------------------------------------------------- |
392 // |
369 // |
393 CMusSettingsContainer* CMusSettingsPlugin::Container() |
370 CMusSettingsContainer* CMusSettingsPlugin::Container() |
394 { |
371 { |
395 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::Container()" ) |
372 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::Container()" ) |
396 return static_cast<CMusSettingsContainer*>( iContainer ); |
373 return static_cast<CMusSettingsContainer*>( iContainer ); |
397 } |
374 } |
398 |
375 |
399 |
376 // ----------------------------------------------------------------------------- |
400 // ---------------------------------------------------------------------------- |
|
401 // Shows a dialog for user to modify VS activation setting. Note that this |
|
402 // method has an alternative method for operator specific variant. |
|
403 // ---------------------------------------------------------------------------- |
|
404 // |
|
405 void CMusSettingsPlugin::ShowVSSettingsActivationSettingDialogL() |
|
406 { |
|
407 MUS_LOG( |
|
408 "[MUSSET] -> CMusSettingsPlugin::ShowVSSettingsActivationSettingDialogL()" ) |
|
409 |
|
410 MusSettingsKeys::TActivation currentValue = |
|
411 iModel->VSSettingsActivationL(); |
|
412 |
|
413 CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( |
|
414 R_OPERATOR_ACTIVATION_SETTING_PAGE_LBX ); |
|
415 |
|
416 CleanupStack::PushL( items ); |
|
417 TInt intCurrentValue = static_cast<TInt>( currentValue ); |
|
418 |
|
419 CAknRadioButtonSettingPage* dlg = |
|
420 new ( ELeave ) CAknRadioButtonSettingPage( |
|
421 R_ACTIVATION_SETTING_PAGE, |
|
422 intCurrentValue, |
|
423 items); |
|
424 |
|
425 if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) |
|
426 { |
|
427 currentValue = |
|
428 static_cast<MusSettingsKeys::TActivation>( intCurrentValue ); |
|
429 |
|
430 iModel->SetVSSettingsActivationL( currentValue ); |
|
431 Container()->UpdateListBoxL( KGSSettIdVSActivation ); |
|
432 } |
|
433 |
|
434 CleanupStack::PopAndDestroy( items ); |
|
435 MUS_LOG( |
|
436 "[MUSSET] <- CMusSettingsPlugin::ShowVSSettingsActivationSettingDialogL()" ) |
|
437 } |
|
438 |
|
439 // ---------------------------------------------------------------------------- |
|
440 // Shows SIP profile setting dialog (i.e. "use default profile" or "select |
377 // Shows SIP profile setting dialog (i.e. "use default profile" or "select |
441 // profile from list"). If select profile from list is selected, a list of |
378 // profile from list"). If select profile from list is selected, a list of |
442 // SIP profiles is provided for user to choose wanted SIP profile. |
379 // SIP profiles is provided for user to choose wanted SIP profile. |
443 // ---------------------------------------------------------------------------- |
380 // ----------------------------------------------------------------------------- |
444 // |
381 // |
445 void CMusSettingsPlugin::ShowVSSettingsProfileSettingDialogL() |
382 void CMusSettingsPlugin::ShowVSSettingsProfileSettingDialogL() |
446 { |
383 { |
447 MUS_LOG( |
384 MUS_LOG( |
448 "[MUSSET] -> CMusSettingsPlugin::ShowVSSettingsProfileSettingDialogL()" ) |
385 "[MUSSET] -> CMusSettingsPlugin::ShowVSSettingsProfileSettingDialogL()" ) |
449 TInt cenRepValue = iModel->VSSettingsProfileL(); |
386 TInt cenRepValue = MultimediaSharingSettings::SipProfileSettingL(); |
450 TInt profileMode = CMusSettingsModel::KVsSipProfileDefault; |
387 TInt profileMode = CMusSettingsModel::KVsSipProfileDefault; |
451 if ( cenRepValue != CMusSettingsModel::KVsSipProfileDefault ) |
388 if ( cenRepValue != CMusSettingsModel::KVsSipProfileDefault ) |
452 { |
389 { |
453 profileMode = CMusSettingsModel::KVsSipProfileSelect; |
390 profileMode = CMusSettingsModel::KVsSipProfileSelect; |
454 } |
391 } |
525 if ( selectedIndex != currentIndex ) |
462 if ( selectedIndex != currentIndex ) |
526 { |
463 { |
527 // User has changed the selected profile, set new |
464 // User has changed the selected profile, set new |
528 // setting to persistent storage |
465 // setting to persistent storage |
529 TUint newValue = iModel->ProfileIdByIndex( selectedIndex ); |
466 TUint newValue = iModel->ProfileIdByIndex( selectedIndex ); |
530 iModel->SetVSSettingsProfileL( newValue ); |
467 MultimediaSharingSettings::SetSipProfileSettingL( newValue ); |
531 Container()->ShowNewProfileActiveAfterCallL(); |
468 Container()->ShowNewProfileActiveAfterCallL(); |
532 Container()->UpdateListBoxL( KGSSettIdSIPProfile ); |
469 Container()->UpdateListBoxL( KGSSettIdSIPProfile ); |
533 } |
470 } |
534 } |
471 } |
535 } |
472 } |
536 |
473 |
537 CleanupStack::PopAndDestroy( array ); // array |
474 CleanupStack::PopAndDestroy( array ); // array |
538 } |
475 } |
539 |
476 |
540 |
477 // ----------------------------------------------------------------------------- |
541 // ---------------------------------------------------------------------------- |
|
542 // Provides a dialog for user to choose saving location for recorderded video. |
478 // Provides a dialog for user to choose saving location for recorderded video. |
543 // (locations are naturally phone memory or memory card). |
479 // (locations are naturally phone memory or memory card). |
544 // ---------------------------------------------------------------------------- |
480 // ----------------------------------------------------------------------------- |
545 // |
481 // |
546 void CMusSettingsPlugin::ShowVSSettingsRecordedVideoSavingSettingDialogL() |
482 void CMusSettingsPlugin::ShowVSSettingsRecordedVideoSavingSettingDialogL() |
547 { |
483 { |
548 MUS_LOG( |
484 MUS_LOG( |
549 "[MUSSET] -> CMusSettingsPlugin::ShowVSSettingsRecordedVideoSavingSettingDialogL()" ) |
485 "[MUSSET] -> CMusSettingsPlugin::ShowVSSettingsRecordedVideoSavingSettingDialogL()" ) |
550 TDriveUnit phoneMemUnit( |
486 TDriveUnit phoneMemUnit( |
551 TParsePtrC( PathInfo::PhoneMemoryRootPath() ).Drive() ); |
487 TParsePtrC( PathInfo::PhoneMemoryRootPath() ).Drive() ); |
552 TDriveUnit mmcUnit( TParsePtrC( PathInfo::MemoryCardRootPath() ).Drive() ); |
488 TDriveUnit mmcUnit( TParsePtrC( PathInfo::MemoryCardRootPath() ).Drive() ); |
553 TInt currentValue = iModel->VSSettingsRecordedVideoSavingL(); |
489 TInt currentValue = iModel->VSSettingsRecordedVideoSavingL(); |
554 |
|
555 |
|
556 CAknMemorySelectionDialogMultiDrive* dlg = |
|
557 iModel->MemorySelectionDialogLC(); |
|
558 |
|
559 // Use ECFDDialogTypeSave to have double list box in the query |
|
560 /* CAknMemorySelectionDialog* dlg = CAknMemorySelectionDialog::NewL( |
|
561 ECFDDialogTypeSave, |
|
562 R_VS_RECORDED_VIDEO_SAVING_SETTING_PAGE, |
|
563 EFalse ); |
|
564 CleanupStack::PushL( dlg ); |
|
565 */ |
|
566 |
|
567 |
490 |
|
491 CAknMemorySelectionDialogMultiDrive* dlg = |
|
492 iModel->MemorySelectionDialogLC(); |
568 |
493 |
569 TBool result( EFalse ); |
494 TBool result( EFalse ); |
570 TDriveNumber driveNumber((TDriveNumber)currentValue); |
495 TDriveNumber driveNumber((TDriveNumber)currentValue); |
571 result = dlg->ExecuteL( driveNumber, NULL, NULL ); |
496 result = dlg->ExecuteL( driveNumber, NULL, NULL ); |
572 |
497 |
573 if ( result != CAknCommonDialogsBase::TReturnKey( |
498 if ( result != CAknCommonDialogsBase::TReturnKey( |
574 CAknCommonDialogsBase::ERightSoftkey) ) |
499 CAknCommonDialogsBase::ERightSoftkey) ) |
575 { |
500 { |
576 if ( ( TInt ) driveNumber != currentValue ) |
501 if ( /*( TInt )*/ driveNumber != currentValue ) |
577 { |
502 { |
578 iModel->SetVSSettingsRecordedVideoSavingL( ( TInt ) driveNumber ); |
503 MultimediaSharingSettings::SetVideoLocationSettingL( ( TInt ) driveNumber ); |
579 } |
504 } |
580 Container()->UpdateListBoxL( KGSSettIdRecordedVideoSaving ); |
505 Container()->UpdateListBoxL( KGSSettIdRecordedVideoSaving ); |
581 } |
506 } |
582 |
|
583 /* CAknMemorySelectionDialog::TMemory mem; |
|
584 if ( currentValue == ( TInt )mmcUnit ) |
|
585 { |
|
586 mem = CAknMemorySelectionDialog::EMemoryCard; |
|
587 } |
|
588 else |
|
589 { |
|
590 mem = CAknMemorySelectionDialog::EPhoneMemory; |
|
591 } |
|
592 |
|
593 TFileName ignore; |
|
594 TFileName path; |
|
595 |
|
596 if ( dlg->ExecuteL( mem, &path, &ignore ) ) |
|
597 { |
|
598 if ( mem == CAknMemorySelectionDialog::EPhoneMemory |
|
599 && currentValue != ( TInt ) phoneMemUnit ) |
|
600 { |
|
601 iModel->SetVSSettingsRecordedVideoSavingL( ( TInt )phoneMemUnit ); |
|
602 Container()->UpdateListBoxL( KGSSettIdRecordedVideoSaving ); |
|
603 } |
|
604 else if ( mem == CAknMemorySelectionDialog::EMemoryCard |
|
605 && currentValue != ( TInt )mmcUnit ) |
|
606 { |
|
607 iModel->SetVSSettingsRecordedVideoSavingL( ( TInt )mmcUnit ); |
|
608 Container()->UpdateListBoxL( KGSSettIdRecordedVideoSaving ); |
|
609 } |
|
610 } |
|
611 */ |
|
612 |
507 |
613 CleanupStack::PopAndDestroy(dlg); |
508 CleanupStack::PopAndDestroy(dlg); |
614 MUS_LOG( |
509 MUS_LOG( |
615 "[MUSSET] <- CMusSettingsPlugin::ShowVSSettingsRecordedVideoSavingSettingDialogL()" ) |
510 "[MUSSET] <- CMusSettingsPlugin::ShowVSSettingsRecordedVideoSavingSettingDialogL()" ) |
616 } |
511 } |
617 |
512 |
618 |
513 // ----------------------------------------------------------------------------- |
619 // ---------------------------------------------------------------------------- |
|
620 // In standard variant provides user a "Capability auditory note" setting |
514 // In standard variant provides user a "Capability auditory note" setting |
621 // dialog, and in operator variant provides user an "Alerts" setting dialog. |
515 // dialog, and in operator variant provides user an "Alerts" setting dialog. |
622 // Note that in both variants the different dialogs toggle the same setting. |
516 // Note that in both variants the different dialogs toggle the same setting. |
623 // ---------------------------------------------------------------------------- |
517 // ----------------------------------------------------------------------------- |
624 // |
518 // |
625 void CMusSettingsPlugin::ShowVSSettingsNoteSettingDialogL() |
519 void CMusSettingsPlugin::ShowVSSettingsNoteSettingDialogL() |
626 { |
520 { |
627 MUS_LOG( |
521 MUS_LOG( |
628 "[MUSSET] -> CMusSettingsPlugin::ShowVSSettingsNoteSettingDialogL()" ) |
522 "[MUSSET] -> CMusSettingsPlugin::ShowVSSettingsNoteSettingDialogL()" ) |
629 MusSettingsKeys::TAuditoryNotification currentValue = |
523 MusSettingsKeys::TAuditoryNotification currentValue = |
630 iModel->VSSettingsNoteL(); |
524 MultimediaSharingSettings::AuditoryNotificationSettingL(); |
631 TInt intCurrentValue = static_cast<TInt>( currentValue ); |
525 TInt intCurrentValue = static_cast<TInt>( currentValue ); |
632 |
526 |
633 CAknRadioButtonSettingPage* dlg; |
527 CAknRadioButtonSettingPage* dlg; |
634 CDesCArrayFlat* items; |
528 CDesCArrayFlat* items; |
635 |
529 |
636 if ( iModel->VSSettingsOperatorVariantL() == MusSettingsKeys::EStandard ) |
530 if ( MultimediaSharingSettings::OperatorVariantSettingL() == |
|
531 MusSettingsKeys::EStandard ) |
637 { |
532 { |
638 items = iCoeEnv->ReadDesC16ArrayResourceL( |
533 items = iCoeEnv->ReadDesC16ArrayResourceL( |
639 R_VS_AUDIO_SETTING_PAGE_LBX ); |
534 R_VS_AUDIO_SETTING_PAGE_LBX ); |
640 CleanupStack::PushL( items ); |
535 CleanupStack::PushL( items ); |
641 dlg = new ( ELeave ) CAknRadioButtonSettingPage( |
536 dlg = new ( ELeave ) CAknRadioButtonSettingPage( |
681 note->ExecuteLD( infoTxt->Des() ); |
575 note->ExecuteLD( infoTxt->Des() ); |
682 CleanupStack::PopAndDestroy( infoTxt ); |
576 CleanupStack::PopAndDestroy( infoTxt ); |
683 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::ShowNoProfilesNotificationL()" ) |
577 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::ShowNoProfilesNotificationL()" ) |
684 } |
578 } |
685 |
579 |
686 |
580 // ----------------------------------------------------------------------------- |
687 // --------------------------------------------------------------------------- |
|
688 // Switches between two possible values from one to another (i.e. toggles a |
581 // Switches between two possible values from one to another (i.e. toggles a |
689 // setting on/off). Toggled setting is passed in aValue parameter. |
582 // setting on/off). Toggled setting is passed in aValue parameter. |
690 // --------------------------------------------------------------------------- |
583 // ----------------------------------------------------------------------------- |
691 // |
584 // |
692 void CMusSettingsPlugin::SwitchOnOffValueL( TInt aValue ) |
585 void CMusSettingsPlugin::SwitchOnOffValueL( TInt aValue ) |
693 { |
586 { |
694 MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::SwitchOnOffValueL()" ) |
587 MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::SwitchOnOffValueL()" ) |
|
588 |
695 switch( aValue ) |
589 switch( aValue ) |
696 { |
590 { |
697 case KGSSettIdVSActivation: |
591 case KGSSettIdVSActivation: |
698 { |
592 { |
699 TInt aCallCount = 0; |
593 MusSettingsKeys::TOperatorVariant operatorVarValue = |
700 RProperty::Get( NMusSessionInformationApi::KCategoryUid, |
594 MultimediaSharingSettings::OperatorVariantSettingL(); |
701 NMusSessionInformationApi::KMusCallCount, |
595 |
702 aCallCount ); |
596 if ( operatorVarValue == MusSettingsKeys::EOperatorSpecific ) |
703 MUS_LOG1( "CallCount ( %d )", aCallCount) |
597 { |
704 if ( aCallCount == 0 ) |
598 |
705 { |
599 TInt aCallCount = 0; |
706 TBool enabled = EFalse; |
600 RProperty::Get( NMusSessionInformationApi::KCategoryUid, |
707 TRAPD( error, enabled = iHandler->ProfileEnabledL( )); |
601 NMusSessionInformationApi::KMusCallCount, |
708 if ( error != KErrNone ) |
602 aCallCount ); |
709 { |
603 MUS_LOG1( "CallCount ( %d )", aCallCount) |
710 // Problems with re-reading profiles; use existing array |
604 if ( aCallCount == 0 ) |
711 MUS_LOG1("Error returned( %d )", |
605 { |
712 error ) |
606 TBool enabled = EFalse; |
713 } |
607 TRAPD( error, enabled = iHandler->ProfileEnabledL( )); |
714 else |
608 if ( error != KErrNone ) |
715 { |
609 { |
716 if( enabled ) |
610 // Problems with re-reading profiles; use existing array |
717 { |
611 MUS_LOG1("Error returned( %d )", error ) |
718 TRAPD( error, iHandler->EnableProfileL() ); |
612 } |
719 if ( error != KErrNone ) |
613 else |
720 { |
614 { |
721 // Problems with re-reading profiles; use existing array |
615 if( enabled ) |
722 iModel->SetActivationItem( ETrue ); |
616 { |
723 } |
617 TRAPD( error, iHandler->EnableProfileL() ); |
724 iModel->SetActivationItem( EFalse ); |
618 if ( error != KErrNone ) |
725 } |
619 { |
726 else |
620 // Problems with re-reading profiles; use existing array |
727 { |
621 iModel->SetActivationItem( ETrue ); |
728 TRAP_IGNORE( iHandler->DisableProfileL() ); |
622 } |
729 iModel->SetActivationItem( ETrue ); |
623 iModel->SetActivationItem( EFalse ); |
730 } |
624 } |
731 } |
625 else |
732 } |
626 { |
|
627 TRAP_IGNORE( iHandler->DisableProfileL() ); |
|
628 iModel->SetActivationItem( ETrue ); |
|
629 } |
|
630 } |
|
631 } |
|
632 } |
|
633 else |
|
634 { |
|
635 if ( MusSettingsKeys::EAlwaysActive == |
|
636 MultimediaSharingSettings::ActivationSettingL() ) |
|
637 { |
|
638 MUS_LOG( "[MUSSET] Activation setting set off" ) |
|
639 //MusSettingsKeys::ENever = 2 can not be used anymore |
|
640 //EActiveInHomeNetworks = 1 is used instead -> off |
|
641 MultimediaSharingSettings::SetActivationSettingL( |
|
642 MusSettingsKeys::EActiveInHomeNetworks ); |
|
643 } |
|
644 else |
|
645 { |
|
646 MUS_LOG( "[MUSSET] Activation setting set on" ) |
|
647 MultimediaSharingSettings::SetActivationSettingL( |
|
648 MusSettingsKeys::EAlwaysActive ); |
|
649 } |
|
650 } |
733 break; |
651 break; |
734 } |
652 } |
735 case KGSSettIdAutoRecord: |
653 case KGSSettIdAutoRecord: |
736 { |
654 { |
737 if ( MusSettingsKeys::EAutoRecordOff == |
655 if ( MusSettingsKeys::EAutoRecordOff == |
738 iModel->VSSettingsAutoRecordL() ) |
656 MultimediaSharingSettings::AutoRecordSettingL() ) |
739 { |
657 { |
740 iModel->SetVSSettingsAutoRecordL( |
658 MultimediaSharingSettings::SetAutoRecordSettingL( |
741 MusSettingsKeys::EAutoRecordOn ); |
659 MusSettingsKeys::EAutoRecordOn ); |
742 } |
660 } |
743 else |
661 else |
744 { |
662 { |
745 iModel->SetVSSettingsAutoRecordL( |
663 MultimediaSharingSettings::SetAutoRecordSettingL( |
746 MusSettingsKeys::EAutoRecordOff ); |
664 MusSettingsKeys::EAutoRecordOff ); |
747 } |
665 } |
748 break; |
666 break; |
749 } |
667 } |
750 case KGSSettIdRecordedVideoSaving: |
|
751 { |
|
752 TDriveUnit phoneMemUnit( |
|
753 TParsePtrC( PathInfo::PhoneMemoryRootPath() ).Drive() ); |
|
754 TDriveUnit mmcUnit( |
|
755 TParsePtrC( PathInfo::MemoryCardRootPath() ).Drive() ); |
|
756 |
|
757 if ( ( TInt )phoneMemUnit |
|
758 == iModel->VSSettingsRecordedVideoSavingL() ) |
|
759 { |
|
760 iModel->SetVSSettingsRecordedVideoSavingL( ( TInt )mmcUnit ); |
|
761 } |
|
762 else |
|
763 { |
|
764 iModel->SetVSSettingsRecordedVideoSavingL( ( TInt )phoneMemUnit ); |
|
765 } |
|
766 break; |
|
767 } |
|
768 case KGSSettIdNote: |
668 case KGSSettIdNote: |
769 { |
669 { |
770 if ( MusSettingsKeys::EAuditoryNotificationOn |
670 if ( MusSettingsKeys::EAuditoryNotificationOn == |
771 == iModel->VSSettingsNoteL() ) |
671 MultimediaSharingSettings::AuditoryNotificationSettingL() ) |
772 { |
672 { |
773 iModel->SetVSSettingsNoteL( |
673 MultimediaSharingSettings::SetAuditoryNotificationSettingL( |
774 MusSettingsKeys::EAuditoryNotificationOff ); |
674 MusSettingsKeys::EAuditoryNotificationOff ); |
775 } |
675 } |
776 else |
676 else |
777 { |
677 { |
778 iModel->SetVSSettingsNoteL( |
678 MultimediaSharingSettings::SetAuditoryNotificationSettingL( |
779 MusSettingsKeys::EAuditoryNotificationOn ); |
679 MusSettingsKeys::EAuditoryNotificationOn ); |
780 } |
680 } |
781 break; |
681 break; |
782 } |
682 } |
|
683 |
783 default: |
684 default: |
784 { |
685 { |
785 MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::SwitchOnOffValueL() - error unknown setting" ) |
686 MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::SwitchOnOffValueL() - error unknown setting" ) |
786 User::Leave( KErrArgument ); |
687 User::Leave( KErrArgument ); |
787 } |
688 } |
788 } |
689 } |
|
690 |
|
691 Container()->UpdateListBoxL( aValue ); |
|
692 |
789 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::SwitchOnOffValueL()" ) |
693 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::SwitchOnOffValueL()" ) |
790 } |
694 } |
791 |
695 |
792 // ----------------------------------------------------------------------------- |
696 // ----------------------------------------------------------------------------- |
793 // |
697 // |
847 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::CreateIconL()" ) |
751 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::CreateIconL()" ) |
848 |
752 |
849 return icon; |
753 return icon; |
850 } |
754 } |
851 |
755 |
|
756 // ----------------------------------------------------------------------------- |
|
757 // |
|
758 // ----------------------------------------------------------------------------- |
|
759 // |
852 void CMusSettingsPlugin::OpenResourceFileL() |
760 void CMusSettingsPlugin::OpenResourceFileL() |
853 { |
761 { |
854 if (!iResourceFileOpen) |
762 MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::OpenResourceFileL()" ) |
855 { |
763 |
856 HBufC* fileName = MusResourceFinderUtil::ResourcePathL( |
764 if (!iResourceFileOpen) |
857 KVSSettingsResourceFileName ); |
765 { |
858 TFileName fName(*fileName); |
766 HBufC* fileName = MusResourceFinderUtil::ResourcePathL( |
859 delete fileName; |
767 KVSSettingsResourceFileName ); |
860 MUS_LOG_TDESC( "[MUSSET] Resource FileName ",fName ) |
768 TFileName fName(*fileName); |
861 iResources.OpenL(fName); |
769 delete fileName; |
862 iResourceFileOpen = true; |
770 MUS_LOG_TDESC( "[MUSSET] Resource FileName ",fName ) |
863 } |
771 iResources.OpenL(fName); |
|
772 iResourceFileOpen = true; |
|
773 } |
|
774 |
|
775 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::OpenResourceFileL()" ) |
864 } |
776 } |
865 |
777 |
|
778 // ----------------------------------------------------------------------------- |
|
779 // |
|
780 // ----------------------------------------------------------------------------- |
|
781 // |
866 void CMusSettingsPlugin::CloseResourceFile() |
782 void CMusSettingsPlugin::CloseResourceFile() |
867 { |
783 { |
868 iResources.Close(); |
784 MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::CloseResourceFile()" ) |
869 iResourceFileOpen = false; |
785 iResources.Close(); |
870 MUS_LOG( "[MUSSET] Resource file closed " ) |
786 iResourceFileOpen = false; |
871 } |
787 MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::CloseResourceFile()" ) |
|
788 } |
|
789 |