216 { |
216 { |
217 menuBar = enabledView->MenuBar(); |
217 menuBar = enabledView->MenuBar(); |
218 } |
218 } |
219 switch( aKeyEvent.iCode ) |
219 switch( aKeyEvent.iCode ) |
220 { |
220 { |
|
221 case EKeyEnter: // FALLTHROUH |
|
222 case EKeyOK: |
|
223 { |
|
224 if ( ( menuBar != NULL ) && menuBar->ItemSpecificCommandsEnabled() ) |
|
225 { |
|
226 iAppUi->ProcessCommandL( EFileManagerSelectionKey ); |
|
227 response = EKeyWasConsumed; |
|
228 } |
|
229 break; |
|
230 } |
221 case EKeyDelete: // FALLTHROUGH |
231 case EKeyDelete: // FALLTHROUGH |
222 case EKeyBackspace: |
232 case EKeyBackspace: |
223 { |
233 { |
224 TBool allowDelete ( ETrue ); |
234 if ( ( menuBar != NULL ) && menuBar->ItemSpecificCommandsEnabled() ) |
225 |
|
226 // If there are some items marked, |
|
227 // delete will be executed on the marked items. |
|
228 if ( ListBoxSelectionIndexesCount() <= 0 ) |
|
229 { |
|
230 // If no item is marked, |
|
231 // first check whether there is any highlighted item. |
|
232 if ( menuBar && menuBar->ItemSpecificCommandsEnabled() ) |
|
233 { |
|
234 TInt index = SearchFieldToListIndex( ListBoxCurrentItemIndex() ); |
|
235 // Do not allow deleting folder while marking mode is activated. |
|
236 if ( IsMarkingModeActivated() && |
|
237 iDocument->Engine().IsFolder( index ) ) |
|
238 { |
|
239 allowDelete = EFalse; |
|
240 } |
|
241 } |
|
242 else |
|
243 { |
|
244 // Do not allow deleting any item without highlight if no item is marked |
|
245 allowDelete = EFalse; |
|
246 } |
|
247 } |
|
248 |
|
249 if ( allowDelete ) |
|
250 { |
235 { |
251 iAppUi->ProcessCommandL( EFileManagerDelete ); |
236 iAppUi->ProcessCommandL( EFileManagerDelete ); |
252 // Marking mode is exited automatically only when command has |
|
253 // been selected from the options menu or stylus popup menu. |
|
254 // Therefore, deactivate marking mode manually in case exiting marking |
|
255 // mode is required after a key event is processed. |
|
256 |
|
257 if ( IsMarkingModeActivated() && ExitMarkingMode() ) |
|
258 { |
|
259 SetMarkingMode( EFalse ); |
|
260 } |
|
261 response = EKeyWasConsumed; |
237 response = EKeyWasConsumed; |
262 } |
238 } |
263 break; |
239 break; |
264 } |
240 } |
265 case EKeyLeftArrow: // FALLTHROUGH |
241 case EKeyLeftArrow: // FALLTHROUGH |
335 // Inform user about OOM, suppress other errors |
311 // Inform user about OOM, suppress other errors |
336 TInt err( iDocument->LastError() ); |
312 TInt err( iDocument->LastError() ); |
337 if ( err == KErrNoMemory ) |
313 if ( err == KErrNoMemory ) |
338 { |
314 { |
339 ControlEnv()->HandleError( KErrNoMemory ); |
315 ControlEnv()->HandleError( KErrNoMemory ); |
|
316 } |
|
317 } |
|
318 |
|
319 // ----------------------------------------------------------------------------- |
|
320 // CFileManagerFileListContainer::HandleControlEventL |
|
321 // From MCoeControlObserver, called by current listbox |
|
322 // ----------------------------------------------------------------------------- |
|
323 // |
|
324 void CFileManagerFileListContainer::HandleControlEventL( |
|
325 CCoeControl* /* aControl*/, TCoeEvent aEventType ) |
|
326 { |
|
327 if ( aEventType == EEventStateChanged ) |
|
328 { |
|
329 iAppUi->ProcessCommandL( EFileManagerCheckMark ); // Inform change |
340 } |
330 } |
341 } |
331 } |
342 |
332 |
343 //----------------------------------------------------------------------------- |
333 //----------------------------------------------------------------------------- |
344 // CFileManagerFileListContainer::CItemDrawer::CItemDrawer |
334 // CFileManagerFileListContainer::CItemDrawer::CItemDrawer |
816 { |
806 { |
817 return EKeyWasNotConsumed; |
807 return EKeyWasNotConsumed; |
818 } |
808 } |
819 // Open search field on alpha digit |
809 // Open search field on alpha digit |
820 TBool isVisible( iSearchField->IsVisible() ); |
810 TBool isVisible( iSearchField->IsVisible() ); |
821 // Do not allow activate find pane while marking model is already |
|
822 // activated |
|
823 if ( !isVisible && |
811 if ( !isVisible && |
824 aType == EEventKeyDown && |
812 aType == EEventKeyDown && |
825 aKeyEvent.iScanCode != 0 && |
813 aKeyEvent.iScanCode ) |
826 !IsMarkingModeActivated() ) |
|
827 { |
814 { |
828 TChar ch( aKeyEvent.iScanCode ); |
815 TChar ch( aKeyEvent.iScanCode ); |
829 if ( ch.IsAlphaDigit() ) |
816 if ( ch.IsAlphaDigit() ) |
830 { |
817 { |
831 EnableSearchFieldL( ETrue ); |
818 EnableSearchFieldL( ETrue ); |