diff --git a/src/main.cpp b/src/main.cpp index 1c45b4cc..e0b9a573 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -606,6 +606,7 @@ int main ( int argc, char** argv ) if ( bUseGUI && bUseTranslation ) { CLocale::LoadTranslation ( Settings.strLanguage, pApp ); + CInstPictures::UpdateTableOnLanguageChange(); } #ifndef HEADLESS diff --git a/src/util.cpp b/src/util.cpp index b8426535..9f3e7cbe 100755 --- a/src/util.cpp +++ b/src/util.cpp @@ -1058,18 +1058,19 @@ QString NetworkUtil::GetCentralServerAddress ( const ECSAddType eCentralServerAd // Instrument picture data base ------------------------------------------------ -CVector& CInstPictures::GetTable() +CVector& CInstPictures::GetTable ( const bool bReGenerateTable ) { // make sure we generate the table only once static bool TableIsInitialized = false; static CVector vecDataBase; - if ( !TableIsInitialized ) + if ( !TableIsInitialized || bReGenerateTable ) { // instrument picture data base initialization // NOTE: Do not change the order of any instrument in the future! // NOTE: The very first entry is the "not used" element per definition. + vecDataBase.Init ( 0 ); // first clear all existing data since we create the list be adding entries vecDataBase.Add ( CInstPictProps ( QCoreApplication::translate ( "CMusProfDlg", "None" ), ":/png/instr/res/instruments/none.png", IC_OTHER_INSTRUMENT ) ); // special first element vecDataBase.Add ( CInstPictProps ( QCoreApplication::translate ( "CMusProfDlg", "Drum Set" ), ":/png/instr/res/instruments/drumset.png", IC_PERCUSSION_INSTRUMENT ) ); vecDataBase.Add ( CInstPictProps ( QCoreApplication::translate ( "CMusProfDlg", "Djembe" ), ":/png/instr/res/instruments/djembe.png", IC_PERCUSSION_INSTRUMENT ) ); diff --git a/src/util.h b/src/util.h index 841518a1..d279d89d 100755 --- a/src/util.h +++ b/src/util.h @@ -859,6 +859,7 @@ public: static QString GetResourceReference ( const int iInstrument ); static QString GetName ( const int iInstrument ); static EInstCategory GetCategory ( const int iInstrument ); + static void UpdateTableOnLanguageChange() { GetTable ( true ); } // TODO make use of instrument category (not yet implemented) @@ -884,8 +885,7 @@ protected: }; static bool IsInstIndexInRange ( const int iIdx ); - - static CVector& GetTable(); + static CVector& GetTable ( const bool bReGenerateTable = false ); };