qtinternetradio/ui/src/irsettingsview.cpp
changeset 12 608f67c22514
parent 11 f683e24efca3
child 15 065198191975
equal deleted inserted replaced
11:f683e24efca3 12:608f67c22514
    46 {
    46 {
    47     QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical, this);
    47     QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical, this);
    48     setLayout(layout);
    48     setLayout(layout);
    49 
    49 
    50     HbGroupBox * titleText = new HbGroupBox();
    50     HbGroupBox * titleText = new HbGroupBox();
    51     titleText->setHeading( hbTrId("txt_common_opt_settings") ); 
    51 #ifdef SUBTITLE_STR_BY_LOCID
       
    52     titleText->setHeading( hbTrId("txt_common_opt_settings") );
       
    53 #else
       
    54     titleText->setHeading( hbTrId("Settings") );    
       
    55 #endif
    52     layout->addItem(titleText);
    56     layout->addItem(titleText);
    53 
    57 
    54     iForm = new HbDataForm();
    58     iForm = new HbDataForm();
    55     layout->addItem(iForm);
    59     layout->addItem(iForm);
    56 
    60 
    60     //set the preferred quality
    64     //set the preferred quality
    61     setPreferredQuality();
    65     setPreferredQuality();
    62     iForm->setModel(iModel);
    66     iForm->setModel(iModel);
    63     
    67     
    64     HbMenu *viewMenu = menu();
    68     HbMenu *viewMenu = menu();
    65     viewMenu->addAction(hbTrId("txt_common_opt_exit"),iApplication, SIGNAL(quit()));    
    69 #ifdef SUBTITLE_STR_BY_LOCID
       
    70     viewMenu->addAction(hbTrId("txt_common_opt_exit"),iApplication, SIGNAL(quit()));
       
    71 #else
       
    72     viewMenu->addAction(hbTrId("Exit"),iApplication, SIGNAL(quit()));    
       
    73 #endif
    66 }
    74 }
    67 
    75 
    68 void IRSettingsView::setPreferredQuality()
    76 void IRSettingsView::setPreferredQuality()
    69 {
    77 {
       
    78 #ifdef SUBTITLE_STR_BY_LOCID
    70     HbDataFormModelItem *preferredQualityItem = new HbDataFormModelItem(
    79     HbDataFormModelItem *preferredQualityItem = new HbDataFormModelItem(
    71             HbDataFormModelItem::ToggleValueItem, hbTrId("txt_irad_setlabel_download_quality"));
    80             HbDataFormModelItem::ToggleValueItem, hbTrId("txt_irad_setlabel_download_quality"));
       
    81 #else
       
    82     HbDataFormModelItem *preferredQualityItem = new HbDataFormModelItem(
       
    83             HbDataFormModelItem::ToggleValueItem, hbTrId("Download quality"));    
       
    84 #endif
    72     iModel->appendDataFormItem(preferredQualityItem);
    85     iModel->appendDataFormItem(preferredQualityItem);
    73 
    86 
    74     IRQPreferredQuality settingValue = iSettings->getPreferredQuality();
    87     IRQPreferredQuality settingValue = iSettings->getPreferredQuality();
    75     if(EIRQStandardQuality == settingValue)
    88     if(EIRQStandardQuality == settingValue)
    76     {
    89     {
       
    90 #ifdef SUBTITLE_STR_BY_LOCID
    77         preferredQualityItem->setContentWidgetData("text", hbTrId("txt_irad_setlabel_download_quality_val_standard"));
    91         preferredQualityItem->setContentWidgetData("text", hbTrId("txt_irad_setlabel_download_quality_val_standard"));
    78         preferredQualityItem->setContentWidgetData("additionalText", hbTrId("txt_irad_setlabel_download_quality_val_high"));
    92         preferredQualityItem->setContentWidgetData("additionalText", hbTrId("txt_irad_setlabel_download_quality_val_high"));
       
    93 #else
       
    94         preferredQualityItem->setContentWidgetData("text", hbTrId("Standard"));
       
    95         preferredQualityItem->setContentWidgetData("additionalText", hbTrId("High"));        
       
    96 #endif
    79     }
    97     }
    80     else if(EIRQHighQuality == settingValue)
    98     else if(EIRQHighQuality == settingValue)
    81     {
    99     {
       
   100 #ifdef SUBTITLE_STR_BY_LOCID
    82         preferredQualityItem->setContentWidgetData("text", hbTrId("txt_irad_setlabel_download_quality_val_high"));
   101         preferredQualityItem->setContentWidgetData("text", hbTrId("txt_irad_setlabel_download_quality_val_high"));
    83         preferredQualityItem->setContentWidgetData("additionalText", hbTrId("txt_irad_setlabel_download_quality_val_standard"));    
   102         preferredQualityItem->setContentWidgetData("additionalText", hbTrId("txt_irad_setlabel_download_quality_val_standard"));
       
   103 #else
       
   104         preferredQualityItem->setContentWidgetData("text", hbTrId("High"));
       
   105         preferredQualityItem->setContentWidgetData("additionalText", hbTrId("Standard"));        
       
   106 #endif
    84     }
   107     }
    85     
   108     
    86     connect(iModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), 
   109     connect(iModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), 
    87         this, SLOT(toggleChange(QModelIndex, QModelIndex)));
   110         this, SLOT(toggleChange(QModelIndex, QModelIndex)));
    88 }
   111 }
    93 
   116 
    94     HbDataFormModelItem *item = iModel->itemFromIndex(aStartIn);
   117     HbDataFormModelItem *item = iModel->itemFromIndex(aStartIn);
    95     
   118     
    96     if(item->type() == HbDataFormModelItem::ToggleValueItem) 
   119     if(item->type() == HbDataFormModelItem::ToggleValueItem) 
    97     {
   120     {
    98         if(item->data(HbDataFormModelItem::LabelRole).toString() == hbTrId("txt_irad_setlabel_download_quality")) 
   121 #ifdef SUBTITLE_STR_BY_LOCID
       
   122         if(item->data(HbDataFormModelItem::LabelRole).toString() == hbTrId("txt_irad_setlabel_download_quality"))
       
   123 #else
       
   124         if(item->data(HbDataFormModelItem::LabelRole).toString() == hbTrId("Download quality"))            
       
   125 #endif
    99         {
   126         {
   100             QVariant data = item->contentWidgetData("text");
   127             QVariant data = item->contentWidgetData("text");
   101             QString value = data.toString();
   128             QString value = data.toString();
   102             
   129             
       
   130 #ifdef SUBTITLE_STR_BY_LOCID
   103             if(value == (hbTrId("txt_irad_setlabel_download_quality_val_standard")))
   131             if(value == (hbTrId("txt_irad_setlabel_download_quality_val_standard")))
       
   132 #else
       
   133             if(value == (hbTrId("Standard")))                
       
   134 #endif
   104             {    
   135             {    
   105                 // User has made it Standard.
   136                 // User has made it Standard.
   106                 iSettings->setPreferredQuality(EIRQStandardQuality);
   137                 iSettings->setPreferredQuality(EIRQStandardQuality);
   107             }
   138             }
       
   139 #ifdef SUBTITLE_STR_BY_LOCID
   108             else if(value == (hbTrId("txt_irad_setlabel_download_quality_val_high")))
   140             else if(value == (hbTrId("txt_irad_setlabel_download_quality_val_high")))
       
   141 #else
       
   142             else if(value == (hbTrId("High")))                
       
   143 #endif
   109             {
   144             {
   110                 // User has made it High.
   145                 // User has made it High.
   111                 iSettings->setPreferredQuality(EIRQHighQuality);
   146                 iSettings->setPreferredQuality(EIRQHighQuality);
   112             }
   147             }
   113         }
   148         }