vpnui/vpnmanagementui/src/vpnuiloader.cpp
changeset 0 33413c0669b9
child 10 68dc8923de26
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     1 /*
       
     2 * Copyright (c) 2003 - 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   VPN management main view
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <aknnotewrappers.h> // for warning & information notes
       
    22 #include <AknWaitDialog.h>
       
    23 #include <cmmanagerext.h>
       
    24 #include <cmdestinationext.h>
       
    25 #include <cmpluginvpndef.h>
       
    26 #include <cmapplicationsettingsui.h>
       
    27 #include <commdb.h>
       
    28 #include <sysutil.h>
       
    29 #include <ErrorUI.h>
       
    30 #include <bautils.h>
       
    31 #include <vpnmanagementuirsc.rsg>
       
    32 #include "vpnuiloader.h"
       
    33 #include "vpnmanagementuiview.h"
       
    34 #include "vpnmanagementuipolicyview.h"
       
    35 #include "vpnmanagementuiserverview.h"
       
    36 #include "vpnmanagementuilogview.h"
       
    37 #include "vpnmanagementuiserversettingsview.h"
       
    38 #include "version.h"
       
    39 #include "vpnmanagementuiserversettingscontainer.h"
       
    40 
       
    41 #include "log_vpnmanagementui.h"
       
    42 
       
    43 // CONSTANTS
       
    44 
       
    45 
       
    46 using namespace CMManager;
       
    47 
       
    48 
       
    49 // ================= MEMBER FUNCTIONS =======================
       
    50 
       
    51 // ---------------------------------------------------------
       
    52 // CVpnUiLoader::CVpnUiLoader()
       
    53 // Constructor with parent
       
    54 // ---------------------------------------------------------
       
    55 //
       
    56 CVpnUiLoader::CVpnUiLoader( CVpnManagementUiView* aUiView ):
       
    57     iVpnManagementUiView(aUiView),
       
    58     iResourceLoader(*iCoeEnv)
       
    59     {
       
    60     LOG_("CVpnUiLoader::CVpnUiLoader()");
       
    61     ASSERT( aUiView );
       
    62     }
       
    63 
       
    64 // ---------------------------------------------------------
       
    65 // CVpnUiLoader::~CVpnUiLoader()
       
    66 // Destructor
       
    67 // ---------------------------------------------------------
       
    68 //
       
    69 CVpnUiLoader::~CVpnUiLoader()
       
    70     {
       
    71     LOG_("CVpnUiLoader::~CVpnUiLoader()");
       
    72     iVpnManagementUiView = NULL;
       
    73     
       
    74     if ( iLogViewVisited == EFalse )
       
    75        delete iVpnManagementUiLogView;
       
    76         
       
    77     if ( iPolicyViewVisited == EFalse )
       
    78        delete iVpnManagementUiPolicyView;
       
    79        
       
    80     delete iVpnManagementUiParametersView;
       
    81     delete iVpnManagementUiServerView;
       
    82         
       
    83     if(iVersionInfoInNaviPane)
       
    84         {
       
    85         delete iVersionInfoInNaviPane; 
       
    86         }
       
    87     delete iVpnApiWrapper;
       
    88     delete iWaitDialog;
       
    89 	iResourceLoader.Close();
       
    90     }
       
    91 
       
    92 // ---------------------------------------------------------
       
    93 // CVpnUiLoader* CVpnUiLoader::NewL()
       
    94 // ---------------------------------------------------------
       
    95 //
       
    96 CVpnUiLoader* CVpnUiLoader::NewL(
       
    97     const TRect& aRect, TUid aViewId,
       
    98     CVpnManagementUiView* aUiView )
       
    99     {
       
   100     CVpnUiLoader* self = NewLC( aRect, aViewId, aUiView );
       
   101     CleanupStack::Pop();
       
   102     return self;
       
   103     }
       
   104 
       
   105 // ---------------------------------------------------------
       
   106 // CVpnUiLoader* CVpnUiLoader::NewLC()
       
   107 // ---------------------------------------------------------
       
   108 //
       
   109 CVpnUiLoader* CVpnUiLoader::NewLC(
       
   110     const TRect& aRect, TUid aViewId,
       
   111     CVpnManagementUiView* aUiView )
       
   112     {
       
   113     CVpnUiLoader* self = new ( ELeave ) CVpnUiLoader( aUiView );
       
   114     CleanupStack::PushL( self );
       
   115     self->ConstructL( aRect, aViewId );
       
   116     return self;
       
   117     }
       
   118 
       
   119 // ---------------------------------------------------------
       
   120 // CVpnUiLoader::ConstructL()
       
   121 // ---------------------------------------------------------
       
   122 //
       
   123 void CVpnUiLoader::ConstructL( const TRect& aRect, TUid aViewId )
       
   124     {
       
   125     LOG_("CVpnUiLoader::ConstructL() - begin");
       
   126     
       
   127     AddResourceFileL();
       
   128     //Initialization
       
   129     iBackFromServerDefinition = EFalse;
       
   130     iNewServerDefinition = EFalse;
       
   131     iPolicyUpdate = EFalse;
       
   132 
       
   133     CEikStatusPane* statusPane = STATIC_CAST(
       
   134         CAknAppUi*, iEikonEnv->EikAppUi())->StatusPane();
       
   135 
       
   136     // Fetch pointer to the default navi pane control
       
   137     iNaviPane =  static_cast<CAknNavigationControlContainer*> (
       
   138         statusPane->ControlL( TUid::Uid(EEikStatusPaneUidNavi) ) );
       
   139     
       
   140 	iPreviousAppViewId = aViewId;
       
   141 	CreateWindowL();
       
   142 
       
   143     iVpnManagementUiPolicyView = CVpnManagementUiPolicyView::NewL( 
       
   144         aRect, *this);
       
   145     iVpnManagementUiServerView = CVpnManagementUiServerView::NewL( 
       
   146         aRect, *this);
       
   147     iVpnManagementUiLogView = CVpnManagementUiLogView::NewL( aRect, *this);
       
   148     iVpnManagementUiParametersView = CServerSettingsView::NewL( aRect, *this);
       
   149 
       
   150 	SetRect(aRect);
       
   151 
       
   152     LOG(Log::Printf(_L("CVpnUiLoader::ConstructL() - end\n")));
       
   153     }
       
   154 
       
   155 // ---------------------------------------------------------
       
   156 // CVpnUiLoader::FocusChanged(TDrawNow aDrawNow)
       
   157 // Added here because FocusChanged need to be included
       
   158 // in every control derived from CCoeControl that can have listbox 
       
   159 // ---------------------------------------------------------
       
   160 //
       
   161 void CVpnUiLoader::FocusChanged(TDrawNow aDrawNow)
       
   162 	{
       
   163 	if (iListBox) 
       
   164 		{
       
   165 		iListBox->SetFocus(IsFocused(), aDrawNow);
       
   166 		}
       
   167 	}
       
   168 
       
   169 // ---------------------------------------------------------
       
   170 // CVpnUiLoader::ChangeViewL(TInt aNewTab, TInt aSelectionIndex)
       
   171 // Called when the view tab is changed
       
   172 // ---------------------------------------------------------
       
   173 //
       
   174 void CVpnUiLoader::ChangeViewL(TInt aNewTab, TInt aSelectionIndex)
       
   175     {
       
   176     LOG_1("CVpnUiLoader::ChangeViewL():%d", aNewTab);
       
   177 	switch (aNewTab)
       
   178 		{
       
   179 
       
   180 		case KChangeViewPrevious:
       
   181             {
       
   182             TVwsViewId currentViewId;
       
   183             ((CAknViewAppUi*)iAvkonAppUi)->GetActiveViewId(currentViewId);
       
   184             
       
   185             if(iPreviousViewId == currentViewId.iViewUid)
       
   186                 {
       
   187                 ((CAknViewAppUi*)iAvkonAppUi)->RegisterViewL(*iVpnManagementUiView);
       
   188 				((CAknViewAppUi*)iAvkonAppUi)->ActivateLocalViewL( KVpnManagementPluginUid );
       
   189                 }
       
   190             else
       
   191                 {
       
   192                 ((CAknViewAppUi*)iAvkonAppUi)->RegisterViewL(*iVpnManagementUiView);
       
   193 				((CAknViewAppUi*)iAvkonAppUi)->ActivateLocalViewL( 
       
   194                 iPreviousViewId );
       
   195                 }
       
   196 			break;
       
   197             }
       
   198 		case KChangeViewBack:
       
   199       ((CAknViewAppUi*)iAvkonAppUi)->RemoveView(KVpnManagementUiPolicyViewId);
       
   200 			((CAknViewAppUi*)iAvkonAppUi)->RemoveView(KVpnManagementUiLogViewId);
       
   201 			((CAknViewAppUi*)iAvkonAppUi)->RemoveView(KVpnManagementUiParametersViewId);
       
   202 			((CAknViewAppUi*)iAvkonAppUi)->RemoveView(KVpnManagementUiServerViewId);
       
   203 			((CAknViewAppUi*)iAvkonAppUi)->ActivateLocalViewL( iGsViewId.iViewUid );
       
   204 			ReleaseResource(ETrue);
       
   205             if(iObserver)
       
   206                 {
       
   207                 iObserver->UiComplete(KUirEventNone);
       
   208                 }
       
   209 			break;
       
   210 
       
   211 		case KChangeViewPolicy: //Policy view
       
   212             {
       
   213             // the current view is saved so we 
       
   214             // know where to come back
       
   215             TVwsViewId localCurrentViewId;
       
   216 			((CAknViewAppUi*)iAvkonAppUi)->GetActiveViewId( 
       
   217                 localCurrentViewId );
       
   218 
       
   219 			iPreviousViewId = localCurrentViewId.iViewUid;
       
   220 			if ( iPolicyViewVisited == EFalse)
       
   221 			    ((CAknViewAppUi*)iAvkonAppUi)->AddViewL(iVpnManagementUiPolicyView);
       
   222 			iPolicyViewVisited=ETrue;
       
   223 			((CAknViewAppUi*)iAvkonAppUi)->ActivateLocalViewL(
       
   224                   KVpnManagementUiPolicyViewId );
       
   225 			break;
       
   226             }
       
   227 		case KChangeViewServer:  //Policy server view  
       
   228             {
       
   229             // the current view is saved so we 
       
   230             // know where to come back
       
   231             TVwsViewId localCurrentViewId;
       
   232 			((CAknViewAppUi*)iAvkonAppUi)->GetActiveViewId( 
       
   233                 localCurrentViewId );
       
   234 
       
   235 			iPreviousViewId = localCurrentViewId.iViewUid;
       
   236 
       
   237 			((CAknViewAppUi*)iAvkonAppUi)->AddViewL(iVpnManagementUiServerView);
       
   238 			((CAknViewAppUi*)iAvkonAppUi)->ActivateLocalViewL( 
       
   239                   KVpnManagementUiServerViewId ); 
       
   240 			break;
       
   241             }
       
   242         case KChangeViewLog: //Log view
       
   243             {
       
   244             // the current view is saved so we 
       
   245             // know where to come back
       
   246             TVwsViewId localCurrentViewId;
       
   247 			((CAknViewAppUi*)iAvkonAppUi)->GetActiveViewId( 
       
   248                 localCurrentViewId );
       
   249 
       
   250 			iPreviousViewId = localCurrentViewId.iViewUid;
       
   251 			if ( iLogViewVisited == EFalse)
       
   252 			    ((CAknViewAppUi*)iAvkonAppUi)->AddViewL(iVpnManagementUiLogView);
       
   253 			iLogViewVisited=ETrue;
       
   254 			((CAknViewAppUi*)iAvkonAppUi)->ActivateLocalViewL(
       
   255                   KVpnManagementUiLogViewId );
       
   256             break;
       
   257 			}
       
   258 
       
   259         case KChangeViewSettings: //VPN policy server parameters view
       
   260 			{
       
   261 			// the current view is saved so that close settings 
       
   262             // knows where to come back
       
   263 			TVwsViewId localCurrentViewId;
       
   264 			((CAknViewAppUi*)iAvkonAppUi)->GetActiveViewId( 
       
   265                 localCurrentViewId );
       
   266 
       
   267 			iPreviousViewId = localCurrentViewId.iViewUid;
       
   268             //Put selected server to CustomMessageId 
       
   269 			((CAknViewAppUi*)iAvkonAppUi)->AddViewL(iVpnManagementUiParametersView);
       
   270 			((CAknViewAppUi*)iAvkonAppUi)->ActivateLocalViewL(
       
   271                   KVpnManagementUiParametersViewId,
       
   272                 TUid::Uid( aSelectionIndex), KNullDesC8 );
       
   273 			break;
       
   274 			}
       
   275 
       
   276 		default:
       
   277 			break;	
       
   278 		}
       
   279     }
       
   280 
       
   281 // ----------------------------------------------------
       
   282 // CVpnUiLoader::ActivateTitleL(TInt aCurrentTitle)
       
   283 // Activates the VPN policies, VPN policy servers and
       
   284 // VPN log views title
       
   285 // ----------------------------------------------------
       
   286 //
       
   287 void CVpnUiLoader::ActivateTitleL(TInt aCurrentTitle)
       
   288     {
       
   289 	CEikStatusPane* sp = STATIC_CAST( 
       
   290         CAknAppUi*, iEikonEnv->EikAppUi())->StatusPane();
       
   291 	// Fetch pointer to the default title pane control
       
   292 	CAknTitlePane* title = STATIC_CAST( 
       
   293         CAknTitlePane*, sp->ControlL(TUid::Uid(EEikStatusPaneUidTitle)) );
       
   294 	TResourceReader reader;
       
   295 
       
   296     if ( aCurrentTitle == KViewTitleManagementView )
       
   297 	    {
       
   298 		iCoeEnv->CreateResourceReaderLC( reader, R_VPN_MANAGEMENT_TITLE );
       
   299 		}
       
   300 	if ( aCurrentTitle == KViewTitlePolicyView )
       
   301 		{
       
   302 		iCoeEnv->CreateResourceReaderLC( reader, R_VPN_POLICIES_TITLE );
       
   303 		}
       
   304     if ( aCurrentTitle == KViewTitleServerView )
       
   305 		{
       
   306 		iCoeEnv->CreateResourceReaderLC( reader, R_VPN_POLICY_SERVERS_TITLE );
       
   307 		}
       
   308     if ( aCurrentTitle == KViewTitleLogView )
       
   309 		{
       
   310 		iCoeEnv->CreateResourceReaderLC( reader, R_VPN_LOG_TITLE );
       
   311 		}
       
   312 
       
   313 	title->SetFromResourceL( reader );
       
   314 	CleanupStack::PopAndDestroy();  // reader
       
   315     }
       
   316 
       
   317 void CVpnUiLoader::ActivateTitleL(TInt aCurrentTitle, TDes& aText)
       
   318     {
       
   319 	CEikStatusPane* sp = STATIC_CAST( 
       
   320         CAknAppUi*, iEikonEnv->EikAppUi())->StatusPane();
       
   321 	// Fetch pointer to the default title pane control
       
   322 	CAknTitlePane* title = STATIC_CAST( 
       
   323         CAknTitlePane*, sp->ControlL(TUid::Uid(EEikStatusPaneUidTitle)) );
       
   324 
       
   325     if ( aCurrentTitle == KViewTitleParametersView )
       
   326         {
       
   327         title->SetTextL(aText);
       
   328         }
       
   329     }
       
   330 // ----------------------------------------------------
       
   331 // CVpnUiLoader::ActivateNaviTextL()
       
   332 // Activates the VPN log view Navipane text (Version information)
       
   333 // ----------------------------------------------------
       
   334 //
       
   335 void CVpnUiLoader::ActivateNaviTextL()
       
   336     {
       
   337   	// version information in navi pane text shown in VPN Log view
       
   338     //TBuf<KVersionLine> version(KVersion);
       
   339     HBufC* naviText = StringLoader::LoadLC( 
       
   340         R_VPN_NAVI_CLIENT_VERSION, KVersion/*version*/ );
       
   341     TPtr naviDes=naviText->Des();
       
   342     AknTextUtils::DisplayTextLanguageSpecificNumberConversion(naviDes);
       
   343     iVersionInfoInNaviPane = iNaviPane->CreateMessageLabelL(*naviText);
       
   344     CleanupStack::PopAndDestroy(); //naviText
       
   345     }
       
   346 
       
   347 // ---------------------------------------------------------
       
   348 // CVpnUiLoader::PushNaviPaneL
       
   349 // ---------------------------------------------------------
       
   350 //
       
   351 void CVpnUiLoader::PushNaviPaneL()
       
   352     {
       
   353     iNaviPane->PushL( *iVersionInfoInNaviPane );
       
   354     }
       
   355 
       
   356 // ---------------------------------------------------------
       
   357 // CVpnUiLoader::PopNaviPane
       
   358 // ---------------------------------------------------------
       
   359 //
       
   360 void CVpnUiLoader::PopNaviPane()
       
   361     {
       
   362     if(iVersionInfoInNaviPane)
       
   363         {
       
   364         delete iVersionInfoInNaviPane; //A control is popped from stack
       
   365         iVersionInfoInNaviPane = NULL;
       
   366         }
       
   367     }
       
   368 
       
   369 // ---------------------------------------------------------
       
   370 // CVpnUiLoader::PushDefaultNaviPaneL
       
   371 // ---------------------------------------------------------
       
   372 //
       
   373 void CVpnUiLoader::PushDefaultNaviPaneL()
       
   374     {
       
   375     iNaviPane->PushDefaultL();
       
   376     }
       
   377 
       
   378 // ---------------------------------------------------------
       
   379 // CVpnUiLoader::HandleControlEventL(
       
   380 //      CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
       
   381 // Cannot be changed to non-leaving function. 
       
   382 // L-function is required by the class definition, even if empty.
       
   383 // ---------------------------------------------------------
       
   384 //
       
   385 void CVpnUiLoader::HandleControlEventL(
       
   386     CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
       
   387     {
       
   388     }
       
   389 
       
   390 // ---------------------------------------------------------
       
   391 // CVpnUiLoader::OfferKeyEventL()
       
   392 // ---------------------------------------------------------
       
   393 //
       
   394 TKeyResponse CVpnUiLoader::OfferKeyEventL(
       
   395     const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/)
       
   396 	{
       
   397 	// Listbox takes all event even if it doesn't use them
       
   398 	return EKeyWasNotConsumed; 
       
   399 	}
       
   400 
       
   401 // ----------------------------------------------------------
       
   402 // AddResourceFileL()
       
   403 // ----------------------------------------------------------
       
   404 //
       
   405 void CVpnUiLoader::AddResourceFileL(TBool aKeepOpen)
       
   406 	{
       
   407 	if (!iKeepOpen)
       
   408 	    {
       
   409     	iKeepOpen = aKeepOpen;    
       
   410         _LIT(KResourceFile, "\\resource\\vpnmanagementuirsc.rsc");	
       
   411 	TFileName resourceFileName(KResourceFile);
       
   412     TFileName dllName;
       
   413     Dll::FileName(dllName);
       
   414     TBuf<2> drive = dllName.Left(2);
       
   415     resourceFileName.Insert(0, drive);
       
   416 
       
   417     // To enable loading of e.g. vpnmanagementuirsc.r**
       
   418     BaflUtils::NearestLanguageFile(iCoeEnv->FsSession(), resourceFileName);
       
   419 	iResourceLoader.OpenL(resourceFileName);
       
   420         LOG_("CVpnUiLoader::AddResourceFileL(");
       
   421 	    }
       
   422 	}
       
   423 // ----------------------------------------------------------
       
   424 // ReleaseResource()
       
   425 // ----------------------------------------------------------
       
   426 //
       
   427 void CVpnUiLoader::ReleaseResource(TBool aForceClose)
       
   428     {
       
   429     if(!iKeepOpen || aForceClose) 
       
   430         {
       
   431         LOG_("CVpnUiLoader::ReleaseResource()");
       
   432         iKeepOpen = EFalse;
       
   433         iResourceLoader.Close();
       
   434         }
       
   435     }	
       
   436 // ---------------------------------------------------------
       
   437 // CVpnUiLoader::DialogDismissedL
       
   438 // ---------------------------------------------------------
       
   439 //
       
   440 void CVpnUiLoader::DialogDismissedL( TInt /*aButtonId*/ )
       
   441     {
       
   442     // The UI is left in an inactive state if the progress dialog is cancelled
       
   443     // very quickly. Thus, we ensure that the UI ends up in an active
       
   444     // state by activating the view that should be active.
       
   445     TVwsViewId activeViewId;
       
   446     ((CAknViewAppUi*)iAvkonAppUi)->GetActiveViewId(activeViewId);
       
   447     ((CAknViewAppUi*)iAvkonAppUi)->ActivateLocalViewL(activeViewId.iViewUid);
       
   448     }
       
   449 
       
   450 // ---------------------------------------------------------
       
   451 // CVpnUiLoader::ShowWaitNoteL
       
   452 // ---------------------------------------------------------
       
   453 //
       
   454 void CVpnUiLoader::ShowWaitNoteL()
       
   455     {
       
   456     // Initialization (before the progress dialog is shown)
       
   457     iTextToShow = EConnectingVia; // "Connecting via '%U'"
       
   458     iWaitNoteStartTime.UniversalTime();
       
   459             
       
   460     if ( iWaitDialog )
       
   461         {
       
   462         delete iWaitDialog;
       
   463         iWaitDialog = NULL;
       
   464         }
       
   465     iWaitDialog = new ( ELeave ) CAknWaitDialog
       
   466                 ( REINTERPRET_CAST(CEikDialog**,&iWaitDialog),ETrue );
       
   467     iWaitDialog->PrepareLC( R_VPN_WAIT_NOTE );
       
   468     iWaitDialog->SetTone( CAknNoteDialog::ENoTone );
       
   469     iWaitDialog->SetCallback( this );
       
   470 
       
   471     SetTextL();
       
   472 
       
   473     iWaitDialog->RunLD();
       
   474     iWaitDialog->DrawNow();
       
   475     }
       
   476 
       
   477 void CVpnUiLoader::DeleteWaitNoteL()
       
   478     {
       
   479     TInt error;
       
   480     // Dismiss wait dialog
       
   481     TRAP(error, iWaitDialog->ProcessFinishedL()); // deletes the wait dialog
       
   482     if (error != KErrNone)
       
   483         {
       
   484         // on error destroy wait note by force.
       
   485         delete iWaitDialog;
       
   486         }
       
   487     iWaitDialog = NULL;
       
   488     }
       
   489 
       
   490 void CVpnUiLoader::SetTextL()
       
   491     {
       
   492 	LOG(Log::Printf(_L("CVpnUiLoader::SetTextL()\n")));
       
   493 
       
   494     TTime now;
       
   495     now.UniversalTime();
       
   496 
       
   497     TTimeIntervalSeconds secondsPassed;
       
   498     now.SecondsFrom(iWaitNoteStartTime, secondsPassed);
       
   499     
       
   500     if (secondsPassed.Int() < KSecondsToShowConnectingVia)
       
   501         {
       
   502         iTextToShow = EConnectingVia; //0
       
   503         }
       
   504     else
       
   505         {
       
   506         iTextToShow = EProcessingStepN; //1
       
   507         iStateCodeToShow = 0;
       
   508         }
       
   509     
       
   510     if (iTextToShow == EConnectingVia)
       
   511         {
       
   512         HBufC* string = StringLoader::LoadLC( R_VPN_CONNECTING_VIA_AP, iSelectionName );
       
   513         iWaitDialog->SetTextL( *string ); 
       
   514         CleanupStack::PopAndDestroy( string );
       
   515         }
       
   516     else
       
   517         {
       
   518         HBufC* string = StringLoader::LoadLC( R_VPN_WAIT_POLICY_DL_PROCESSING, iStateCodeToShow );
       
   519         iWaitDialog->SetTextL( *string ); 
       
   520         CleanupStack::PopAndDestroy( string );
       
   521         }
       
   522     }
       
   523 
       
   524 
       
   525 void CVpnUiLoader::GetSelectionNameL( TDes& aText )
       
   526     {
       
   527     TCmSettingSelection selection = TCmSettingSelection();
       
   528    
       
   529     //Reset update operation for Connecting via note
       
   530     iPolicyUpdate = EFalse;
       
   531 
       
   532     HBufC* name = NULL;
       
   533     TInt err = KErrNone;    
       
   534 	if ( selection.iResult ==  EDestination )
       
   535 		{
       
   536 		TRAP( err, (name = CServerSettingsContainer::GetDestinationNameL( selection.iId )));
       
   537 		}
       
   538 	else if ( selection.iResult == EConnectionMethod )
       
   539 		{
       
   540 		TRAP( err, (name = CServerSettingsContainer::GetConnectionMethodNameL( selection.iId )));
       
   541 		}
       
   542 	
       
   543 	if ( name )
       
   544 		{
       
   545 		aText.Copy(*name);
       
   546 		}	
       
   547 	delete name;
       
   548 	name = NULL;
       
   549     }
       
   550 
       
   551     
       
   552 // ---------------------------------------------------------
       
   553 // CVpnUiLoader::FFSSpaceBelowCriticalLevelL
       
   554 // ---------------------------------------------------------
       
   555 //
       
   556 TBool CVpnUiLoader::FFSSpaceBelowCriticalLevelL
       
   557         ( TBool aShowErrorNote, TInt aBytesToWrite /*=0*/ )
       
   558     {
       
   559     LOG_("CVpnUiLoader::FFSSpaceBelowCriticalLevelL() - begin");
       
   560 
       
   561     TBool ret( EFalse );
       
   562     if ( SysUtil::FFSSpaceBelowCriticalLevelL
       
   563                 ( &(CCoeEnv::Static()->FsSession()), aBytesToWrite ) )
       
   564         {
       
   565         ret = ETrue;
       
   566         if ( aShowErrorNote )
       
   567             {
       
   568             CErrorUI* errorUi = CErrorUI::NewLC( *(CCoeEnv::Static()) );
       
   569             errorUi->ShowGlobalErrorNoteL( KErrDiskFull );
       
   570             CleanupStack::PopAndDestroy();  // errorUi
       
   571             }
       
   572         }
       
   573     
       
   574     LOG( Log::Printf(_L("CVpnUiLoader::FFSSpaceBelowCriticalLevelL() - end\n")));
       
   575 
       
   576     return ret;
       
   577     }
       
   578     
       
   579 // ---------------------------------------------------------
       
   580 // CVpnUiLoader::GetVpnManagementUiView()
       
   581 // 
       
   582 // ---------------------------------------------------------
       
   583 //
       
   584 CAknView* CVpnUiLoader::GetVpnManagementUiView() const
       
   585     {
       
   586 	return iVpnManagementUiView;
       
   587     }
       
   588 
       
   589 // ---------------------------------------------------------
       
   590 // CVpnUiLoader::VpnApiWrapperL()
       
   591 // ---------------------------------------------------------
       
   592 //
       
   593 CVpnApiWrapper& CVpnUiLoader::VpnApiWrapperL()
       
   594     {
       
   595     LOG_("CVpnUiLoader::VpnApiWrapperL()");
       
   596     if (!iVpnApiWrapper)
       
   597         iVpnApiWrapper = CVpnApiWrapper::NewL();
       
   598     return *iVpnApiWrapper;
       
   599     }
       
   600     
       
   601 // ---------------------------------------------------------
       
   602 // CVpnUiLoader::GsViewId()
       
   603 // Called when the view tab is changed
       
   604 // ---------------------------------------------------------
       
   605 //
       
   606 TVwsViewId CVpnUiLoader::GSViewId() const
       
   607     {
       
   608     return iGsViewId;
       
   609     }
       
   610 
       
   611 // ---------------------------------------------------------
       
   612 // CVpnUiLoader::SetGsViewId( TVwsViewId )
       
   613 // Called when the view tab is changed
       
   614 // ---------------------------------------------------------
       
   615 //
       
   616 void CVpnUiLoader::SetGSViewId( TVwsViewId aGsViewUid )
       
   617     {
       
   618     iGsViewId = aGsViewUid;
       
   619     }
       
   620     
       
   621 // End of File