52 const QString KNew = QString( "New" ); |
52 const QString KNew = QString( "New" ); |
53 const QString KOpen = QString( "Open" ); |
53 const QString KOpen = QString( "Open" ); |
54 const QString KAdd = QString( "Add" ); |
54 const QString KAdd = QString( "Add" ); |
55 const QString KDelete = QString( "Delete" ); |
55 const QString KDelete = QString( "Delete" ); |
56 const QString KRenamePlayList = QString( "RenamePlayList" ); |
56 const QString KRenamePlayList = QString( "RenamePlayList" ); |
|
57 const QString KDetails = QString( "Details" ); |
57 |
58 |
58 |
59 |
59 //------------------------------------------------------------------ |
60 //------------------------------------------------------------------ |
60 // MpPopupHandlerPermanentData |
61 // MpPopupHandlerPermanentData |
61 //------------------------------------------------------------------ |
62 //------------------------------------------------------------------ |
195 action->setObjectName( KAdd ); |
196 action->setObjectName( KAdd ); |
196 action->setEnabled( !usbBlocked ); |
197 action->setEnabled( !usbBlocked ); |
197 action = contextMenu->addAction( hbTrId( "txt_common_menu_delete" ) ); |
198 action = contextMenu->addAction( hbTrId( "txt_common_menu_delete" ) ); |
198 action->setObjectName( KDelete ); |
199 action->setObjectName( KDelete ); |
199 action->setEnabled( !usbBlocked ); |
200 action->setEnabled( !usbBlocked ); |
|
201 action = contextMenu->addAction( hbTrId( "txt_mus_menu_view_details" ) ); |
|
202 action->setObjectName( KDetails ); |
200 break; |
203 break; |
201 case ECollectionContextAlbums: |
204 case ECollectionContextAlbums: |
202 case ECollectionContextArtists: |
205 case ECollectionContextArtists: |
203 case ECollectionContextArtistAlbums: |
206 case ECollectionContextArtistAlbums: |
204 contextMenu = new HbMenu(); |
207 contextMenu = new HbMenu(); |
210 action = contextMenu->addAction( hbTrId( "txt_common_menu_delete" ) ); |
213 action = contextMenu->addAction( hbTrId( "txt_common_menu_delete" ) ); |
211 action->setObjectName( KDelete ); |
214 action->setObjectName( KDelete ); |
212 action->setEnabled( !usbBlocked ); |
215 action->setEnabled( !usbBlocked ); |
213 break; |
216 break; |
214 case ECollectionContextPlaylists: |
217 case ECollectionContextPlaylists: |
|
218 contextMenu = new HbMenu(); |
|
219 action = contextMenu->addAction( hbTrId( "txt_common_menu_open" ) ); |
|
220 action->setObjectName( KOpen ); |
215 if ( !mMpEngine->collectionData()->isAutoPlaylist( index ) ) { |
221 if ( !mMpEngine->collectionData()->isAutoPlaylist( index ) ) { |
216 contextMenu = new HbMenu(); |
|
217 action = contextMenu->addAction( hbTrId( "txt_common_menu_open" ) ); |
|
218 action->setObjectName( KOpen ); |
|
219 action = contextMenu->addAction( hbTrId( "txt_common_menu_delete" ) ); |
222 action = contextMenu->addAction( hbTrId( "txt_common_menu_delete" ) ); |
220 action->setObjectName(KDelete); |
223 action->setObjectName(KDelete); |
221 action->setEnabled( !usbBlocked ); |
224 action->setEnabled( !usbBlocked ); |
222 action = contextMenu->addAction( hbTrId( "txt_common_menu_rename_item" ) ); |
225 action = contextMenu->addAction( hbTrId( "txt_common_menu_rename_item" ) ); |
223 action->setObjectName( KRenamePlayList ); |
226 action->setObjectName( KRenamePlayList ); |
224 action->setEnabled( !usbBlocked ); |
227 action->setEnabled( !usbBlocked ); |
225 } |
228 } |
226 break; |
229 break; |
227 case ECollectionContextPlaylistSongs: |
230 case ECollectionContextPlaylistSongs: |
|
231 contextMenu = new HbMenu(); |
|
232 action = contextMenu->addAction( hbTrId( "txt_common_menu_play_music" ) ); |
|
233 action->setObjectName( KOpen ); |
228 if ( !mMpEngine->collectionData()->isAutoPlaylist() ) { |
234 if ( !mMpEngine->collectionData()->isAutoPlaylist() ) { |
229 contextMenu = new HbMenu(); |
|
230 action = contextMenu->addAction( hbTrId( "txt_common_menu_play_music" ) ); |
|
231 action->setObjectName( KOpen ); |
|
232 action = contextMenu->addAction( hbTrId( "txt_common_menu_remove" ) ); |
235 action = contextMenu->addAction( hbTrId( "txt_common_menu_remove" ) ); |
233 action->setObjectName( KDelete ); |
236 action->setObjectName( KDelete ); |
234 action->setEnabled( !usbBlocked ); |
237 action->setEnabled( !usbBlocked ); |
235 } |
238 } |
|
239 action = contextMenu->addAction( hbTrId( "txt_mus_menu_view_details" ) ); |
|
240 action->setObjectName( KDetails ); |
236 break; |
241 break; |
237 default: |
242 default: |
238 break; |
243 break; |
239 } |
244 } |
240 |
245 |
446 else if ( objectName == KRenamePlayList ) { |
451 else if ( objectName == KRenamePlayList ) { |
447 QString currentName; |
452 QString currentName; |
448 currentName = mMpEngine->collectionData()->itemData( |
453 currentName = mMpEngine->collectionData()->itemData( |
449 mPermanentData->mContextMenuIndex, MpMpxCollectionData::Title ); |
454 mPermanentData->mContextMenuIndex, MpMpxCollectionData::Title ); |
450 openRenamePlaylistItemDialog( currentName ); |
455 openRenamePlaylistItemDialog( currentName ); |
|
456 } |
|
457 else if ( objectName == KDetails ) { |
|
458 mView->showItemDetails( mPermanentData->mContextMenuIndex ); |
451 } |
459 } |
452 } |
460 } |
453 TX_EXIT |
461 TX_EXIT |
454 } |
462 } |
455 |
463 |