void HandleCommandL(TInt aCommand)
	{   
		CALLSTACKITEM_N(_CL("CDynamicSettingsViewImpl"), _CL("HandleCommandL"));
		
		switch ( aCommand )
			{
			case EContextUICmdSettingsChange:
				{
					ShowSettingPageL( ETrue );				
				}
				break;
			case EContextUICmdResetUiState1:
				{
					Settings().WriteSettingL( SETTING_DONT_DOUBLE_CONFIRM_DELETES, 0 );
					Settings().WriteSettingL( SETTING_SHOW_WARNING_ON_BACK, 1 );
				}
				break;
			case EContextUICmdSettingsSave:
				StoreSettingsL();
				break;
			case EAknSoftkeyOk:
			case EAknSoftkeyDone:
			case EAknSoftkeyBack:
				StoreSettingsL();					
				if (iPreviousLocalViewId==TUid::Uid(0)) {
					AppUi()->ActivateViewL(iPreviousViewId);
				} else {
					AppUi()->ActivateLocalViewL(iPreviousLocalViewId);
				}
				break;
			default:
				AppUi()->HandleCommandL(aCommand);
			}
	}
/**
Loads the database system settings from the settings table.
If the settings table does not exist then it is created with the default settings
(the stored collation dll name will be empty and the stored database configuration 
file version will be 0).

@param aDbName Logical database name: "main" for the main database or attached database name,
@param aCollationDllName Output parameter, will contain the stored collation dll name,
@param aDbConfigFileVersion Output parameter, will contain the stored database config file version.
@param aCompactionMode Output parameter. Database compaction mode (one of TSqlCompactionMode enum item values except ESqlCompactionNotSet).
					   Note that the input value of this parameter might be ESqlCompactionManual if the this is a legacy database,
					   created not by the SQL server.

@see TSqlCompactionMode

@leave KErrNoMemory, an out of memory condition has occurred.
       Note that the function may also leave with some other database specific 
       errors categorised as ESqlDbError, and other system-wide error codes..
@panic SqlDb 2 In _DEBUG mode if iDbHandle is NULL (uninitialized TSqlDbSysSettings object).
@panic SqlDb 7 In _DEBUG mode if the stored compaction mode is invalid.
*/	
void TSqlDbSysSettings::LoadSettingsL(const TDesC& aDbName, TDes& aCollationDllName, TInt& aDbConfigFileVersion, TSqlCompactionMode& aCompactionMode)
	{
	__ASSERT_DEBUG(iDbHandle != NULL, __SQLPANIC(ESqlPanicInvalidObj));

	aCollationDllName.Zero();
	aDbConfigFileVersion = KSqlNullDbConfigFileVersion;	
	if(aCompactionMode == ESqlCompactionNotSet)
		{
		aCompactionMode = KSqlDefaultCompactionMode;
		}
		
	//If the system settings table does not exist then create it now.
	//For a database created by the SQL Server this will only occur 
	//when the database is being created in an application's private data cage -
	//as part of this create call it is now being opened by the server.
	//An externally created database is likely to not contain the settings table 
	//and adding it here makes the database 'SQL Server-compatible'
	if(!SettingsTableExistsL(aDbName))
		{
		StoreSettingsL(aDbName, aCollationDllName, KSqlNullDbConfigFileVersion, aCompactionMode); // store empty collation dll name, then reindexing will occur
		}
	else
		{
		//Get the settings from the existing table
		TInt settingsVersion = 0;
		GetSettingsL(aDbName, aCollationDllName, aDbConfigFileVersion, settingsVersion, aCompactionMode);
		if(settingsVersion < KSqlSystemVersion)
			{
			//Recreate the settings table using the last version number format (this is what the old code did during reindexing)
			StoreSettingsL(aDbName, aCollationDllName, aDbConfigFileVersion, aCompactionMode); // store empty collation dll name, then reindexing will occur
			}
		}
	__ASSERT_DEBUG(aCompactionMode == ESqlCompactionManual || aCompactionMode == ESqlCompactionBackground || aCompactionMode == ESqlCompactionAuto, __SQLPANIC(ESqlPanicInternalError));
	}
//-----------------------------------------------------------------------------
// CBTKeySettingList::EditCurrentItemL
//-----------------------------------------------------------------------------
//
void CBTKeySettingList::EditCurrentItemL( TInt aCommand )
    {
    if ( ListBox() )
        {
        TInt index = ListBox()->CurrentItemIndex();
        EditItemL(index, EBTKeyCmdAppChange == aCommand);
        StoreSettingsL();        
        }
    }    
//-----------------------------------------------------------------------------
// CBTKeySettingList::HandleListBoxEventL
//-----------------------------------------------------------------------------
//
void CBTKeySettingList::HandleListBoxEventL(
            CEikListBox* aListBox, TListBoxEvent aEventType)
    {
        // call the base classes handler to handle this event.
    CAknSettingItemList::HandleListBoxEventL(aListBox, aEventType);
    
    // store the values from all setting items to their external variables
    StoreSettingsL();
    }
void CBuddycloudEditPlaceList::SaveL() {
	StoreSettingsL();

	if(iEditingPlace) {
		iEditingPlace->GetGeoloc()->SetStringL(EGeolocText, iName);
		iEditingPlace->GetGeoloc()->SetStringL(EGeolocStreet, iStreet);
		iEditingPlace->GetGeoloc()->SetStringL(EGeolocArea, iArea);
		iEditingPlace->GetGeoloc()->SetStringL(EGeolocLocality, iCity);
		iEditingPlace->GetGeoloc()->SetStringL(EGeolocPostalcode, iPostcode);
		iEditingPlace->GetGeoloc()->SetStringL(EGeolocRegion, iRegion);
		iEditingPlace->GetGeoloc()->SetStringL(EGeolocCountry, iCountry);
		iEditingPlace->SetShared(iShared);
	}
}
void CExampleSettingList::EditCurrentItemL(TBool aFromMenu)
	{
	// Invoke EditItemL on the current item
    EditItemL(ListBox()->CurrentItemIndex(),	// the item index
                aFromMenu);							// invoked from menu
        
			  
	//Updating CAknPasswordSettingItem.
	if(ListBox()->CurrentItemIndex()==5)
		{
		(*(SettingItemArray()))[ListBox()->CurrentItemIndex()]->UpdateListBoxTextL();
		}
        
    StoreSettingsL();
	}
void CDCQLoginViewSettings::EditCurrentItemL()
{
   TInt aCurrItemIdx = ListBox()->CurrentItemIndex();
   
   // invoke EditItemL on the current item
   EditItemL(aCurrItemIdx, // the item index
             EFalse); // not invoked from menu

   //Updating CAknPasswordSettingItem.
   if (aCurrItemIdx == EDCQLoginViewSettingICQPasswordOrder)
   {
      (*(SettingItemArray()))[aCurrItemIdx]->UpdateListBoxTextL();
   }
   
   StoreSettingsL();
}
void CExampleSettingList::EditItemL ( TInt aIndex, TBool aCalledFromMenu )
	{
		CAknSettingItemList::EditItemL( aIndex, aCalledFromMenu );
		StoreSettingsL();
	}
Example #9
0
TBool CSettingView::SaveSettingsL()
{
    // Save settings to the member variables

    StoreSettingsL();

    // Validate input

    TLex lex;

    TInt maxPacketCount;
    lex.Assign( iMaxPacketCount );
    if ( lex.Val( maxPacketCount ) != KErrNone ) 
    {
        CEikonEnv::Static()->InfoMsg(_L("Packet count must be numeric"));
        return EFalse;
    }

    TInt packetDataSize;
    lex.Assign( iPacketDataSize );
    if ( lex.Val( packetDataSize ) != KErrNone ) 
    {
        CEikonEnv::Static()->InfoMsg(_L("Packet size must be numeric"));
        return EFalse;
    }

    TInt waitTime;
    lex.Assign( iWaitTime );
    if ( lex.Val( waitTime ) != KErrNone ) 
    {
        CEikonEnv::Static()->InfoMsg(_L("Wait time must be numeric"));
        return EFalse;
    }

    TInt lastWaitTime;
    lex.Assign( iLastWaitTime );
    if ( lex.Val( lastWaitTime ) != KErrNone ) 
    {
        CEikonEnv::Static()->InfoMsg(_L("Last wait time must be numeric"));
        return EFalse;
    }

    lex.Assign( iPattern );
    while (!lex.Eos())
    {
        if (!lex.Get().IsHexDigit())
        {
            CEikonEnv::Static()->InfoMsg(_L("Pattern must be hexadecimal"));
            return EFalse;
        }
    }

    // Validation OK, so save settings to the model

    iPingModel->iPackLimit = iLimitPacketCount;
    iPingModel->iTotalPackets = maxPacketCount;
    iPingModel->iPacketDataSize = packetDataSize;
    iPingModel->iSecWait = waitTime;
    iPingModel->iLastSecWait = lastWaitTime;
    iPingModel->iPattern.Copy(iPattern);
    iPingModel->iQuiet = iQuiet;
    iPingModel->iVerbose = iVerbose;
    iPingModel->iDebug = iDebug;

#ifdef IAPSETTING
	TInt iap;
	lex.Assign( iIAP );
	lex.Val( iap );
	iPingModel->iIAP = iap;
#endif

    return ETrue;
}