19 #include <HbListView> |
19 #include <HbListView> |
20 #include <HbAction> |
20 #include <HbAction> |
21 #include <HbAbstractViewItem> |
21 #include <HbAbstractViewItem> |
22 #include <HbMenu> |
22 #include <HbMenu> |
23 #include <HbMessageBox> |
23 #include <HbMessageBox> |
|
24 #include <HbSelectionDialog> |
24 |
25 |
25 // User includes |
26 // User includes |
26 #include "radiohistoryview.h" |
27 #include "radiohistoryview.h" |
27 #include "radiowindow.h" |
28 #include "radiowindow.h" |
28 #include "radiologger.h" |
29 #include "radiologger.h" |
29 #include "radiouiloader.h" |
30 #include "radiouiloader.h" |
30 #include "radiouiengine.h" |
31 #include "radiouiengine.h" |
31 #include "radiohistorymodel.h" |
32 #include "radiohistorymodel.h" |
32 #include "radiohistoryitem.h" |
33 #include "radiohistoryitem.h" |
|
34 #include "radioutil.h" |
33 |
35 |
34 // BEGIN TEMPORARY TEST CODE CODE |
36 // BEGIN TEMPORARY TEST CODE CODE |
35 #include <QTimer> |
37 #include <QTimer> |
36 #include "radiostationmodel.h" |
38 #include "radiostationmodel.h" |
37 |
39 |
268 mHistoryList->setItemPixmapCacheEnabled( true ); // Improves scrolling FPS rate |
270 mHistoryList->setItemPixmapCacheEnabled( true ); // Improves scrolling FPS rate |
269 |
271 |
270 mAllSongsButton = mUiLoader->findObject<HbAction>( DOCML::HV_NAME_ALL_SONGS_BUTTON ); |
272 mAllSongsButton = mUiLoader->findObject<HbAction>( DOCML::HV_NAME_ALL_SONGS_BUTTON ); |
271 mTaggedSongsButton = mUiLoader->findObject<HbAction>( DOCML::HV_NAME_TAGGED_SONGS_BUTTON ); |
273 mTaggedSongsButton = mUiLoader->findObject<HbAction>( DOCML::HV_NAME_TAGGED_SONGS_BUTTON ); |
272 |
274 |
273 if ( HbAction* clearListAction = mUiLoader->findObject<HbAction>( DOCML::HV_NAME_CLEAR_LIST_ACTION ) ) { |
275 if ( HbAction* multiDelAction = mUiLoader->findObject<HbAction>( DOCML::HV_NAME_MULTI_DELETE_ACTION ) ) { |
274 Radio::connect( clearListAction, SIGNAL(triggered()), |
276 Radio::connect( multiDelAction, SIGNAL(triggered()), |
275 this, SLOT(clearList()) ); |
277 this, SLOT(openMultiSelection()) ); |
276 } |
278 } |
277 |
279 |
278 Radio::connect( mTaggedSongsButton, SIGNAL(triggered()), |
280 Radio::connect( mTaggedSongsButton, SIGNAL(triggered()), |
279 this, SLOT(updateViewMode()) ); |
281 this, SLOT(updateViewMode()) ); |
280 Radio::connect( mAllSongsButton, SIGNAL(triggered()), |
282 Radio::connect( mAllSongsButton, SIGNAL(triggered()), |
319 * \reimp |
321 * \reimp |
320 * |
322 * |
321 */ |
323 */ |
322 void RadioHistoryView::userAccepted() |
324 void RadioHistoryView::userAccepted() |
323 { |
325 { |
324 const bool removeTagged = mTaggedSongsButton->isChecked(); |
326 HbSelectionDialog* dlg = static_cast<HbSelectionDialog*>( sender() ); |
325 mUiEngine->historyModel().removeAll( removeTagged ); |
327 if(dlg) { |
326 updateVisibilities(); |
328 bool favoriteMode = mTaggedSongsButton->isChecked(); |
|
329 QModelIndexList selected = dlg->selectedModelIndexes(); |
|
330 int count = selected.count(); |
|
331 if( count == mUiEngine->historyModel().rowCount() ) { |
|
332 mUiEngine->historyModel().removeAll( favoriteMode ); |
|
333 } else { |
|
334 mUiEngine->historyModel().removeByModelIndices( selected, favoriteMode ); |
|
335 } |
|
336 QString msg = hbTrId("txt_rad_dpophead_l1_song_information_removed", count ); |
|
337 RadioUtil::showDiscreetNote( msg ); |
|
338 updateVisibilities(); |
|
339 } |
327 } |
340 } |
328 |
341 |
329 /*! |
342 /*! |
330 * |
343 * |
331 */ |
344 */ |