13#include <wx/filedlg.h>
16#include <wx/settings.h>
17#include <wx/textctrl.h>
18#include <wx/weakref.h>
29#include "AudacityLogoAlpha.xpm"
49 void UpdatePrefs()
override;
76 sText->ChangeValue(pLogger->GetBuffer());
77 sText->SetInsertionPointEnd();
87 {
safenew wxFrame(NULL, wxID_ANY,
_(
"Audacity Log")) };
88 frame->SetName(frame->GetTitle());
89 frame->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
93#if !defined(__WXMAC__) && !defined(__WXX11__)
95 wxIcon ic{wxICON(AudacityLogo)};
96#elif defined(__WXGTK__)
97 wxIcon ic{wxICON(AudacityLogoAlpha)};
109 S.Style(wxNO_BORDER | wxTAB_TRAVERSAL).Prop(
true).StartPanel();
111 S.StartVerticalLay(
true);
113 sText =
S.Style(wxTE_MULTILINE | wxHSCROLL | wxTE_READONLY | wxTE_RICH)
117 if (pLogger) *
sText << pLogger->GetBuffer();
120 S.StartHorizontalLay(wxALIGN_CENTER, 0);
128 S.EndHorizontalLay();
150 sFrame = std::move( frame );
162 pLogger->SetListener([]{
166 sText->ChangeValue(pLogger->GetBuffer());
186#if defined(__WXMAC__)
211 wxString fName =
_(
"log.txt");
213 fName =
SelectFile(FileNames::Operation::Export,
219 wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
228 XO(
"Couldn't save log to file: %s").
Format( fName ),
236void LogWindowUpdater::UpdatePrefs()
240 bool shown =
sFrame->IsShown();
wxEVT_COMMAND_BUTTON_CLICKED
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
XXO("&Cut/Copy/Paste Toolbar")
std::unique_ptr< T, Destroyer< T > > Destroy_ptr
a convenience for using Destroyer
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)
static AudacityLogger * Get()
FILES_API const FileType TextFiles
static void Show(bool show=true)
Show or hide the unique logging window; create it on demand the first time it is shown.
static void Destroy()
Destroys the log window (if any)
A listener notified of changes in preferences.
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
wxBitmap & Bitmap(int iIndex)
void OnClear(wxCommandEvent &WXUNUSED(e))
std::optional< LogWindowUpdater > pUpdater
void OnClose(wxCommandEvent &WXUNUSED(e))
void OnCloseWindow(wxCloseEvent &WXUNUSED(e))
Destroy_ptr< wxFrame > sFrame
void OnSave(wxCommandEvent &WXUNUSED(e))
wxWeakRef< wxTextCtrl > sText