mmshplugins/mmshsettingsuiplugin/src/mussettingscontainer.cpp
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
child 41 755f0370535b
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  Container for MUSSettingsPlugin.
    14 * Description:  Container for MUSSettingsPlugin.
       
    15 *  Version     : %version: be1sipx1#22 % << Don't touch! Updated by Synergy at check-out.
    15 *
    16 *
    16 */
    17 */
    17 
    18 
    18 
    19 
    19 
    20 
    20 #include    "mussettingscontainer.h"
    21 #include "mussettingscontainer.h"
    21 #include    "mussettingsplugin.h"
    22 #include "mussettingsplugin.h"
    22 #include    "mussettingsmodel.h"
    23 #include "mussettingsmodel.h"
    23 #include    "gslistbox.h"
    24 #include "gslistbox.h"
    24 #include    "mussettingsplugin.hrh"
    25 #include "mussettingsplugin.hrh"
    25 #include    <mussettingsuirsc.rsg>
    26 #include <mussettingsuirsc.rsg>
    26 #include    <aknlists.h>
    27 #include <aknlists.h>
    27 #include    <akntitle.h>
    28 #include <akntitle.h>
    28 #include 	<aknnotewrappers.h>
    29 #include <aknnotewrappers.h>
    29 #include    <csxhelp/msh.hlp.hrh>
    30 #include <csxhelp/msh.hlp.hrh>
    30 #include    <gsfwviewuids.h>
    31 #include <gsfwviewuids.h>
    31 #include    <StringLoader.h>
    32 #include <StringLoader.h>
    32 #include 	<sipmanagedprofile.h>
    33 #include <sipmanagedprofile.h>
    33 #include 	<ctsydomainpskeys.h>
    34 #include <ctsydomainpskeys.h>
    34 #include	<e32property.h>
    35 #include <e32property.h>
    35 #include    <pathinfo.h>
    36 #include <pathinfo.h>
    36 
    37 
    37 
    38 
       
    39 #ifdef RD_MULTIPLE_DRIVE
    38 #include    <CAknMemorySelectionDialogMultiDrive.h>
    40 #include    <CAknMemorySelectionDialogMultiDrive.h>
    39 
    41 
       
    42 #endif
    40 
    43 
    41 /** default SIP profile is selected */
    44 /** default SIP profile is selected */
    42 const TInt KDefaultSipProfile = 0;
    45 const TInt KDefaultSipProfile = 0;
    43 
    46 
    44 /** No SIP profile is selected */
    47 /** No SIP profile is selected */
    60 
    63 
    61 void CMusSettingsContainer::ConstructL( const TRect& aRect )
    64 void CMusSettingsContainer::ConstructL( const TRect& aRect )
    62     {
    65     {
    63     MUS_LOG( "[MUSSET] -> CMusSettingsContainer::ConstructL()" )
    66     MUS_LOG( "[MUSSET] -> CMusSettingsContainer::ConstructL()" )
    64 
    67 
    65     iOperatorVariant = iModel.VSSettingsOperatorVariantL();
    68     iOperatorVariant = MultimediaSharingSettings::OperatorVariantSettingL();
    66 
    69 
    67     iListBox = new( ELeave ) CAknSettingStyleListBox;
    70     iListBox = new( ELeave ) CAknSettingStyleListBox;
    68 
    71 
    69     if ( iOperatorVariant == MusSettingsKeys::EStandard )
    72     if ( iOperatorVariant == MusSettingsKeys::EStandard )
    70     	{
    73     	{
    81 
    84 
    82 CMusSettingsContainer::~CMusSettingsContainer()
    85 CMusSettingsContainer::~CMusSettingsContainer()
    83     {
    86     {
    84     MUS_LOG( "[MUSSET] -> CMusSettingsContainer::~CMusSettingsContainer()" )
    87     MUS_LOG( "[MUSSET] -> CMusSettingsContainer::~CMusSettingsContainer()" )
    85     delete iActivationItems;
    88     delete iActivationItems;
    86   	delete iProfileItems;
    89     delete iProfileItems;
    87   	delete iAutoRecordItems;
    90     delete iAutoRecordItems;
    88    	delete iListboxItemArray;
    91     delete iNoteItems;
    89    	delete iNoteItems;
    92     delete iListboxItemArray;
    90     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::~CMusSettingsContainer()" )
    93     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::~CMusSettingsContainer()" )
    91     }
    94     }
    92 
    95 
    93 
    96 
    94 // ---------------------------------------------------------------------------
    97 // -----------------------------------------------------------------------------
    95 // Constructs a listbox from a specified resource id.
    98 // Constructs a listbox from a specified resource id.
    96 // ---------------------------------------------------------------------------
    99 // -----------------------------------------------------------------------------
    97 //
   100 //
    98 void CMusSettingsContainer::ConstructListBoxL( TInt aResLbxId )
   101 void CMusSettingsContainer::ConstructListBoxL( TInt aResLbxId )
    99     {
   102     {
   100     MUS_LOG( "[MUSSET] -> CMusSettingsContainer::ConstructListBoxL()" )
   103     MUS_LOG( "[MUSSET] -> CMusSettingsContainer::ConstructListBoxL()" )
   101     iListBox->ConstructL( this, EAknListBoxSelectionList );
   104     iListBox->ConstructL( this, EAknListBoxSelectionList );
   102     iListboxItemArray = CGSListBoxItemTextArray::NewL(
   105     iListboxItemArray = CGSListBoxItemTextArray::NewL(
   103         aResLbxId, *iListBox, *iCoeEnv );
   106         aResLbxId, *iListBox, *iCoeEnv );
   104     iListBox->Model()->SetItemTextArray( iListboxItemArray );
   107     iListBox->Model()->SetItemTextArray( iListboxItemArray );
   105     iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
   108     iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
   106 
   109 
   107     if ( iOperatorVariant == MusSettingsKeys::EStandard )
   110     // OCC: removed "Automatic in home network" choice
   108     	{
   111     iActivationItems =
   109     	iActivationItems = iCoeEnv->ReadDesC16ArrayResourceL( 
   112             iCoeEnv->ReadDesC16ArrayResourceL(
   110     	                                R_ACTIVATION_SETTING_PAGE_LBX );
   113             R_OPERATOR_ACTIVATION_SETTING_PAGE_LBX );
   111     	}
       
   112     else
       
   113     	{
       
   114     	iActivationItems =
       
   115     		iCoeEnv->ReadDesC16ArrayResourceL(
       
   116     		R_OPERATOR_ACTIVATION_SETTING_PAGE_LBX );
       
   117     	}
       
   118 
   114 
   119     iAutoRecordItems = iCoeEnv->ReadDesC16ArrayResourceL(
   115     iAutoRecordItems = iCoeEnv->ReadDesC16ArrayResourceL(
   120                                     R_VS_VIDEO_SAVING_SETTING_PAGE_LBX );
   116                                     R_VS_VIDEO_SAVING_SETTING_PAGE_LBX );
   121 
   117 
   122     iProfileItems = iCoeEnv->ReadDesC16ArrayResourceL(
   118     iProfileItems = iCoeEnv->ReadDesC16ArrayResourceL(
   123     	R_SIP_PROFILE_SETTING_PAGE_LBX );
   119     	R_SIP_PROFILE_SETTING_PAGE_LBX );
   124 
   120 
   125     if ( iOperatorVariant == MusSettingsKeys::EStandard )
   121     iNoteItems = iCoeEnv->ReadDesC16ArrayResourceL(
   126     	{
   122 							R_VS_AUDIO_SETTING_PAGE_LBX );
   127         iNoteItems = iCoeEnv->ReadDesC16ArrayResourceL(
   123     
   128         	R_VS_AUDIO_SETTING_PAGE_LBX );
       
   129         }
       
   130     else
       
   131         {
       
   132         iNoteItems = iCoeEnv->ReadDesC16ArrayResourceL(
       
   133             R_VS_NOTE_SETTING_PAGE_LBX );
       
   134         }
       
   135 
       
   136     CreateListBoxItemsL();
   124     CreateListBoxItemsL();
   137 
   125 
   138     // Operator variant mode needs some item should not be visible to user.
   126     // Operator variant mode needs some item should not be visible to user.
   139     // Hide those items.
   127     // Hide those items.
   140     if ( iOperatorVariant == MusSettingsKeys::EOperatorSpecific )
   128     if ( iOperatorVariant == MusSettingsKeys::EOperatorSpecific )
   141     	{        
   129     	{        
   142         // Hide VS Activation Settings. If needed in future it can be made
   130         // Hide VS Activation Settings. If needed in future it can be made
   143         // visible.
   131         // visible.
   144         HideItemsL( KGSSettIdVSActivation );
   132     	// 
       
   133         //HideItemsL( KGSSettIdVSActivation );
   145         // Hide SIP Profile choosing option.If needed in future it can be made
   134         // Hide SIP Profile choosing option.If needed in future it can be made
   146         // visible.
   135         // visible.
   147         HideItemsL( KGSSettIdSIPProfile );
   136         HideItemsL( KGSSettIdSIPProfile );
   148         }    
   137         }    
   149     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::ConstructListBoxL()" )
   138     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::ConstructListBoxL()" )
   150     }
   139     }
   151 
   140 
   152 
   141 
   153 // ---------------------------------------------------------------------------
   142 // -----------------------------------------------------------------------------
   154 // Populates listbox items.
   143 // Populates listbox items.
   155 // ---------------------------------------------------------------------------
   144 // -----------------------------------------------------------------------------
   156 //
   145 //
   157 void CMusSettingsContainer::CreateListBoxItemsL()
   146 void CMusSettingsContainer::CreateListBoxItemsL()
   158     {
   147     {
   159     MUS_LOG( "[MUSSET] -> CMusSettingsContainer::CreateListBoxItemsL()" )
   148     MUS_LOG( "[MUSSET] -> CMusSettingsContainer::CreateListBoxItemsL()" )
   160     if ( iOperatorVariant == MusSettingsKeys::EStandard )
   149     if ( iOperatorVariant == MusSettingsKeys::EStandard )
   171     MakeNoteItemL();
   160     MakeNoteItemL();
   172     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::CreateListBoxItemsL()" )
   161     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::CreateListBoxItemsL()" )
   173     }
   162     }
   174 
   163 
   175 
   164 
   176 // ---------------------------------------------------------------------------
   165 // -----------------------------------------------------------------------------
   177 // Updates a specified feature (item in listbox).
   166 // Updates a specified feature (item in listbox).
   178 // ---------------------------------------------------------------------------
   167 // -----------------------------------------------------------------------------
   179 //
   168 //
   180 void CMusSettingsContainer::UpdateListBoxL( TInt aFeatureId )
   169 void CMusSettingsContainer::UpdateListBoxL( TInt aFeatureId )
   181     {
   170     {
   182     MUS_LOG1( "[MUSSET] <- CMusSettingsContainer::UpdateListBoxL()( %d )",
   171     MUS_LOG1( "[MUSSET] <- CMusSettingsContainer::UpdateListBoxL()( %d )",
   183               aFeatureId )
   172               aFeatureId )
   190             	}
   179             	}
   191             else
   180             else
   192             	{
   181             	{
   193             	MakeOperatorActivationItemL();
   182             	MakeOperatorActivationItemL();
   194             	}
   183             	}
   195 	        break;
   184             break;
   196         case KGSSettIdSIPProfile:
   185         case KGSSettIdSIPProfile:
   197             MakeSIPProfileItemL();
   186             MakeSIPProfileItemL();
   198             break;
   187             break;
   199         case KGSSettIdAutoRecord:
   188         case KGSSettIdAutoRecord:
   200             MakeAutoRecordItemL();
   189             MakeAutoRecordItemL();
   201         	break;
   190             break;
   202         case KGSSettIdRecordedVideoSaving:
   191         case KGSSettIdRecordedVideoSaving:
   203         	MakeRecordedVideoSavingItemL();
   192             MakeRecordedVideoSavingItemL();
   204         	break;
   193             break;
   205         case KGSSettIdNote:
   194         case KGSSettIdNote:
   206         	MakeNoteItemL();
   195             MakeNoteItemL();
   207         	break;
   196             break;
   208         default:
   197         default:
   209             break;
   198             break;
   210         }
   199         }
   211 
   200 
   212     iListBox->HandleItemAdditionL();
   201     iListBox->HandleItemAdditionL();
   213     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::UpdateListBoxL()" )
   202     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::UpdateListBoxL()" )
   214     }
   203     }
   215 
   204 
   216 
   205 
   217 // ---------------------------------------------------------------------------
   206 // -----------------------------------------------------------------------------
   218 // Generic method to add an item to listbox and make it visible.
   207 // Generic method to add an item to listbox and make it visible.
   219 // ---------------------------------------------------------------------------
   208 // -----------------------------------------------------------------------------
   220 //
   209 //
   221 void CMusSettingsContainer::AddItemL( TInt aId, const TPtrC aText )
   210 void CMusSettingsContainer::AddItemL( TInt aId, const TPtrC aText )
   222 	{
   211     {
   223 	MUS_LOG( "[MUSSET] -> CMusSettingsContainer::AddItemL()" )
   212     MUS_LOG( "[MUSSET] -> CMusSettingsContainer::AddItemL()" )
   224     iListboxItemArray->SetDynamicTextL( aId, aText );
   213     iListboxItemArray->SetDynamicTextL( aId, aText );
   225     iListboxItemArray->SetItemVisibilityL( aId,
   214     iListboxItemArray->SetItemVisibilityL( aId,
   226     	CGSListBoxItemTextArray::EVisible );
   215     CGSListBoxItemTextArray::EVisible );
   227 	MUS_LOG( "[MUSSET] <- CMusSettingsContainer::AddItemL()" )
   216     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::AddItemL()" )
   228 	}
   217     }
   229 
   218 
   230 
   219 
   231 // ---------------------------------------------------------------------------
   220 // -----------------------------------------------------------------------------
   232 // Adds activation setting item to listbox.
   221 // Adds activation setting item to listbox.
   233 // ---------------------------------------------------------------------------
   222 // -----------------------------------------------------------------------------
   234 //
   223 //
   235 void CMusSettingsContainer::MakeActivationItemL()
   224 void CMusSettingsContainer::MakeActivationItemL()
   236     {
   225     {
   237     MUS_LOG( "[MUSSET] -> CMusSettingsContainer::MakeActivationItemL()" )
   226     MUS_LOG( "[MUSSET] -> CMusSettingsContainer::MakeActivationItemL()" )
   238 
   227 
   239    	iVSActication = iModel.VSSettingsActivationL();
   228     MusSettingsKeys::TActivation activation = 
   240    	AddItemL( KGSSettIdVSActivation, ( *iActivationItems )[ iVSActication ] );
   229                                 MultimediaSharingSettings::ActivationSettingL();
       
   230  
       
   231     if ( activation != MusSettingsKeys::EAlwaysActive )
       
   232         {
       
   233         // We make sure that if someone has written to CenRep value bigger
       
   234         // than 1 (which after OCC changes means 'Off') we treat it as 'Off'.
       
   235         activation = MusSettingsKeys::EActiveInHomeNetworks;
       
   236         }
       
   237     
       
   238     AddItemL( KGSSettIdVSActivation, ( *iActivationItems )[ activation ] );
   241 
   239 
   242     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::MakeActivationItemL()" )
   240     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::MakeActivationItemL()" )
   243     }
   241     }
   244 
   242 
   245 
   243 
   246 // ---------------------------------------------------------------------------
   244 // -----------------------------------------------------------------------------
   247 // Adds operator specific activation setting item to listbox.
   245 // Adds operator specific activation setting item to listbox.
   248 // ---------------------------------------------------------------------------
   246 // -----------------------------------------------------------------------------
   249 //
   247 //
   250 void CMusSettingsContainer::MakeOperatorActivationItemL()
   248 void CMusSettingsContainer::MakeOperatorActivationItemL()
   251     {
   249     {
   252     MUS_LOG( "[MUSSET] -> CMusSettingsContainer::MakeOperatorActivationItemL()" )
   250     MUS_LOG( "[MUSSET] -> CMusSettingsContainer::MakeOperatorActivationItemL()" )
   253 
   251             
   254    	iVSActication = iModel.VSSettingsActivationL();
   252     //sync with real value, if op specifig
   255    	if ( iVSActication == MusSettingsKeys::ENever ) // ==2
   253     iModel.InitializeProfileEnablerL();
   256     	{ // operator specific one is different from usual one
   254     
   257     	iVSActication = MusSettingsKeys::EActiveInHomeNetworks; //==1
   255     MUS_LOG1( "Activation item=%d (0=VS enabled, 1=VS disabled)", iModel.ActivationItem() )
   258     	}
   256     AddItemL( KGSSettIdVSActivation, ( *iActivationItems )[ iModel.ActivationItem() ] );
   259 
       
   260 	AddItemL( KGSSettIdVSActivation, ( *iActivationItems )[ iVSActication ] );
       
   261 
   257 
   262     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::MakeOperatorActivationItemL()" )
   258     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::MakeOperatorActivationItemL()" )
   263     }
   259     }
   264 
   260 
   265 
   261 
   266 // ---------------------------------------------------------------------------
   262 // -----------------------------------------------------------------------------
   267 // Adds SIP profile setting item to settings listbox. Item will contain
   263 // Adds SIP profile setting item to settings listbox. Item will contain
   268 // indication of [no SIP profile selected], [using default SIP profile] or
   264 // indication of [no SIP profile selected], [using default SIP profile] or
   269 // [name of SIP profile specified to be used]
   265 // [name of SIP profile specified to be used]
   270 // ---------------------------------------------------------------------------
   266 // -----------------------------------------------------------------------------
   271 //
   267 //
   272 void CMusSettingsContainer::MakeSIPProfileItemL()
   268 void CMusSettingsContainer::MakeSIPProfileItemL()
   273     {
   269     {
   274     MUS_LOG( "[MUSSET] -> CMusSettingsContainer::MakeSIPProfileItemL()" )
   270     MUS_LOG( "[MUSSET] -> CMusSettingsContainer::MakeSIPProfileItemL()" )
   275 
   271 
   276     TInt profile = iModel.VSSettingsProfileL();
   272     TInt profile = MultimediaSharingSettings::SipProfileSettingL();
   277 
   273 
   278     if ( profile != KDefaultSipProfile && profile != KNoSipProfileSelected )
   274     if ( profile != KDefaultSipProfile && profile != KNoSipProfileSelected )
   279     	{
   275     	{
   280     	// profile id defined, get profile name
   276         // profile id defined, get profile name
   281 		HBufC* name = iModel.ProfileNameL( profile );
   277         HBufC* name = iModel.ProfileNameL( profile );
   282 
   278 
   283 		if ( name )
   279         if ( name )
   284 			{
   280             {
   285 			CleanupStack::PushL( name );
   281             CleanupStack::PushL( name );
   286 			AddItemL( KGSSettIdSIPProfile, *name );
   282             AddItemL( KGSSettIdSIPProfile, *name );
   287 			CleanupStack::PopAndDestroy( name );
   283             CleanupStack::PopAndDestroy( name );
   288     		}
   284             }
   289     	else
   285     	else
   290     		{
   286             {
   291     		// show profile value not selected
   287             // show profile value not selected
   292     		AddItemL( KGSSettIdSIPProfile,
   288             AddItemL( KGSSettIdSIPProfile,
   293     			( *iProfileItems )[ CMusSettingsModel::KVsSipProfileSelectNone ] );
   289                     ( *iProfileItems )[ CMusSettingsModel::KVsSipProfileSelectNone ] );
   294 			}
   290                     }
   295 		}
   291             }
   296     else if ( profile == KNoSipProfileSelected )
   292     else if ( profile == KNoSipProfileSelected )
   297     	{
   293     	{
   298     	AddItemL( KGSSettIdSIPProfile,
   294     	AddItemL( KGSSettIdSIPProfile,
   299     		( *iProfileItems )[ CMusSettingsModel::KVsSipProfileSelectNone ] );
   295     		( *iProfileItems )[ CMusSettingsModel::KVsSipProfileSelectNone ] );
   300 		}
   296         }
   301     else
   297     else
   302     	{
   298     	{
   303 	    AddItemL(
   299         AddItemL(
   304 	    	KGSSettIdSIPProfile,
   300             KGSSettIdSIPProfile,
   305 	    	( *iProfileItems )[ CMusSettingsModel::KVsSipProfileDefault ] );
   301             ( *iProfileItems )[ CMusSettingsModel::KVsSipProfileDefault ] );
   306 		}
   302             }
   307 
   303 
   308     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::MakeSIPProfileItemL()" )
   304     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::MakeSIPProfileItemL()" )
   309     }
   305     }
   310 
   306 
   311 
   307 
   312 // ---------------------------------------------------------------------------
   308 // -----------------------------------------------------------------------------
   313 // Adds autorecord item to listbox.
   309 // Adds autorecord item to listbox.
   314 // ---------------------------------------------------------------------------
   310 // -----------------------------------------------------------------------------
   315 //
   311 //
   316 void CMusSettingsContainer::MakeAutoRecordItemL()
   312 void CMusSettingsContainer::MakeAutoRecordItemL()
   317     {
   313     {
   318     MUS_LOG( "[MUSSET] -> CMusSettingsContainer::MakeAutoRecordItemL()" )
   314     MUS_LOG( "[MUSSET] -> CMusSettingsContainer::MakeAutoRecordItemL()" )
   319     TInt autoRecordMode = iModel.VSSettingsAutoRecordL();
   315     TInt autoRecordMode = MultimediaSharingSettings::AutoRecordSettingL();
   320     
   316     
   321     MUS_LOG1( "[MUSSET]    autoRecordMode: %d", autoRecordMode  )
   317     MUS_LOG1( "[MUSSET]    autoRecordMode: %d", autoRecordMode  )
   322     MUS_LOG1( "[MUSSET]    iAutoRecordItems.Count: %d", iAutoRecordItems->Count() )
   318     MUS_LOG1( "[MUSSET]    iAutoRecordItems.Count: %d", iAutoRecordItems->Count() )
   323 
   319 
   324     if ( autoRecordMode > iAutoRecordItems->Count() - 1 )
   320     if ( autoRecordMode > iAutoRecordItems->Count() - 1 )
   332     
   328     
   333     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::MakeAutoRecordItemL()" )
   329     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::MakeAutoRecordItemL()" )
   334     }
   330     }
   335 
   331 
   336 
   332 
   337 // ---------------------------------------------------------------------------
   333 // -----------------------------------------------------------------------------
   338 // Adds recorded video saving item to listbox.
   334 // Adds recorded video saving item to listbox.
   339 // ---------------------------------------------------------------------------
   335 // -----------------------------------------------------------------------------
   340 //
   336 //
   341 void CMusSettingsContainer::MakeRecordedVideoSavingItemL()
   337 void CMusSettingsContainer::MakeRecordedVideoSavingItemL()
   342     {
   338     {
   343     MUS_LOG(
   339     MUS_LOG(
   344     	"[MUSSET] -> CMusSettingsContainer::MakeRecordedVideoSavingItemL()" )
   340     	"[MUSSET] -> CMusSettingsContainer::MakeRecordedVideoSavingItemL()" )
   350     TDriveNumber driveNumber = ( TDriveNumber )savingMode;
   346     TDriveNumber driveNumber = ( TDriveNumber )savingMode;
   351     TInt index = dlg->FindIndexByDrive( driveNumber );
   347     TInt index = dlg->FindIndexByDrive( driveNumber );
   352     
   348     
   353     if ( index == KErrNotFound )
   349     if ( index == KErrNotFound )
   354         {
   350         {
   355         MUS_LOG( "[MUSSET] -> preferred drive doesn't exist anymore \
   351         MUS_LOG( "[MUSSET]    Preferred drive doesn't exist anymore, " )
   356 (e.g. remote drive deleted), taking system drive..." )
   352         MUS_LOG( "[MUSSET]    e.g. remote drive deleted, using system drive" )
   357 
   353 
   358         driveNumber = RFs::GetSystemDrive();
   354         driveNumber = RFs::GetSystemDrive();
   359         index = dlg->FindIndexByDrive( driveNumber );
   355         index = dlg->FindIndexByDrive( driveNumber );
   360         iModel.SetVSSettingsRecordedVideoSavingL( driveNumber );
   356         MultimediaSharingSettings::SetVideoLocationSettingL( driveNumber );
   361         }
   357         }
   362 
   358 
   363     TFileName item( KNullDesC );  
   359     TFileName item( KNullDesC );  
   364     dlg->GetItem( index, item );
   360     dlg->GetItem( index, item );
   365     MUS_LOG1( "[MUSSET]     Current drive:%d", driveNumber )
   361     MUS_LOG1( "[MUSSET]     Current drive:%d", driveNumber )
   371     MUS_LOG(
   367     MUS_LOG(
   372     	"[MUSSET] <- CMusSettingsContainer::MakeRecordedVideoSavingItemL()" )
   368     	"[MUSSET] <- CMusSettingsContainer::MakeRecordedVideoSavingItemL()" )
   373     }
   369     }
   374 
   370 
   375 
   371 
   376 // ---------------------------------------------------------------------------
   372 // -----------------------------------------------------------------------------
   377 // Adds note item to listbox. (Alerts setting). Present only with operator
   373 // Adds note item to listbox. (Alerts setting). Present only with operator
   378 // variant set.
   374 // variant set.
   379 // ---------------------------------------------------------------------------
   375 // -----------------------------------------------------------------------------
   380 //
   376 //
   381 void CMusSettingsContainer::MakeNoteItemL()
   377 void CMusSettingsContainer::MakeNoteItemL()
   382     {
   378     {
   383     MUS_LOG(
   379     MUS_LOG( "[MUSSET] -> CMusSettingsContainer::MakeNoteItemL()" )
   384     	"[MUSSET] -> CMusSettingsContainer::MakeNoteItemL()" )
   380 
   385 
   381     MusSettingsKeys::TAuditoryNotification auditoryNotification = 
   386     TInt savingMode = iModel.VSSettingsNoteL();
   382                     MultimediaSharingSettings::AuditoryNotificationSettingL();
   387 
   383 
   388     MUS_LOG1( "[MUSSET] -> CMusSettingsContainer::Mode:%d()", savingMode );
   384     MUS_LOG1( "[MUSSET] -> CMusSettingsContainer::Mode:%d()", 
       
   385               auditoryNotification )
   389 
   386 
   390     // If unset, use and set default value
   387     // If unset, use and set default value
   391     if ( savingMode < 0 || savingMode > 1 )
   388     if ( auditoryNotification < 0 || auditoryNotification > 1 )
   392 	    {
   389         {
   393 	    savingMode = 0;
   390         auditoryNotification = MusSettingsKeys::EAuditoryNotificationOff;
   394 	    iModel.SetVSSettingsNoteL(
   391         MultimediaSharingSettings::SetAuditoryNotificationSettingL(
   395 	        MusSettingsKeys::EAuditoryNotificationOff );
   392                                     MusSettingsKeys::EAuditoryNotificationOff );
   396 	    }
   393         }
   397 
   394 
   398 	AddItemL( KGSSettIdNote, ( *iNoteItems )[ savingMode ] );
   395     AddItemL( KGSSettIdNote, ( *iNoteItems )[ auditoryNotification ] );
   399 
   396 	
   400     MUS_LOG(
   397     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::MakeNoteItemL()" )
   401     	"[MUSSET] <- CMusSettingsContainer::MakeNoteItemL()" )
   398     }
   402     }
   399 
   403 
   400 
   404 
   401 // -----------------------------------------------------------------------------
   405 // ---------------------------------------------------------------------------
       
   406 // Gets help context.
   402 // Gets help context.
   407 // ---------------------------------------------------------------------------
   403 // -----------------------------------------------------------------------------
   408 //
   404 //
   409 void CMusSettingsContainer::GetHelpContext( TCoeHelpContext& aContext ) const
   405 void CMusSettingsContainer::GetHelpContext( TCoeHelpContext& aContext ) const
   410     {
   406     {
   411     MUS_LOG( "[MUSSET] -> CMusSettingsContainer::GetHelpContext()" )
   407     MUS_LOG( "[MUSSET] -> CMusSettingsContainer::GetHelpContext()" )
   412     aContext.iMajor = KUidMUSH;
   408     aContext.iMajor = KUidMUSH;
   413     aContext.iContext = KMSH_HLP_SETTINGS;
   409     aContext.iContext = KMSH_HLP_SETTINGS;
   414     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::GetHelpContext()" )
   410     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::GetHelpContext()" )
   415     }
   411     }
   416 
   412 
   417 
   413 
   418 // ---------------------------------------------------------------------------
   414 // -----------------------------------------------------------------------------
   419 // Returns currently selected feature (listbox item).
   415 // Returns currently selected feature (listbox item).
   420 // ---------------------------------------------------------------------------
   416 // -----------------------------------------------------------------------------
   421 //
   417 //
   422 TInt CMusSettingsContainer::CurrentFeatureId() const
   418 TInt CMusSettingsContainer::CurrentFeatureId() const
   423     {
   419     {
   424     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::CurrentFeatureId()" )
   420     MUS_LOG( "[MUSSET] <- CMusSettingsContainer::CurrentFeatureId()" )
   425     return iListboxItemArray->CurrentFeature( );
   421     return iListboxItemArray->CurrentFeature( );
   426     }
   422     }
   427 
   423 
   428 
   424 
   429 // ----------------------------------------------------------------------------
   425 // -----------------------------------------------------------------------------
   430 // If call is on, informs user with note that new profile is going to be active
   426 // If call is on, informs user with note that new profile is going to be active
   431 // after current call.
   427 // after current call.
   432 // ----------------------------------------------------------------------------
   428 // -----------------------------------------------------------------------------
   433 //
   429 //
   434 void CMusSettingsContainer::ShowNewProfileActiveAfterCallL()
   430 void CMusSettingsContainer::ShowNewProfileActiveAfterCallL()
   435     {
   431     {
   436     MUS_LOG(
   432     MUS_LOG(
   437     	"[MUSSET] -> CMusSettingsContainer::ShowNewProfileActiveAfterCallL()" )
   433     	"[MUSSET] -> CMusSettingsContainer::ShowNewProfileActiveAfterCallL()" )
   438 	TPSCTsyCallState callState;
   434     TPSCTsyCallState callState;
   439 	User::LeaveIfError( RProperty::Get( KPSUidCtsyCallInformation,
   435     User::LeaveIfError( RProperty::Get( KPSUidCtsyCallInformation,
   440 			KCTsyCallState,
   436                     KCTsyCallState,
   441 			(TInt&)callState) );
   437                     (TInt&)callState) );
   442 	if ( callState == EPSCTsyCallStateAlerting ||
   438     
   443 		callState ==  EPSCTsyCallStateRinging ||
   439     if ( callState == EPSCTsyCallStateAlerting ||
   444 		callState ==  EPSCTsyCallStateDialling ||
   440          callState ==  EPSCTsyCallStateRinging ||
   445 		callState ==  EPSCTsyCallStateAnswering ||
   441          callState ==  EPSCTsyCallStateDialling ||
   446 		callState ==  EPSCTsyCallStateDisconnecting ||
   442          callState ==  EPSCTsyCallStateAnswering ||
   447 		callState ==  EPSCTsyCallStateConnected ||
   443          callState ==  EPSCTsyCallStateDisconnecting ||
   448 		callState ==  EPSCTsyCallStateHold)
   444          callState ==  EPSCTsyCallStateConnected ||
   449 		{
   445          callState ==  EPSCTsyCallStateHold)
   450 		HBufC* infoTxt = StringLoader::LoadLC( R_QTN_MSH_SET_PROFILE_NOTE );
   446         {
   451 	    CAknInformationNote* note = new ( ELeave ) CAknInformationNote( ETrue );
   447         HBufC* infoTxt = StringLoader::LoadLC( R_QTN_MSH_SET_PROFILE_NOTE );
   452 	    note->ExecuteLD( infoTxt->Des() );
   448         CAknInformationNote* note = new ( ELeave ) CAknInformationNote( ETrue );
   453 	    CleanupStack::PopAndDestroy( infoTxt );
   449         note->ExecuteLD( infoTxt->Des() );
   454 	    MUS_LOG(
   450         CleanupStack::PopAndDestroy( infoTxt );
   455 	    	"[MUSSET] <- CMusSettingsContainer::ShowNewProfileActiveAfterCallL()" )
   451         }
   456 		}
   452     
   457     }
   453     MUS_LOG(
   458 
   454         "[MUSSET] <- CMusSettingsContainer::ShowNewProfileActiveAfterCallL()" )
   459 // ----------------------------------------------------------------------------
   455     }
       
   456 
       
   457 // -----------------------------------------------------------------------------
   460 // void CMusSettingsContainer::HideItemsL(TInt aItemIndex)
   458 // void CMusSettingsContainer::HideItemsL(TInt aItemIndex)
   461 // Some items are unwanted by operators.Hide those items from listbox item
   459 // Some items are unwanted by operators.Hide those items from listbox item
   462 // ----------------------------------------------------------------------------
   460 // -----------------------------------------------------------------------------
   463 //
   461 //
   464 void CMusSettingsContainer::HideItemsL(TInt aItemIndex)
   462 void CMusSettingsContainer::HideItemsL(TInt aItemIndex)
   465     {
   463     {
   466     MUS_LOG1("[MUSSET] -> CMusSettingsContainer::HideItemsL() %d",aItemIndex )    
   464     MUS_LOG1("[MUSSET] -> CMusSettingsContainer::HideItemsL() %d",aItemIndex )    
   467     iListboxItemArray->SetItemVisibilityL( aItemIndex,
   465     iListboxItemArray->SetItemVisibilityL( aItemIndex,
   468             	CGSListBoxItemTextArray::EInvisible );
   466             	CGSListBoxItemTextArray::EInvisible );
   469 	MUS_LOG("[MUSSET] <- CMusSettingsContainer::HideItemsL()" )	
   467     MUS_LOG("[MUSSET] <- CMusSettingsContainer::HideItemsL()" )	
   470     }
   468     }
       
   469