mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-03 17:39:25 +02:00
The real fix for bug #965
This commit is contained in:
parent
5537eb373f
commit
16e0fe3e12
10
src/prefs/ModulePrefs.cpp
Normal file → Executable file
10
src/prefs/ModulePrefs.cpp
Normal file → Executable file
@ -53,6 +53,7 @@ void ModulePrefs::GetAllModuleStatuses(){
|
|||||||
// The old modules might be still around, and we do not want to use them.
|
// The old modules might be still around, and we do not want to use them.
|
||||||
mModules.Clear();
|
mModules.Clear();
|
||||||
mStatuses.Clear();
|
mStatuses.Clear();
|
||||||
|
mPaths.Clear();
|
||||||
|
|
||||||
|
|
||||||
// Iterate through all Modules listed in prefs.
|
// Iterate through all Modules listed in prefs.
|
||||||
@ -63,7 +64,7 @@ void ModulePrefs::GetAllModuleStatuses(){
|
|||||||
int iStatus;
|
int iStatus;
|
||||||
gPrefs->Read( str, &iStatus, kModuleDisabled );
|
gPrefs->Read( str, &iStatus, kModuleDisabled );
|
||||||
wxString fname;
|
wxString fname;
|
||||||
gPrefs->Read( wxString( wxT("/Module/path:") ) + str, &fname, wxEmptyString );
|
gPrefs->Read( wxString( wxT("/ModulePath/") ) + str, &fname, wxEmptyString );
|
||||||
if( fname != wxEmptyString && wxFileExists( fname ) ){
|
if( fname != wxEmptyString && wxFileExists( fname ) ){
|
||||||
if( iStatus > kModuleNew ){
|
if( iStatus > kModuleNew ){
|
||||||
iStatus = kModuleNew;
|
iStatus = kModuleNew;
|
||||||
@ -72,6 +73,7 @@ void ModulePrefs::GetAllModuleStatuses(){
|
|||||||
//wxLogDebug( wxT("Entry: %s Value: %i"), str.c_str(), iStatus );
|
//wxLogDebug( wxT("Entry: %s Value: %i"), str.c_str(), iStatus );
|
||||||
mModules.Add( str );
|
mModules.Add( str );
|
||||||
mStatuses.Add( iStatus );
|
mStatuses.Add( iStatus );
|
||||||
|
mPaths.Add( fname );
|
||||||
}
|
}
|
||||||
bCont = gPrefs->GetNextEntry(str, dummy);
|
bCont = gPrefs->GetNextEntry(str, dummy);
|
||||||
}
|
}
|
||||||
@ -129,8 +131,8 @@ bool ModulePrefs::Apply()
|
|||||||
ShuttleGui S(this, eIsSavingToPrefs);
|
ShuttleGui S(this, eIsSavingToPrefs);
|
||||||
PopulateOrExchange(S);
|
PopulateOrExchange(S);
|
||||||
int i;
|
int i;
|
||||||
for(i=0;i<(int)mModules.GetCount();i++)
|
for(i=0;i<(int)mPaths.GetCount();i++)
|
||||||
SetModuleStatus( mModules[i], mStatuses[i] );
|
SetModuleStatus( mPaths[i], mStatuses[i] );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,7 +156,7 @@ void ModulePrefs::SetModuleStatus( wxString fname, int iStatus ){
|
|||||||
wxString ShortName = wxFileName( fname ).GetName();
|
wxString ShortName = wxFileName( fname ).GetName();
|
||||||
wxString PrefName = wxString( wxT("/Module/") ) + ShortName.Lower();
|
wxString PrefName = wxString( wxT("/Module/") ) + ShortName.Lower();
|
||||||
gPrefs->Write( PrefName, iStatus );
|
gPrefs->Write( PrefName, iStatus );
|
||||||
PrefName = wxString( wxT("/Module/path:") ) + ShortName.Lower();
|
PrefName = wxString( wxT("/ModulePath/") ) + ShortName.Lower();
|
||||||
gPrefs->Write( PrefName, fname );
|
gPrefs->Write( PrefName, fname );
|
||||||
gPrefs->Flush();
|
gPrefs->Flush();
|
||||||
}
|
}
|
||||||
|
1
src/prefs/ModulePrefs.h
Normal file → Executable file
1
src/prefs/ModulePrefs.h
Normal file → Executable file
@ -47,6 +47,7 @@ class ModulePrefs:public PrefsPanel
|
|||||||
void PopulateOrExchange(ShuttleGui & S);
|
void PopulateOrExchange(ShuttleGui & S);
|
||||||
wxArrayString mModules;
|
wxArrayString mModules;
|
||||||
wxArrayInt mStatuses;
|
wxArrayInt mStatuses;
|
||||||
|
wxArrayString mPaths;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user