1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-03 22:19:07 +02:00
audacity/src/prefs/WarningsPrefs.cpp
Leland Lucius cbf1bb558e AUP3: Removes OD code related to project file handling
This removes all of the OnDemand code embedded throughout
    the main codebase. Individual files related specifically
    to OD have been left in place, but removed from the build.
2020-07-01 01:14:05 -05:00

116 lines
2.9 KiB
C++

/**********************************************************************
Audacity: A Digital Audio Editor
WarningsPrefs.cpp
Brian Gunlogson
Joshua Haberman
Dominic Mazzoni
James Crook
*******************************************************************//**
\class WarningsPrefs
\brief A PrefsPanel to enable/disable certain warning messages.
*//*******************************************************************/
#include "../Audacity.h"
#include "WarningsPrefs.h"
#include <wx/defs.h>
#include "../ShuttleGui.h"
////////////////////////////////////////////////////////////////////////////////
WarningsPrefs::WarningsPrefs(wxWindow * parent, wxWindowID winid)
: PrefsPanel(parent, winid, XO("Warnings"))
{
Populate();
}
WarningsPrefs::~WarningsPrefs()
{
}
ComponentInterfaceSymbol WarningsPrefs::GetSymbol()
{
return WARNINGS_PREFS_PLUGIN_SYMBOL;
}
TranslatableString WarningsPrefs::GetDescription()
{
return XO("Preferences for Warnings");
}
wxString WarningsPrefs::HelpPageName()
{
return "Warnings_Preferences";
}
void WarningsPrefs::Populate()
{
//------------------------- Main section --------------------
// Now construct the GUI itself.
// Use 'eIsCreatingFromPrefs' so that the GUI is
// initialised with values from gPrefs.
ShuttleGui S(this, eIsCreatingFromPrefs);
PopulateOrExchange(S);
// ----------------------- End of main section --------------
}
void WarningsPrefs::PopulateOrExchange(ShuttleGui & S)
{
S.SetBorder(2);
S.StartScroller();
S.StartStatic(XO("Show Warnings/Prompts for"));
{
S.TieCheckBox(XXO("Saving &projects"),
{wxT("/Warnings/FirstProjectSave"),
true});
S.TieCheckBox(XXO("Saving &empty project"),
{wxT("/GUI/EmptyCanBeDirty"),
true});
S.TieCheckBox(XXO("&Low disk space at launch or new project"),
{wxT("/Warnings/DiskSpaceWarning"),
true});
S.TieCheckBox(XXO("Mixing down to &mono during export"),
{wxT("/Warnings/MixMono"),
true});
S.TieCheckBox(XXO("Mixing down to &stereo during export"),
{wxT("/Warnings/MixStereo"),
true});
S.TieCheckBox(XXO("Mixing down on export (&Custom FFmpeg or external program)"),
{wxT("/Warnings/MixUnknownChannels"),
true});
S.TieCheckBox(XXO("Missing file &name extension during export"),
{wxT("/Warnings/MissingExtension"),
true});
}
S.EndStatic();
S.EndScroller();
}
bool WarningsPrefs::Commit()
{
ShuttleGui S(this, eIsSavingToPrefs);
PopulateOrExchange(S);
return true;
}
namespace{
PrefsPanel::Registration sAttachment{ "Warnings",
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
{
wxASSERT(parent); // to justify safenew
return safenew WarningsPrefs(parent, winid);
}
};
}