qtinternetradio/ui/src/irsonghistoryview.cpp
changeset 14 896e9dbc5f19
parent 12 608f67c22514
child 15 065198191975
equal deleted inserted replaced
12:608f67c22514 14:896e9dbc5f19
   129  *               issue a listen request to isds client
   129  *               issue a listen request to isds client
   130  * Parameters  : aItem : pointer to the clicked item.
   130  * Parameters  : aItem : pointer to the clicked item.
   131  */
   131  */
   132 void IRSongHistoryView::handleItemSelected()
   132 void IRSongHistoryView::handleItemSelected()
   133 {     
   133 {     
       
   134 #ifdef STATISTIC_REPORT_TEST_ENABLED
       
   135     // TODO : have to save preset id related to the song
       
   136     iStatisticsReporter->logNmsEvent(IRQStatisticsReporter::EIRNmsFind,0);  
       
   137     popupNote("Find in Music Store ...", HbMessageBox::MessageTypeInformation);
       
   138 #else
   134     int index = iListView->currentIndex().row();
   139     int index = iListView->currentIndex().row();
   135     IRQSongInfo *hisInfo = iModel->getSongHistoryInfo(index); 
   140     IRQSongInfo *hisInfo = iModel->getSongHistoryInfo(index); 
       
   141 
       
   142     if( hisInfo && ( 0 != hisInfo->getMusicshopStatus().compare("yes",Qt::CaseInsensitive) ) )
       
   143     {
       
   144 #ifdef SUBTITLE_STR_BY_LOCID
       
   145         popupNote(hbTrId("txt_irad_info_not_allowed_by_this_station"), HbMessageBox::MessageTypeInformation);
       
   146 #else
       
   147         popupNote(hbTrId("Not allowed by station"), HbMessageBox::MessageTypeInformation);        
       
   148 #endif
       
   149         return;
       
   150     }
   136     
   151     
   137     if( (NULL == hisInfo) ||    
   152     if( (NULL == hisInfo) ||    
   138         ( hisInfo->getSongName().isEmpty() &&  
   153         ( hisInfo->getSongName().isEmpty() &&  
   139           hisInfo->getArtistName().isEmpty()
   154           hisInfo->getArtistName().isEmpty()
   140         )
   155         )
   141       )
   156       )
   142     {
   157     {
       
   158 #ifdef SUBTITLE_STR_BY_LOCID
   143         popupNote(hbTrId("txt_irad_info_no_song_info"), HbMessageBox::MessageTypeInformation);
   159         popupNote(hbTrId("txt_irad_info_no_song_info"), HbMessageBox::MessageTypeInformation);
       
   160 #else
       
   161         popupNote(hbTrId("No song info"), HbMessageBox::MessageTypeInformation);        
       
   162 #endif  
   144         return;
   163         return;
   145     }
   164     }
   146 
   165 
   147     // TODO : Add the report in future. Add the channel id in the song info db
   166     // TODO : Add the report in future. Add the channel id in the song info db
   148     // iStatisticsReporter->logNmsEvents(EIRQFind,channelId);
   167     // iStatisticsReporter->logNmsEvents(EIRQFind,channelId);
   149 #ifdef SUBTITLE_STR_BY_LOCID
   168 #ifdef SUBTITLE_STR_BY_LOCID
   150     popupNote(hbTrId("txt_irad_info_music_store_not_available"), HbMessageBox::MessageTypeInformation);
   169     popupNote(hbTrId("txt_irad_info_music_store_not_available"), HbMessageBox::MessageTypeInformation);
   151 #else
   170 #else
   152     popupNote(hbTrId("Music store not available"), HbMessageBox::MessageTypeInformation);    
   171     popupNote(hbTrId("Music store not ready"), HbMessageBox::MessageTypeInformation);    
   153 #endif
   172 #endif // SUBTITLE_STR_BY_LOCID
       
   173 #endif // STATISTIC_REPORT_TEST_ENABLED
   154 }
   174 }
   155    
   175    
   156 
   176 
   157 // ---------------------------------------------------------------------------
   177 // ---------------------------------------------------------------------------
   158 // IRSongHistoryView::showSongHistory()
   178 // IRSongHistoryView::showSongHistory()
   202 }
   222 }
   203 
   223 
   204 void IRSongHistoryView::popupClearHistoryConfirmMessageBox()
   224 void IRSongHistoryView::popupClearHistoryConfirmMessageBox()
   205 {
   225 {
   206 #ifdef SUBTITLE_STR_BY_LOCID
   226 #ifdef SUBTITLE_STR_BY_LOCID
   207     HbMessageBox::question(hbTrId("txt_irad_info_clear_song_list"), this, SLOT(clearList(HbAction*)), hbTrId("txt_common_button_ok"), hbTrId("txt_common_button_cancel"));
   227     HbMessageBox::question(hbTrId("txt_irad_info_clear_song_list"), this, SLOT(clearList(HbAction*)), HbMessageBox::Ok | HbMessageBox::Cancel);
   208 #else
   228 #else
   209     HbMessageBox::question(hbTrId("Clear song list?"), this, SLOT(clearList(HbAction*)), hbTrId("Ok"), hbTrId("Cancel"));    
   229     HbMessageBox::question(hbTrId("Clear song list?"), this, SLOT(clearList(HbAction*)), HbMessageBox::Ok | HbMessageBox::Cancel);    
   210 #endif
   230 #endif
   211 }
   231 }
   212 void IRSongHistoryView::clearList(HbAction *aAction)
   232 void IRSongHistoryView::clearList(HbAction *aAction)
   213 {
   233 {
   214     HbMessageBox *dialog = static_cast<HbMessageBox*>(sender());
   234     HbMessageBox *dialog = static_cast<HbMessageBox*>(sender());
   263     contextMenu->open();
   283     contextMenu->open();
   264 }
   284 }
   265 
   285 
   266 void IRSongHistoryView::searchInMusicStoreContextAction()
   286 void IRSongHistoryView::searchInMusicStoreContextAction()
   267 {
   287 {
   268     // Need to log the find song in NMS event, iStatisticsReporter->logNmsEvent(IRQStatisticsReporter::EIRFind,channelId);  
   288     handleItemSelected();
   269 #ifdef SUBTITLE_STR_BY_LOCID
       
   270     popupNote(hbTrId("txt_irad_info_music_store_not_available"), HbMessageBox::MessageTypeInformation);
       
   271 #else
       
   272     popupNote(hbTrId("Music store not available"), HbMessageBox::MessageTypeInformation);    
       
   273 #endif
       
   274 }
   289 }
   275 void IRSongHistoryView::deleteContextAction()
   290 void IRSongHistoryView::deleteContextAction()
   276 {
   291 {
   277     int current = iListView->currentIndex().row();     
   292     int current = iListView->currentIndex().row();     
   278     bool ret = iModel->deleteOneItem(current);     
   293     bool ret = iModel->deleteOneItem(current);