1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-21 14:02:57 +02:00

Implement ReloadPreferences for SetPreferences Command.

This commit is contained in:
James Crook
2018-02-10 16:31:10 +00:00
committed by Paul Licameli
parent 1551a5a073
commit 99e18a8896
4 changed files with 41 additions and 3 deletions

View File

@@ -20,6 +20,7 @@ SetPreferenceCommand classes
#include "../Prefs.h"
#include "../ShuttleGui.h"
#include "../commands/CommandContext.h"
#include "../Project.h" // for "OnReloadPreferences".
bool GetPreferenceCommand::DefineParams( ShuttleParams & S ){
S.Define( mName, wxT("Name"), wxT("") );
@@ -68,11 +69,11 @@ void SetPreferenceCommand::PopulateOrExchange(ShuttleGui & S)
S.EndMultiColumn();
}
bool SetPreferenceCommand::Apply(const CommandContext & WXUNUSED(context))
bool SetPreferenceCommand::Apply(const CommandContext & context)
{
bool bOK = gPrefs->Write(mName, mValue) && gPrefs->Flush();
if( bOK && mbReload )
bOK = bOK; // Not yet implemented.
context.GetProject()->OnReloadPreferences( context );
return bOK;
}