qtinternetradio/ui/src/ircategoryview.cpp
changeset 12 608f67c22514
parent 11 f683e24efca3
child 14 896e9dbc5f19
equal deleted inserted replaced
11:f683e24efca3 12:608f67c22514
    92                 }
    92                 }
    93             }
    93             }
    94         }
    94         }
    95         break;
    95         break;
    96 
    96 
       
    97         case EIR_ViewCommand_ACTIVATED:
       
    98             if (EIRViewPara_Genre == getViewParameter())
       
    99             {
       
   100                 getViewManager()->saveScreenShot();
       
   101             }
       
   102             break;
       
   103             
    97         default:
   104         default:
    98             break;
   105             break;
    99     }
   106     }
   100     
   107     
   101     return ret;
   108     return ret;
   102 }
   109 }
   103 
   110 
   104 void IRCategoryView::launchAction()
   111 void IRCategoryView::launchAction()
   105 {    
   112 {    
   106     bool ret = false;
   113     Q_ASSERT(EIRViewPara_Genre == iViewParameter);
   107     switch(iViewParameter)
   114     bool ret = iIsdsClient->isdsIsCategoryCached(IRQIsdsClient::EGenre);
   108     {
   115 
   109         case EIRViewPara_Genre:
       
   110             ret = iIsdsClient->isdsIsCategoryCached(IRQIsdsClient::EGenre);
       
   111             break;
       
   112         case EIRViewPara_Language:
       
   113             ret = iIsdsClient->isdsIsCategoryCached(IRQIsdsClient::ELanguages);
       
   114             break;
       
   115         case EIRViewPara_Country:
       
   116             ret = iIsdsClient->isdsIsCategoryCached(IRQIsdsClient::ECountries);
       
   117             break;
       
   118 
       
   119         default:
       
   120             break;
       
   121     }
       
   122     
       
   123     if ( !ret )
   116     if ( !ret )
   124     {
   117     {
   125         setUseNetworkReason(EIR_UseNetwork_StartingView);
   118         setUseNetworkReason(EIR_UseNetwork_StartingView);
   126         iApplication->verifyNetworkConnectivity();
   119         iApplication->verifyNetworkConnectivity();
   127     }   
   120     }   
   171         setFlag(EViewFlag_ClearStackWhenActivate|EViewFlag_StickyViewEnabled);
   164         setFlag(EViewFlag_ClearStackWhenActivate|EViewFlag_StickyViewEnabled);
   172         iIsdsClient->isdsCategoryRequest(IRQIsdsClient::EGenre, cache);
   165         iIsdsClient->isdsCategoryRequest(IRQIsdsClient::EGenre, cache);
   173         break;
   166         break;
   174         
   167         
   175     case IRQIsdsClient::ELanguages : 
   168     case IRQIsdsClient::ELanguages : 
       
   169 #ifdef SUBTITLE_STR_BY_LOCID
   176         setHeadingText(hbTrId("txt_irad_list_stations_by_language"));
   170         setHeadingText(hbTrId("txt_irad_list_stations_by_language"));
       
   171 #else
       
   172         setHeadingText(hbTrId("Stations by language"));        
       
   173 #endif
   177         if (EIRViewPara_Language != getViewParameter())
   174         if (EIRViewPara_Language != getViewParameter())
   178         {
   175         {
   179             //the view is used for other categories other than Language
   176             //the view is used for other categories other than Language
   180             resetCurrentItem();
   177             resetCurrentItem();
   181         }
   178         }
   184         clearFlag(EViewFlag_StickyViewEnabled);
   181         clearFlag(EViewFlag_StickyViewEnabled);
   185         iIsdsClient->isdsCategoryRequest(IRQIsdsClient::ELanguages, cache);
   182         iIsdsClient->isdsCategoryRequest(IRQIsdsClient::ELanguages, cache);
   186         break;
   183         break;
   187         
   184         
   188     case IRQIsdsClient::ECountries :
   185     case IRQIsdsClient::ECountries :
       
   186 #ifdef SUBTITLE_STR_BY_LOCID
   189         setHeadingText(hbTrId("txt_irad_list_stations_by_country_region"));
   187         setHeadingText(hbTrId("txt_irad_list_stations_by_country_region"));
       
   188 #else
       
   189         setHeadingText(hbTrId("Stations by country/region"));        
       
   190 #endif
   190         if (EIRViewPara_Country != getViewParameter())
   191         if (EIRViewPara_Country != getViewParameter())
   191         {
   192         {
   192             //the view is used for other categories other than Country
   193             //the view is used for other categories other than Country
   193             resetCurrentItem();
   194             resetCurrentItem();
   194         }
   195         }
   388     Q_UNUSED(aError);
   389     Q_UNUSED(aError);
   389     iApplication->stopLoadingAnimation();
   390     iApplication->stopLoadingAnimation();
   390 
   391 
   391     disconnectIsdsClient();
   392     disconnectIsdsClient();
   392     
   393     
       
   394 #ifdef SUBTITLE_STR_BY_LOCID
   393     popupNote(hbTrId("txt_irad_info_failed_to_connect"), HbMessageBox::MessageTypeWarning);
   395     popupNote(hbTrId("txt_irad_info_failed_to_connect"), HbMessageBox::MessageTypeWarning);
       
   396 #else
       
   397     popupNote(hbTrId("Connecting failed"), HbMessageBox::MessageTypeWarning);
       
   398 #endif
   394     
   399     
   395     //if category view is starting view and failed to get data from ISDS server, back to main view
   400     //if category view is starting view and failed to get data from ISDS server, back to main view
   396     if (getViewManager()->currentView() == this &&
   401     if (getViewManager()->currentView() == this &&
   397         iListView->model()->rowCount() == 0)
   402         iListView->model()->rowCount() == 0)
   398     {
   403     {