Audacity  3.0.3
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
SaveProjectCommand Class Reference

Command for saving an Audacity project. More...

#include <OpenSaveCommands.h>

Inheritance diagram for SaveProjectCommand:
Collaboration diagram for SaveProjectCommand:

Public Member Functions

ComponentInterfaceSymbol GetSymbol () override
TranslatableString GetDescription () override
bool DefineParams (ShuttleParams &S) override
void PopulateOrExchange (ShuttleGui &S) override
bool Apply (const CommandContext &context) override
ManualPageID ManualPage () override
- Public Member Functions inherited from AudacityCommand
 AudacityCommand ()
virtual ~AudacityCommand ()
PluginPath GetPath () override
VendorSymbol GetVendor () override
wxString GetVersion () override
virtual bool IsBatchProcessing ()
virtual void SetBatchProcessing (bool start)
virtual bool Apply (const CommandContext &WXUNUSED(context))
bool ShowInterface (wxWindow *parent, bool forceModal=false)
virtual void SetHostUI (EffectUIHostInterface *WXUNUSED(host))
wxDialog * CreateUI (wxWindow *parent, AudacityCommand *client)
virtual bool GetAutomationParameters (wxString &parms)
virtual bool SetAutomationParameters (const wxString &parms)
bool DoAudacityCommand (wxWindow *parent, const CommandContext &context, bool shouldPrompt=true)
int MessageBox (const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
virtual bool Init ()
virtual bool PromptUser (wxWindow *parent)
virtual bool CheckWhetherSkipAudacityCommand ()
virtual void End ()
virtual void PopulateOrExchange (ShuttleGui &WXUNUSED(S))
virtual bool TransferDataToWindow ()
virtual bool TransferDataFromWindow ()
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
TranslatableString GetName ()
virtual bool DefineParams (ShuttleParams &WXUNUSED(S))

Public Attributes

wxString mFileName
bool mbAddToHistory
bool bHasAddToHistory

Static Public Attributes

static const ComponentInterfaceSymbol Symbol { XO("Save Project2") }

Additional Inherited Members

- Public Types inherited from AudacityCommand
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
using VetoDialogHook = bool(*)(wxDialog *)
- Static Public Member Functions inherited from AudacityCommand
static VetoDialogHook SetVetoDialogHook (VetoDialogHook hook)
- Protected Attributes inherited from AudacityCommand
wxDialog * mUIDialog
wxWindow * mUIParent
int mUIResultID

Detailed Description

Command for saving an Audacity project.

Definition at line 50 of file OpenSaveCommands.h.

Member Function Documentation

◆ Apply()

bool SaveProjectCommand::Apply ( const CommandContext context)

Definition at line 104 of file OpenSaveCommands.cpp.

105 {
106  auto &projectFileManager = ProjectFileManager::Get( context.project );
107  if ( mFileName.empty() )
108  return projectFileManager.SaveAs();
109  else
110  return projectFileManager.SaveAs(mFileName, mbAddToHistory);
111 }

References ProjectFileManager::Get(), mbAddToHistory, mFileName, and CommandContext::project.

Here is the call graph for this function:

◆ DefineParams()

bool SaveProjectCommand::DefineParams ( ShuttleParams S)

Definition at line 86 of file OpenSaveCommands.cpp.

86  {
87  S.Define( mFileName, wxT("Filename"), "name.aup3" );
88  S.Define( mbAddToHistory, wxT("AddToHistory"), false );
89  return true;
90 }

References ShuttleParams::Define(), mbAddToHistory, and mFileName.

Here is the call graph for this function:

◆ GetDescription()

TranslatableString SaveProjectCommand::GetDescription ( )

Reimplemented from AudacityCommand.

Definition at line 57 of file OpenSaveCommands.h.

57 {return XO("Saves a project.");};

References XO.

◆ GetSymbol()

ComponentInterfaceSymbol SaveProjectCommand::GetSymbol ( )

Implements AudacityCommand.

Definition at line 56 of file OpenSaveCommands.h.

56 {return Symbol;};

References Symbol.

◆ ManualPage()

ManualPageID SaveProjectCommand::ManualPage ( )

Reimplemented from AudacityCommand.

Definition at line 63 of file OpenSaveCommands.h.

63 {return L"Extra_Menu:_Scriptables_II#save_project";}

◆ PopulateOrExchange()

void SaveProjectCommand::PopulateOrExchange ( ShuttleGui S)

Definition at line 92 of file OpenSaveCommands.cpp.

93 {
94  S.AddSpace(0, 5);
96  S.StartMultiColumn(2, wxALIGN_CENTER);
97  {
98  S.TieTextBox(XXO("File Name:"),mFileName);
99  S.TieCheckBox(XXO("Add to History"), mbAddToHistory );
100  }
101  S.EndMultiColumn();
102 }

References ShuttleGui::AddSpace(), ShuttleGuiBase::EndMultiColumn(), mbAddToHistory, mFileName, ShuttleGuiBase::StartMultiColumn(), ShuttleGuiBase::TieCheckBox(), ShuttleGuiBase::TieTextBox(), and XXO.

Here is the call graph for this function:

Member Data Documentation

◆ bHasAddToHistory

bool SaveProjectCommand::bHasAddToHistory

Definition at line 67 of file OpenSaveCommands.h.

◆ mbAddToHistory

bool SaveProjectCommand::mbAddToHistory

Definition at line 66 of file OpenSaveCommands.h.

Referenced by Apply(), DefineParams(), and PopulateOrExchange().

◆ mFileName

wxString SaveProjectCommand::mFileName

Definition at line 65 of file OpenSaveCommands.h.

Referenced by Apply(), DefineParams(), and PopulateOrExchange().

◆ Symbol

const ComponentInterfaceSymbol SaveProjectCommand::Symbol { XO("Save Project2") }

Definition at line 53 of file OpenSaveCommands.h.

Referenced by GetSymbol().

The documentation for this class was generated from the following files:
static const ComponentInterfaceSymbol Symbol
Definition: OpenSaveCommands.h:53
wxCheckBox * TieCheckBox(const TranslatableString &Prompt, bool &Var)
Definition: ShuttleGui.cpp:1629
wxSizerItem * AddSpace(int width, int height, int prop=0)
Definition: ShuttleGui.cpp:2459
#define XO(s)
Definition: Internat.h:31
void EndMultiColumn()
Definition: ShuttleGui.cpp:1238
wxTextCtrl * TieTextBox(const TranslatableString &Caption, wxString &Value, const int nChars=0)
Definition: ShuttleGui.cpp:1652
#define XXO(s)
Definition: Internat.h:44
static ProjectFileManager & Get(AudacityProject &project)
Definition: ProjectFileManager.cpp:66
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1229
bool mbAddToHistory
Definition: OpenSaveCommands.h:66
wxString mFileName
Definition: OpenSaveCommands.h:65
virtual void Define(bool &var, const wxChar *key, const bool vdefault, const bool vmin=false, const bool vmax=false, const bool vscl=false)
Definition: Shuttle.cpp:332
AudacityProject & project
Definition: CommandContext.h:64