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