Audacity  3.0.3
Classes | Functions | Variables
anonymous_namespace{LogWindow.cpp} Namespace Reference

Classes

struct  LogWindowUpdater
 

Functions

void OnCloseWindow (wxCloseEvent &e)
 
void OnClose (wxCommandEvent &e)
 
void OnClear (wxCommandEvent &e)
 
void OnSave (wxCommandEvent &e)
 
void OnCloseWindow (wxCloseEvent &WXUNUSED(e))
 
void OnClose (wxCommandEvent &WXUNUSED(e))
 
void OnClear (wxCommandEvent &WXUNUSED(e))
 
void OnSave (wxCommandEvent &WXUNUSED(e))
 

Variables

Destroy_ptr< wxFrame > sFrame
 
wxWeakRef< wxTextCtrl > sText
 
std::optional< LogWindowUpdaterpUpdater
 

Function Documentation

◆ OnClear() [1/2]

void anonymous_namespace{LogWindow.cpp}::OnClear ( wxCommandEvent &  e)

◆ OnClear() [2/2]

void anonymous_namespace{LogWindow.cpp}::OnClear ( wxCommandEvent &  WXUNUSEDe)

Definition at line 194 of file LogWindow.cpp.

195 {
196  auto pLogger = AudacityLogger::Get();
197  if (pLogger)
198  pLogger->ClearLog();
199 }

References AudacityLogger::Get().

Referenced by LogWindow::Show().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnClose() [1/2]

void anonymous_namespace{LogWindow.cpp}::OnClose ( wxCommandEvent &  e)

Referenced by anonymous_namespace{FileMenus.cpp}::FileMenu().

Here is the caller graph for this function:

◆ OnClose() [2/2]

void anonymous_namespace{LogWindow.cpp}::OnClose ( wxCommandEvent &  WXUNUSEDe)

Definition at line 188 of file LogWindow.cpp.

189 {
190  wxCloseEvent dummy;
191  OnCloseWindow(dummy);
192 }

References OnCloseWindow().

Referenced by LogWindow::Show().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnCloseWindow() [1/2]

void anonymous_namespace{LogWindow.cpp}::OnCloseWindow ( wxCloseEvent &  e)

◆ OnCloseWindow() [2/2]

void anonymous_namespace{LogWindow.cpp}::OnCloseWindow ( wxCloseEvent &  WXUNUSEDe)

Definition at line 176 of file LogWindow.cpp.

177 {
178 #if defined(__WXMAC__)
179  // On the Mac, destroy the window rather than hiding it since the
180  // log menu will override the root windows menu if there is no
181  // project window open.
182  sFrame.reset();
183 #else
184  sFrame->Show(false);
185 #endif
186 }

References sFrame.

Referenced by OnClose(), and LogWindow::Show().

Here is the caller graph for this function:

◆ OnSave() [1/2]

void anonymous_namespace{LogWindow.cpp}::OnSave ( wxCommandEvent &  e)

Referenced by anonymous_namespace{FileMenus.cpp}::FileMenu().

Here is the caller graph for this function:

◆ OnSave() [2/2]

void anonymous_namespace{LogWindow.cpp}::OnSave ( wxCommandEvent &  WXUNUSEDe)

Definition at line 201 of file LogWindow.cpp.

202 {
203  wxString fName = _("log.txt");
204 
205  fName = SelectFile(FileNames::Operation::Export,
206  XO("Save log to:"),
207  wxEmptyString,
208  fName,
209  wxT("txt"),
211  wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
212  sFrame.get());
213 
214  if (fName.empty()) {
215  return;
216  }
217 
218  if (!(sText && sText->SaveFile(fName))) {
220  XO("Couldn't save log to file: %s").Format( fName ),
221  XO("Warning"),
222  wxICON_EXCLAMATION,
223  sFrame.get());
224  return;
225  }
226 }

References _, AudacityMessageBox(), SelectFile(), sFrame, sText, FileNames::TextFiles, and XO.

Referenced by LogWindow::Show().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ pUpdater

std::optional<LogWindowUpdater> anonymous_namespace{LogWindow.cpp}::pUpdater

Definition at line 53 of file LogWindow.cpp.

Referenced by LogWindow::Show(), and TrackList::UpdatePendingTracks().

◆ sFrame

Destroy_ptr<wxFrame> anonymous_namespace{LogWindow.cpp}::sFrame

◆ sText

wxWeakRef<wxTextCtrl> anonymous_namespace{LogWindow.cpp}::sText

Definition at line 44 of file LogWindow.cpp.

Referenced by ProgressDialog::AddMessageAsColumn(), OnSave(), and LogWindow::Show().

AudacityMessageBox
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
Definition: AudacityMessageBox.cpp:17
anonymous_namespace{LogWindow.cpp}::sText
wxWeakRef< wxTextCtrl > sText
Definition: LogWindow.cpp:44
SelectFile
FilePath SelectFile(FileNames::Operation op, const TranslatableString &message, const FilePath &default_path, const FilePath &default_filename, const FileExtension &default_extension, const FileTypes &fileTypes, int flags, wxWindow *parent)
Definition: SelectFile.cpp:17
Format
Abstract base class used in importing a file.
XO
#define XO(s)
Definition: Internat.h:31
FileNames::TextFiles
FILES_API const FileType TextFiles
Definition: FileNames.h:74
AudacityLogger::Get
static AudacityLogger * Get()
Definition: AudacityLogger.cpp:35
anonymous_namespace{LogWindow.cpp}::OnCloseWindow
void OnCloseWindow(wxCloseEvent &WXUNUSED(e))
Definition: LogWindow.cpp:176
_
#define _(s)
Definition: Internat.h:75
anonymous_namespace{LogWindow.cpp}::sFrame
Destroy_ptr< wxFrame > sFrame
Definition: LogWindow.cpp:43