|
1 /* |
|
2 * Copyright (c) 2006-2007 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: Dialog utilities |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include <avkon.rsg> |
|
22 #include <StringLoader.h> |
|
23 #include <aknradiobuttonsettingpage.h> |
|
24 #include <akncheckboxsettingpage.h> |
|
25 #include <aknmfnesettingpage.h> |
|
26 #include <aknmessagequerydialog.h> |
|
27 #include <aknnotewrappers.h> |
|
28 #include <FileManagerView.rsg> |
|
29 #include <CFileManagerEngine.h> |
|
30 #include "FileManagerDlgUtils.h" |
|
31 #include "CFileManagerMMCInfoPopup.h" |
|
32 #include "CFileManagerCheckBoxSettingPage.h" |
|
33 #include "CFileManagerFileNameQueryDlg.h" |
|
34 #include "Cfilemanagerfoldernamequerydlg.h" |
|
35 #include "CFileManagerInfoPopup.h" |
|
36 |
|
37 |
|
38 // ======== MEMBER FUNCTIONS ======== |
|
39 |
|
40 // ---------------------------------------------------------------------------- |
|
41 // FileManagerDlgUtils::ShowOOfMSettingQueryL |
|
42 // ---------------------------------------------------------------------------- |
|
43 // |
|
44 EXPORT_C TBool FileManagerDlgUtils::ShowOOfMSettingQueryL( |
|
45 const TInt aTitleId, |
|
46 const MDesCArray* aTextArray, |
|
47 TInt& aSelectedIndex ) |
|
48 { |
|
49 TInt index( aSelectedIndex ); |
|
50 TBool ret( EFalse ); |
|
51 HBufC* title = StringLoader::LoadLC( aTitleId ); |
|
52 CAknRadioButtonSettingPage* dlg = |
|
53 new ( ELeave )CAknRadioButtonSettingPage( |
|
54 R_FILEMANAGER_SETTING_RADIOBUTTON_PAGE, index, aTextArray ); |
|
55 CleanupStack::PushL( dlg ); |
|
56 dlg->SetSettingTextL( *title ); |
|
57 CleanupStack::Pop( dlg ); |
|
58 if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) |
|
59 { |
|
60 // Get new selected item and inform change |
|
61 if ( index != aSelectedIndex ) |
|
62 { |
|
63 aSelectedIndex = index; |
|
64 ret = ETrue; |
|
65 } |
|
66 } |
|
67 CleanupStack::PopAndDestroy( title ); |
|
68 return ret; |
|
69 } |
|
70 |
|
71 // ---------------------------------------------------------------------------- |
|
72 // FileManagerDlgUtils::ShowOOfMSettingQueryL |
|
73 // ---------------------------------------------------------------------------- |
|
74 // |
|
75 EXPORT_C TBool FileManagerDlgUtils::ShowOOfMSettingQueryL( |
|
76 const TInt aTitleId, |
|
77 const TInt aTextIds, |
|
78 TInt& aSelectedIndex ) |
|
79 { |
|
80 CDesCArray* texts = CCoeEnv::Static()->ReadDesCArrayResourceL( aTextIds ); |
|
81 CleanupStack::PushL( texts ); |
|
82 TBool ret( ShowOOfMSettingQueryL( aTitleId, texts, aSelectedIndex ) ); |
|
83 CleanupStack::PopAndDestroy( texts ); |
|
84 return ret; |
|
85 } |
|
86 |
|
87 // ---------------------------------------------------------------------------- |
|
88 // FileManagerDlgUtils::ShowWeekdayQueryL |
|
89 // ---------------------------------------------------------------------------- |
|
90 // |
|
91 EXPORT_C TBool FileManagerDlgUtils::ShowWeekdayQueryL( |
|
92 const TInt aTitleId, |
|
93 TDay& aDay ) |
|
94 { |
|
95 const TInt KDaysPerWeek = 7; |
|
96 TLocale locale; |
|
97 TDay startingDay( locale.StartOfWeek() ); |
|
98 CDesCArray* texts = new ( ELeave ) CDesCArrayFlat( KDaysPerWeek ); |
|
99 CleanupStack::PushL( texts ); |
|
100 TInt j( startingDay % KDaysPerWeek ); |
|
101 TDayName dayName; |
|
102 for ( TInt i( 0 ); i < KDaysPerWeek; i++ ) |
|
103 { |
|
104 dayName.Set( static_cast< TDay >( j ) ); |
|
105 texts->AppendL( dayName ); |
|
106 j = ( j + 1 ) % KDaysPerWeek; |
|
107 } |
|
108 TInt index( 0 ); |
|
109 if ( aDay >= startingDay ) |
|
110 { |
|
111 index = aDay - startingDay; |
|
112 } |
|
113 else |
|
114 { |
|
115 index = KDaysPerWeek - startingDay + aDay; |
|
116 } |
|
117 TBool ret( ShowOOfMSettingQueryL( aTitleId, texts, index ) ); |
|
118 if ( ret ) |
|
119 { |
|
120 aDay = static_cast< TDay >( ( startingDay + index ) % KDaysPerWeek ); |
|
121 } |
|
122 CleanupStack::PopAndDestroy( texts ); |
|
123 return ret; |
|
124 } |
|
125 |
|
126 // ---------------------------------------------------------------------------- |
|
127 // FileManagerDlgUtils::ShowNOfMSettingQueryL |
|
128 // ---------------------------------------------------------------------------- |
|
129 // |
|
130 EXPORT_C TBool FileManagerDlgUtils::ShowNOfMSettingQueryL( |
|
131 const TInt aTitleId, |
|
132 const TInt aTextIds, |
|
133 TUint32& aSelection, |
|
134 const TInt aDominantIndex ) |
|
135 { |
|
136 TBool ret( EFalse ); |
|
137 |
|
138 // Get title and text array |
|
139 HBufC* title = StringLoader::LoadLC( aTitleId ); |
|
140 CDesCArray* texts = CCoeEnv::Static()->ReadDesCArrayResourceL( aTextIds ); |
|
141 CleanupStack::PushL( texts ); |
|
142 |
|
143 // Create selection array |
|
144 TInt count( texts->MdcaCount() ); |
|
145 CSelectionItemList* items = |
|
146 new ( ELeave ) CSelectionItemList( count ); |
|
147 CleanupStack::PushL( items ); |
|
148 for ( TInt i( 0 ); i < count; i++ ) |
|
149 { |
|
150 TBool check( EFalse ); |
|
151 if ( aSelection & ( 1 << i ) ) |
|
152 { |
|
153 check = ETrue; |
|
154 } |
|
155 TPtrC ptr( texts->MdcaPoint( i ) ); |
|
156 CSelectableItem* selectionItem = new ( ELeave ) CSelectableItem( |
|
157 ptr, check ); |
|
158 CleanupStack::PushL( selectionItem ); |
|
159 selectionItem->ConstructL(); |
|
160 items->AppendL( selectionItem ); |
|
161 CleanupStack::Pop( selectionItem ); |
|
162 } |
|
163 |
|
164 // Create multiselection list |
|
165 CFileManagerCheckBoxSettingPage* dlg = |
|
166 new ( ELeave ) CFileManagerCheckBoxSettingPage( |
|
167 R_FILEMANAGER_SETTING_CHECKBOX_PAGE, *items, aDominantIndex ); |
|
168 CleanupStack::PushL( dlg ); |
|
169 dlg->SetSettingTextL( *title ); |
|
170 CleanupStack::Pop( dlg ); |
|
171 if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) |
|
172 { |
|
173 // Get new selection and inform changes |
|
174 TUint32 selection( 0 ); |
|
175 for ( TInt i( 0 ); i < count; i++ ) |
|
176 { |
|
177 if ( items->At( i )->SelectionStatus() ) |
|
178 { |
|
179 selection |= 1 << i; |
|
180 } |
|
181 } |
|
182 if ( selection != aSelection ) |
|
183 { |
|
184 aSelection = selection; |
|
185 ret = ETrue; |
|
186 } |
|
187 } |
|
188 items->ResetAndDestroy(); |
|
189 CleanupStack::PopAndDestroy( items ); |
|
190 CleanupStack::PopAndDestroy( texts ); |
|
191 CleanupStack::PopAndDestroy( title ); |
|
192 return ret; |
|
193 } |
|
194 |
|
195 // ---------------------------------------------------------------------------- |
|
196 // FileManagerDlgUtils::ShowTimeSettingQueryL |
|
197 // ---------------------------------------------------------------------------- |
|
198 // |
|
199 EXPORT_C TBool FileManagerDlgUtils::ShowTimeSettingQueryL( |
|
200 const TInt aTitleId, TTime& aTime ) |
|
201 { |
|
202 TTime time( aTime ); |
|
203 TBool ret( EFalse ); |
|
204 HBufC* title = StringLoader::LoadLC( aTitleId ); |
|
205 CAknTimeSettingPage* dlg = |
|
206 new (ELeave) CAknTimeSettingPage( |
|
207 R_FILEMANAGER_TIME_SETTING_PAGE, |
|
208 time); |
|
209 CleanupStack::PushL( dlg ); |
|
210 dlg->SetSettingTextL( *title ); |
|
211 CleanupStack::Pop( dlg ); |
|
212 if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenAccepted ) ) |
|
213 { |
|
214 // Get new time and inform change |
|
215 if ( time != aTime ) |
|
216 { |
|
217 aTime = time; |
|
218 ret = ETrue; |
|
219 } |
|
220 } |
|
221 CleanupStack::PopAndDestroy( title ); |
|
222 return ret; |
|
223 } |
|
224 |
|
225 // ---------------------------------------------------------------------------- |
|
226 // FileManagerDlgUtils::ShowInfoQueryL |
|
227 // ---------------------------------------------------------------------------- |
|
228 // |
|
229 EXPORT_C void FileManagerDlgUtils::ShowInfoQueryL( |
|
230 const TDesC& aText ) |
|
231 { |
|
232 CAknMessageQueryDialog* dlg = |
|
233 CAknMessageQueryDialog::NewL( const_cast< TDesC& >( aText ) ); |
|
234 dlg->ExecuteLD( R_FILEMANAGER_INFO_QUERY ); |
|
235 } |
|
236 |
|
237 // ---------------------------------------------------------------------------- |
|
238 // FileManagerDlgUtils::ShowInfoQueryL |
|
239 // ---------------------------------------------------------------------------- |
|
240 // |
|
241 EXPORT_C void FileManagerDlgUtils::ShowInfoQueryL( |
|
242 const TInt aTextId, const TDesC& aValue ) |
|
243 { |
|
244 HBufC* text = NULL; |
|
245 if ( aValue.Length() ) |
|
246 { |
|
247 text = StringLoader::LoadLC( aTextId, aValue ); |
|
248 } |
|
249 else |
|
250 { |
|
251 text = StringLoader::LoadLC( aTextId ); |
|
252 } |
|
253 ShowInfoQueryL( *text ); |
|
254 CleanupStack::PopAndDestroy( text ); |
|
255 } |
|
256 |
|
257 // ---------------------------------------------------------------------------- |
|
258 // FileManagerDlgUtils::ShowInfoQueryL |
|
259 // ---------------------------------------------------------------------------- |
|
260 // |
|
261 EXPORT_C void FileManagerDlgUtils::ShowInfoQueryL( |
|
262 const TInt aTextId, const TInt aValue ) |
|
263 { |
|
264 HBufC* text = StringLoader::LoadLC( aTextId, aValue ); |
|
265 ShowInfoQueryL( *text ); |
|
266 CleanupStack::PopAndDestroy( text ); |
|
267 } |
|
268 |
|
269 // ---------------------------------------------------------------------------- |
|
270 // FileManagerDlgUtils::ShowErrorNoteL |
|
271 // ---------------------------------------------------------------------------- |
|
272 // |
|
273 EXPORT_C void FileManagerDlgUtils::ShowErrorNoteL( |
|
274 const TInt aTextId, const TDesC& aValue ) |
|
275 { |
|
276 HBufC* text = NULL; |
|
277 if ( aValue.Length() ) |
|
278 { |
|
279 text = StringLoader::LoadLC( aTextId, aValue ); |
|
280 } |
|
281 else |
|
282 { |
|
283 text = StringLoader::LoadLC( aTextId ); |
|
284 } |
|
285 ShowErrorNoteL( *text ); |
|
286 CleanupStack::PopAndDestroy( text ); |
|
287 } |
|
288 |
|
289 // ---------------------------------------------------------------------------- |
|
290 // FileManagerDlgUtils::ShowConfirmNoteL |
|
291 // ---------------------------------------------------------------------------- |
|
292 // |
|
293 EXPORT_C void FileManagerDlgUtils::ShowConfirmNoteL( |
|
294 const TInt aTextId ) |
|
295 { |
|
296 HBufC* text = StringLoader::LoadLC( aTextId ); |
|
297 CAknConfirmationNote* confirmNote = |
|
298 new( ELeave ) CAknConfirmationNote( ETrue ); |
|
299 confirmNote->ExecuteLD( *text ); |
|
300 CleanupStack::PopAndDestroy( text ); |
|
301 } |
|
302 |
|
303 // ---------------------------------------------------------------------------- |
|
304 // FileManagerDlgUtils::ShowWarningNoteL |
|
305 // ---------------------------------------------------------------------------- |
|
306 // |
|
307 EXPORT_C void FileManagerDlgUtils::ShowWarningNoteL( |
|
308 const TInt aTextId ) |
|
309 { |
|
310 HBufC* text = StringLoader::LoadLC( aTextId ); |
|
311 CAknWarningNote* warningNote = |
|
312 new( ELeave ) CAknWarningNote( ETrue ); |
|
313 warningNote->ExecuteLD( *text ); |
|
314 CleanupStack::PopAndDestroy( text ); |
|
315 } |
|
316 |
|
317 // ---------------------------------------------------------------------------- |
|
318 // FileManagerDlgUtils::ShowConfirmQueryWithYesNoL |
|
319 // ---------------------------------------------------------------------------- |
|
320 // |
|
321 EXPORT_C TBool FileManagerDlgUtils::ShowConfirmQueryWithYesNoL( |
|
322 const TInt aTextId, const TDesC& aValue ) |
|
323 { |
|
324 HBufC* text = NULL; |
|
325 if ( aValue.Length() ) |
|
326 { |
|
327 text = StringLoader::LoadLC( aTextId, aValue ); |
|
328 } |
|
329 else |
|
330 { |
|
331 text = StringLoader::LoadLC( aTextId ); |
|
332 } |
|
333 |
|
334 TBool ret( ShowConfirmQueryWithYesNoL( *text ) ); |
|
335 CleanupStack::PopAndDestroy( text ); |
|
336 return ret; |
|
337 } |
|
338 |
|
339 // ---------------------------------------------------------------------------- |
|
340 // FileManagerDlgUtils::ShowConfirmQueryWithYesNoL |
|
341 // ---------------------------------------------------------------------------- |
|
342 // |
|
343 EXPORT_C TBool FileManagerDlgUtils::ShowConfirmQueryWithYesNoL( |
|
344 const TDesC& aText ) |
|
345 { |
|
346 TBool ret( EFalse ); |
|
347 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
348 if ( dlg->ExecuteLD( R_FILEMANAGER_CONFIRM_QUERY_WITH_YES_NO, aText ) ) |
|
349 { |
|
350 ret = ETrue; |
|
351 } |
|
352 return ret; |
|
353 } |
|
354 |
|
355 // ---------------------------------------------------------------------------- |
|
356 // FileManagerDlgUtils::ShowConfirmQueryWithOkL |
|
357 // ---------------------------------------------------------------------------- |
|
358 // |
|
359 EXPORT_C void FileManagerDlgUtils::ShowConfirmQueryWithOkL( |
|
360 const TIcons aIcons, |
|
361 const TInt aTextId, |
|
362 const TDesC& aValue ) |
|
363 { |
|
364 HBufC* text = NULL; |
|
365 if ( aValue.Length() ) |
|
366 { |
|
367 text = StringLoader::LoadLC( aTextId, aValue ); |
|
368 } |
|
369 else |
|
370 { |
|
371 text = StringLoader::LoadLC( aTextId ); |
|
372 } |
|
373 ShowConfirmQueryWithOkL( aIcons, *text ); |
|
374 CleanupStack::PopAndDestroy( text ); |
|
375 } |
|
376 |
|
377 // ---------------------------------------------------------------------------- |
|
378 // FileManagerDlgUtils::ShowConfirmQueryWithOkL |
|
379 // ---------------------------------------------------------------------------- |
|
380 // |
|
381 EXPORT_C void FileManagerDlgUtils::ShowConfirmQueryWithOkL( |
|
382 const TIcons aIcons, |
|
383 const TInt aTextId, |
|
384 const TInt aValue ) |
|
385 { |
|
386 HBufC* text = StringLoader::LoadLC( aTextId, aValue ); |
|
387 ShowConfirmQueryWithOkL( aIcons, *text ); |
|
388 CleanupStack::PopAndDestroy( text ); |
|
389 } |
|
390 |
|
391 // ---------------------------------------------------------------------------- |
|
392 // FileManagerDlgUtils::ShowConfirmQueryWithOkL |
|
393 // ---------------------------------------------------------------------------- |
|
394 // |
|
395 EXPORT_C void FileManagerDlgUtils::ShowConfirmQueryWithOkL( |
|
396 const TIcons aIcons, |
|
397 const TDesC& aText ) |
|
398 { |
|
399 TInt resId( 0 ); |
|
400 switch ( aIcons ) |
|
401 { |
|
402 case EInfoIcons: |
|
403 { |
|
404 resId = R_FILEMANAGER_INFO_CONFIRM_QUERY_WITH_OK; |
|
405 break; |
|
406 } |
|
407 case EErrorIcons: |
|
408 { |
|
409 resId = R_FILEMANAGER_ERROR_CONFIRM_QUERY_WITH_OK; |
|
410 break; |
|
411 } |
|
412 default: |
|
413 { |
|
414 break; |
|
415 } |
|
416 } |
|
417 if ( resId ) |
|
418 { |
|
419 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
420 dlg->ExecuteLD( resId, aText ); |
|
421 } |
|
422 } |
|
423 |
|
424 // ---------------------------------------------------------------------------- |
|
425 // FileManagerDlgUtils::ShowConfirmQueryWithOkCancelL |
|
426 // ---------------------------------------------------------------------------- |
|
427 // |
|
428 EXPORT_C TBool FileManagerDlgUtils::ShowConfirmQueryWithOkCancelL( |
|
429 const TDesC& aText ) |
|
430 { |
|
431 TBool ret( EFalse ); |
|
432 CAknQueryDialog* dlg = CAknQueryDialog::NewL(); |
|
433 if ( dlg->ExecuteLD( |
|
434 R_FILEMANAGER_CONFIRM_QUERY_WITH_OK_CANCEL, aText ) ) |
|
435 { |
|
436 ret = ETrue; |
|
437 } |
|
438 return ret; |
|
439 } |
|
440 |
|
441 // ---------------------------------------------------------------------------- |
|
442 // FileManagerDlgUtils::ShowConfirmQueryWithOkCancelL |
|
443 // ---------------------------------------------------------------------------- |
|
444 // |
|
445 EXPORT_C TBool FileManagerDlgUtils::ShowConfirmQueryWithOkCancelL( |
|
446 const TInt aTextId, |
|
447 const TDesC& aValue ) |
|
448 { |
|
449 HBufC* text = NULL; |
|
450 if ( aValue.Length() ) |
|
451 { |
|
452 text = StringLoader::LoadLC( aTextId, aValue ); |
|
453 } |
|
454 else |
|
455 { |
|
456 text = StringLoader::LoadLC( aTextId ); |
|
457 } |
|
458 TBool ret( ShowConfirmQueryWithOkCancelL( *text ) ); |
|
459 CleanupStack::PopAndDestroy( text ); |
|
460 return ret; |
|
461 } |
|
462 |
|
463 // ---------------------------------------------------------------------------- |
|
464 // FileManagerDlgUtils::ShowInfoNoteL |
|
465 // ---------------------------------------------------------------------------- |
|
466 // |
|
467 EXPORT_C void FileManagerDlgUtils::ShowInfoNoteL( |
|
468 const TDesC& aText ) |
|
469 { |
|
470 CAknInformationNote* dlg = new(ELeave) CAknInformationNote( ETrue ); |
|
471 dlg->ExecuteLD( aText ); |
|
472 } |
|
473 |
|
474 // ---------------------------------------------------------------------------- |
|
475 // FileManagerDlgUtils::ShowInfoNoteL |
|
476 // ---------------------------------------------------------------------------- |
|
477 // |
|
478 EXPORT_C void FileManagerDlgUtils::ShowInfoNoteL( |
|
479 const TInt aTextId, const TDesC& aValue ) |
|
480 { |
|
481 HBufC* text = NULL; |
|
482 if( aValue.Length() ) |
|
483 { |
|
484 text = StringLoader::LoadLC( aTextId, aValue ); |
|
485 } |
|
486 else |
|
487 { |
|
488 text = StringLoader::LoadLC( aTextId ); |
|
489 } |
|
490 ShowInfoNoteL( *text ); |
|
491 CleanupStack::PopAndDestroy( text ); |
|
492 } |
|
493 |
|
494 // ---------------------------------------------------------------------------- |
|
495 // FileManagerDlgUtils::ShowInfoNoteL |
|
496 // ---------------------------------------------------------------------------- |
|
497 // |
|
498 EXPORT_C void FileManagerDlgUtils::ShowInfoNoteL( |
|
499 const TInt aTextId, const TInt aValue ) |
|
500 { |
|
501 HBufC* text = StringLoader::LoadLC( aTextId, aValue ); |
|
502 ShowInfoNoteL( *text ); |
|
503 CleanupStack::PopAndDestroy( text ); |
|
504 } |
|
505 |
|
506 // ---------------------------------------------------------------------------- |
|
507 // FileManagerDlgUtils::ShowSimplePasswordQueryL |
|
508 // ---------------------------------------------------------------------------- |
|
509 // |
|
510 EXPORT_C TBool FileManagerDlgUtils::ShowSimplePasswordQueryL( |
|
511 const TInt aTitleId, |
|
512 TDes& aPwd ) |
|
513 { |
|
514 TBool ret( EFalse ); |
|
515 HBufC* title = StringLoader::LoadLC( aTitleId ); |
|
516 ret = ShowSimplePasswordQueryL( *title, aPwd ); |
|
517 CleanupStack::PopAndDestroy( title ); |
|
518 return ret; |
|
519 } |
|
520 |
|
521 // ---------------------------------------------------------------------------- |
|
522 // FileManagerDlgUtils::ShowPasswordQueryL |
|
523 // ---------------------------------------------------------------------------- |
|
524 // |
|
525 EXPORT_C TBool FileManagerDlgUtils::ShowPasswordQueryL( |
|
526 TDes& aPwd ) |
|
527 { |
|
528 HBufC* confirm = HBufC::NewLC( aPwd.MaxLength() ); |
|
529 TPtr ptrConfirm( confirm->Des() ); |
|
530 TBool ret( EFalse ); |
|
531 // Execute dialog again and again until cancelled or passwords match |
|
532 TBool isDone( EFalse ); |
|
533 while( !isDone ) |
|
534 { |
|
535 aPwd.FillZ( aPwd.MaxLength() ); |
|
536 aPwd.Zero(); |
|
537 ptrConfirm.FillZ( ptrConfirm.MaxLength() ); |
|
538 ptrConfirm.Zero(); |
|
539 |
|
540 CAknMultiLineDataQueryDialog* dlg = |
|
541 CAknMultiLineDataQueryDialog::NewL( |
|
542 aPwd, ptrConfirm ); |
|
543 if ( dlg->ExecuteLD( R_FILEMANAGER_PASSWORD_QUERY ) ) |
|
544 { |
|
545 // Check if the words match |
|
546 if ( aPwd.Compare( ptrConfirm ) ) |
|
547 { |
|
548 FileManagerDlgUtils::ShowErrorNoteL( |
|
549 R_QTN_PASSWORDS_DONT_MATCH_TEXT ); |
|
550 } |
|
551 else |
|
552 { |
|
553 ret = ETrue; |
|
554 isDone = ETrue; |
|
555 } |
|
556 } |
|
557 else |
|
558 { |
|
559 isDone = ETrue; |
|
560 } |
|
561 } |
|
562 CleanupStack::PopAndDestroy( confirm ); |
|
563 return ret; |
|
564 } |
|
565 |
|
566 // ---------------------------------------------------------------------------- |
|
567 // FileManagerDlgUtils::ShowMemoryStoreInfoPopupL |
|
568 // ---------------------------------------------------------------------------- |
|
569 // |
|
570 EXPORT_C void FileManagerDlgUtils::ShowMemoryStoreInfoPopupL( |
|
571 const TFileManagerDriveInfo& aInfo |
|
572 ) |
|
573 { |
|
574 CFileManagerMMCInfoPopup* popup = CFileManagerMMCInfoPopup::NewL( |
|
575 aInfo ); |
|
576 popup->ExecuteLD(); |
|
577 } |
|
578 |
|
579 // ---------------------------------------------------------------------------- |
|
580 // FileManagerDlgUtils::ShowFileNameQueryL |
|
581 // ---------------------------------------------------------------------------- |
|
582 // |
|
583 EXPORT_C TBool FileManagerDlgUtils::ShowFileNameQueryL( |
|
584 const TInt aTitleId, |
|
585 const TDesC& aOldName, |
|
586 TDes& aNewName, |
|
587 CFileManagerEngine& aEngine ) |
|
588 { |
|
589 TBool ret( EFalse ); |
|
590 HBufC* title = StringLoader::LoadLC( aTitleId ); |
|
591 CFileManagerFileNameQueryDlg* dlg = |
|
592 CFileManagerFileNameQueryDlg::NewL( |
|
593 aOldName, aNewName, aEngine ); |
|
594 if ( dlg->ExecuteLD( R_FILEMANAGER_FILE_NAME_QUERY, *title ) ) |
|
595 { |
|
596 ret = ETrue; |
|
597 } |
|
598 CleanupStack::PopAndDestroy( title ); |
|
599 return ret; |
|
600 } |
|
601 |
|
602 // ---------------------------------------------------------------------------- |
|
603 // FileManagerDlgUtils::ShowFolderNameQueryL |
|
604 // ---------------------------------------------------------------------------- |
|
605 // |
|
606 EXPORT_C TBool FileManagerDlgUtils::ShowFolderNameQueryL( |
|
607 const TInt aTitleId, |
|
608 TDes& aName, |
|
609 CFileManagerEngine& aEngine, |
|
610 const TBool aNameGeneration ) |
|
611 { |
|
612 TBool ret( EFalse ); |
|
613 HBufC* title = StringLoader::LoadLC( aTitleId ); |
|
614 CFileManagerFolderNameQueryDlg* dlg = |
|
615 CFileManagerFolderNameQueryDlg::NewL( |
|
616 aName, aEngine, aNameGeneration ); |
|
617 if ( dlg->ExecuteLD( R_FILEMANAGER_FILE_NAME_QUERY, *title ) ) |
|
618 { |
|
619 ret = ETrue; |
|
620 } |
|
621 CleanupStack::PopAndDestroy( title ); |
|
622 return ret; |
|
623 } |
|
624 |
|
625 // ---------------------------------------------------------------------------- |
|
626 // FileManagerDlgUtils::ShowItemInfoPopupL( |
|
627 // ---------------------------------------------------------------------------- |
|
628 // |
|
629 EXPORT_C void FileManagerDlgUtils::ShowItemInfoPopupL( |
|
630 CFileManagerItemProperties& aProperties, |
|
631 const CFileManagerFeatureManager& aFeatureManager ) |
|
632 { |
|
633 CFileManagerInfoPopup* popup = CFileManagerInfoPopup::NewL( |
|
634 aProperties, aFeatureManager ); |
|
635 popup->ExecuteLD(); |
|
636 } |
|
637 |
|
638 // ---------------------------------------------------------------------------- |
|
639 // FileManagerDlgUtils::ShowSimplePasswordQueryL |
|
640 // ---------------------------------------------------------------------------- |
|
641 // |
|
642 EXPORT_C TBool FileManagerDlgUtils::ShowSimplePasswordQueryL( |
|
643 const TDesC& aText, TDes& aPwd ) |
|
644 { |
|
645 TBool ret( EFalse ); |
|
646 CAknTextQueryDialog* dlg = |
|
647 CAknTextQueryDialog::NewL( aPwd, CAknQueryDialog::ENoTone ); |
|
648 if ( dlg->ExecuteLD( R_FILEMANAGER_SIMPLE_PASSWORD_QUERY, aText ) ) |
|
649 { |
|
650 ret = ETrue; |
|
651 } |
|
652 return ret; |
|
653 } |
|
654 |
|
655 // ---------------------------------------------------------------------------- |
|
656 // FileManagerDlgUtils::ShowErrorNoteL |
|
657 // ---------------------------------------------------------------------------- |
|
658 // |
|
659 EXPORT_C void FileManagerDlgUtils::ShowErrorNoteL( const TDesC& aText ) |
|
660 { |
|
661 CAknErrorNote* dlg = new( ELeave ) CAknErrorNote( ETrue ); |
|
662 dlg->ExecuteLD( aText ); |
|
663 } |
|
664 |
|
665 // End of File |