82 |
82 |
83 void CCommandParser::QueryDialogClosedL(TBool aPositiveAction, TInt aUserData) |
83 void CCommandParser::QueryDialogClosedL(TBool aPositiveAction, TInt aUserData) |
84 { |
84 { |
85 User::LeaveIfNull(iSearchArray); |
85 User::LeaveIfNull(iSearchArray); |
86 |
86 |
87 if( aUserData == EGetingScript && aPositiveAction && iSearchArray->Count() ) |
87 if( aUserData == EGetingScript ) |
88 { |
88 { |
89 iObserver->FileChosenL( ETrue, iSearchArray->MdcaPoint(iSelectedItem) ); |
89 if(aPositiveAction) |
|
90 { |
|
91 iObserver->ScriptChosenL( ETrue, iSearchArray->MdcaPoint(iSelectedItem) ); |
|
92 } |
|
93 else |
|
94 { |
|
95 iObserver->ScriptChosenL( EFalse ); |
|
96 } |
90 } |
97 } |
91 else if( aUserData == EGetingRandomDataFile && aPositiveAction && iSearchArray->Count() ) |
98 else if( aUserData == EGetingRandomDataFile && aPositiveAction && iSearchArray->Count() ) |
92 { |
99 { |
93 TFileName fileName; |
100 if(aPositiveAction) |
94 if (iSelectedItem == (iSearchArray->Count() - 1)) |
101 { |
|
102 TFileName fileName; |
|
103 if (iSelectedItem == (iSearchArray->Count() - 1)) |
95 { |
104 { |
96 // "default" (resource file) selected |
105 // "default" (resource file) selected |
97 fileName.Copy(KNullDesC); |
106 fileName.Copy(KNullDesC); |
98 } |
107 } |
99 else |
108 else |
100 { |
109 { |
101 // xml file selected |
110 // xml file selected |
102 fileName.Copy(iSearchArray->MdcaPoint(iSelectedItem)); |
111 fileName.Copy(iSearchArray->MdcaPoint(iSelectedItem)); |
103 } |
112 } |
104 iObserver->FileChosenL( ETrue, fileName ); |
113 iObserver->RandomDataFileChosenL( ETrue, fileName ); |
105 } |
114 } |
106 else |
115 else |
107 { |
116 { |
108 iObserver->FileChosenL( EFalse ); |
117 iObserver->RandomDataFileChosenL( EFalse ); |
109 } |
118 } |
110 delete iSearchArray; |
119 } |
111 iSearchArray = NULL; |
|
112 iObserver = NULL; |
|
113 } |
120 } |
114 |
121 |
115 // --------------------------------------------------------------------------- |
122 // --------------------------------------------------------------------------- |
116 //#if(!defined __SERIES60_30__ && !defined __SERIES60_31__) |
123 //#if(!defined __SERIES60_30__ && !defined __SERIES60_31__) |
117 void CCommandParser::OpenScriptL() {} |
124 void CCommandParser::OpenScriptL() {} |
464 } |
476 } |
465 |
477 |
466 // add "default" (resource file) to list |
478 // add "default" (resource file) to list |
467 fileNameArray->AppendL(_L("Default")); |
479 fileNameArray->AppendL(_L("Default")); |
468 |
480 |
469 ret = iEngine->GetEngineWrapper()->PopupListDialog(_L("Select random data file"), fileNameArray, &iSelectedItem, this); |
481 ret = iEngine->GetEngineWrapper()->PopupListDialog(_L("Select random data file"), fileNameArray, &iSelectedItem, this, EGetingRandomDataFile); |
470 CleanupStack::PopAndDestroy(fileNameArray); |
482 CleanupStack::PopAndDestroy(fileNameArray); |
471 } |
483 } |
472 else // no random data files found from the search paths |
484 else // no random data files found from the search paths |
473 { |
485 { |
474 iEngine->GetEngineWrapper()->ShowNote(_L("No random data files found")); |
486 iEngine->GetEngineWrapper()->ShowNote(_L("No random data files found")); |