mpviewplugins/mpplaybackviewplugin/src/mpequalizerwidget.cpp
changeset 36 a0afa279b8fe
parent 35 fdb31ab341af
child 51 560ce2306a17
equal deleted inserted replaced
35:fdb31ab341af 36:a0afa279b8fe
    84 
    84 
    85     mOriginalPreset = mMpEngine->activePreset();
    85     mOriginalPreset = mMpEngine->activePreset();
    86     QStringList listItems;
    86     QStringList listItems;
    87     QStringList presetNames = mMpEngine->presetNames();
    87     QStringList presetNames = mMpEngine->presetNames();
    88     for ( int i=0; i<presetNames.count(); i++ ) {
    88     for ( int i=0; i<presetNames.count(); i++ ) {
    89         QString name = getLogicalName( presetNames.at(i) );
    89         QString name = getLocalizedString( presetNames.at(i) );
    90         if ( name.size() > 0 ) {
    90         if ( name.size() > 0 ) {
    91             listItems.append( name );
    91             listItems.append( name );
       
    92         }
       
    93         else {
       
    94             // Localized string not found, append original name.
       
    95             TX_LOG_ARGS( "Localized string not found = " << name);
       
    96             listItems.append( presetNames.at(i) );
    92         }
    97         }
    93     }
    98     }
    94     listItems.prepend(hbTrId("txt_mus_list_off"));
    99     listItems.prepend(hbTrId("txt_mus_list_off"));
    95     TX_LOG_ARGS( "PresetNames=" << listItems);
   100     TX_LOG_ARGS( "PresetNames=" << listItems);
    96     int presetSelected;
   101     int presetSelected;
   179     
   184     
   180     TX_EXIT
   185     TX_EXIT
   181 }
   186 }
   182 
   187 
   183 /*!
   188 /*!
   184   Return the logical name base on preset name. Used for localization.
   189   Return the localized string base on preset name.
   185  */
   190  */
   186 QString MpEqualizerWidget::getLogicalName( QString name )
   191 QString MpEqualizerWidget::getLocalizedString( QString name )
   187 {
   192 {
   188     TX_ENTRY_ARGS( "Name = " << name );
   193     TX_ENTRY_ARGS( "Name = " << name );
   189     QString logicalName;
   194     QString localizedString;
   190 
   195 
   191     if ( name == "Bass Booster" ) {
   196     if ( name == "Bass Booster" ) {
   192         logicalName = hbTrId( "txt_mus_list_bass_booster" );
   197         localizedString = hbTrId( "txt_mus_list_bass_booster" );
   193     }
   198     }
   194     else if ( name == "Classic" ) {
   199     else if ( name == "Classic" ) {
   195         logicalName = hbTrId( "txt_mus_list_classical" );
   200         localizedString = hbTrId( "txt_mus_list_classical" );
   196     }
   201     }
   197     else if ( name == "Pop" ) {
   202     else if ( name == "Pop" ) {
   198         logicalName = hbTrId( "txt_mus_list_pop" );
   203         localizedString = hbTrId( "txt_mus_list_pop" );
   199     }
   204     }
   200     else if ( name == "Jazz" ) {
   205     else if ( name == "Jazz" ) {
   201         logicalName = hbTrId( "txt_mus_list_jazz" );
   206         localizedString = hbTrId( "txt_mus_list_jazz" );
   202     }
   207     }
   203     else if ( name == "Rock" ) {
   208     else if ( name == "Rock" ) {
   204         logicalName = hbTrId( "txt_mus_list_rock" );
   209         localizedString = hbTrId( "txt_mus_list_rock" );
   205     }
   210     }
   206     
   211     
   207     TX_EXIT_ARGS( "Logical String = " << logicalName );
   212     TX_EXIT_ARGS( "Logical String = " << localizedString );
   208     return logicalName;
   213     return localizedString;
   209 }
   214 }
   210 
   215 
   211 //End of File
   216 //End of File