Audacity  3.0.3
Public Member Functions | Private Attributes | List of all members
FindDialog Class Referencefinal
Inheritance diagram for FindDialog:
[legend]
Collaboration diagram for FindDialog:
[legend]

Public Member Functions

 FindDialog (wxWindow *parent, wxString path, wxString name, FileNames::FileTypes types)
 
void PopulateOrExchange (ShuttleGui &S)
 
void OnBrowse (wxCommandEvent &WXUNUSED(event))
 
void OnDownload (wxCommandEvent &WXUNUSED(event))
 
wxString GetLibPath ()
 
- Public Member Functions inherited from wxDialogWrapper
 wxDialogWrapper ()
 
 wxDialogWrapper (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
bool Create (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
void SetTitle (const TranslatableString &title)
 
void SetLabel (const TranslatableString &title)
 
void SetName (const TranslatableString &title)
 
void SetName ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxDialog >
 wxTabTraversalWrapper (Args &&... args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Private Attributes

wxFileName mLibPath
 
wxString mPath
 
wxString mName
 
FileNames::FileTypes mTypes
 
wxTextCtrl * mPathText
 

Detailed Description

Definition at line 584 of file ExportMP3.cpp.

Constructor & Destructor Documentation

◆ FindDialog()

FindDialog::FindDialog ( wxWindow *  parent,
wxString  path,
wxString  name,
FileNames::FileTypes  types 
)
inline

Definition at line 590 of file ExportMP3.cpp.

592  : wxDialogWrapper(parent, wxID_ANY,
593  /* i18n-hint: LAME is the name of an MP3 converter and should not be translated*/
594  XO("Locate LAME"))
595  {
596  SetName();
597  ShuttleGui S(this, eIsCreating);
598 
599  mPath = path;
600  mName = name;
601  mTypes = std::move( types );
602 
603  mLibPath.Assign(mPath, mName);
604 
606  }

References eIsCreating, mLibPath, mName, mPath, mTypes, name, PopulateOrExchange(), and wxDialogWrapper::SetName().

Here is the call graph for this function:

Member Function Documentation

◆ GetLibPath()

wxString FindDialog::GetLibPath ( )
inline

Definition at line 682 of file ExportMP3.cpp.

683  {
684  return mLibPath.GetFullPath();
685  }

References mLibPath.

Referenced by MP3Exporter::FindLibrary().

Here is the caller graph for this function:

◆ OnBrowse()

void FindDialog::OnBrowse ( wxCommandEvent &  WXUNUSEDevent)
inline

Definition at line 656 of file ExportMP3.cpp.

657  {
658  /* i18n-hint: It's asking for the location of a file, for
659  * example, "Where is lame_enc.dll?" - you could translate
660  * "Where would I find the file %s" instead if you want. */
661  auto question = XO("Where is %s?").Format( mName );
662 
663  wxString path = SelectFile(FileNames::Operation::_None,
664  question,
665  mLibPath.GetPath(),
666  mLibPath.GetName(),
667  wxT(""),
668  mTypes,
669  wxFD_OPEN | wxRESIZE_BORDER,
670  this);
671  if (!path.empty()) {
672  mLibPath = path;
673  mPathText->SetValue(path);
674  }
675  }

References mLibPath, mName, mPathText, mTypes, SelectFile(), and XO.

Here is the call graph for this function:

◆ OnDownload()

void FindDialog::OnDownload ( wxCommandEvent &  WXUNUSEDevent)
inline

Definition at line 677 of file ExportMP3.cpp.

678  {
679  HelpSystem::ShowHelp(this, L"FAQ:Installing_the_LAME_MP3_Encoder");
680  }

References HelpSystem::ShowHelp().

Here is the call graph for this function:

◆ PopulateOrExchange()

void FindDialog::PopulateOrExchange ( ShuttleGui S)
inline

Definition at line 608 of file ExportMP3.cpp.

609  {
610  S.SetBorder(10);
611  S.StartVerticalLay(true);
612  {
613  S.AddTitle(
614  XO("Audacity needs the file %s to create MP3s.")
615  .Format( mName ) );
616 
617  S.SetBorder(3);
618  S.StartHorizontalLay(wxALIGN_LEFT, true);
619  {
620  S.AddTitle( XO("Location of %s:").Format( mName ) );
621  }
622  S.EndHorizontalLay();
623 
624  S.StartMultiColumn(2, wxEXPAND);
625  S.SetStretchyCol(0);
626  {
627  if (mLibPath.GetFullPath().empty()) {
628  mPathText = S.AddTextBox( {},
629  /* i18n-hint: There is a button to the right of the arrow.*/
630  wxString::Format(_("To find %s, click here -->"), mName), 0);
631  }
632  else {
633  mPathText = S.AddTextBox( {}, mLibPath.GetFullPath(), 0);
634  }
635  S.Id(ID_BROWSE).AddButton(XXO("Browse..."), wxALIGN_RIGHT);
636  S.AddVariableText(
637  /* i18n-hint: There is a button to the right of the arrow.*/
638  XO("To get a free copy of LAME, click here -->"), true);
639  /* i18n-hint: (verb)*/
640  S.Id(ID_DLOAD).AddButton(XXO("Download"), wxALIGN_RIGHT);
641  }
642  S.EndMultiColumn();
643 
644  S.AddStandardButtons();
645  }
646  S.EndVerticalLay();
647 
648  Layout();
649  Fit();
650  SetMinSize(GetSize());
651  Center();
652 
653  return;
654  }

References _, ShuttleGuiBase::AddButton(), ShuttleGui::AddStandardButtons(), ShuttleGuiBase::AddTextBox(), ShuttleGuiBase::AddTitle(), ShuttleGuiBase::AddVariableText(), ShuttleGuiBase::EndHorizontalLay(), ShuttleGuiBase::EndMultiColumn(), ShuttleGuiBase::EndVerticalLay(), ShuttleGui::Id(), ID_BROWSE, ID_DLOAD, mLibPath, mName, mPathText, ShuttleGuiBase::SetBorder(), ShuttleGuiBase::SetStretchyCol(), ShuttleGuiBase::StartHorizontalLay(), ShuttleGuiBase::StartMultiColumn(), ShuttleGuiBase::StartVerticalLay(), XO, and XXO.

Referenced by FindDialog().

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

Member Data Documentation

◆ mLibPath

wxFileName FindDialog::mLibPath
private

Definition at line 692 of file ExportMP3.cpp.

Referenced by FindDialog(), GetLibPath(), OnBrowse(), and PopulateOrExchange().

◆ mName

wxString FindDialog::mName
private

Definition at line 695 of file ExportMP3.cpp.

Referenced by FindDialog(), OnBrowse(), and PopulateOrExchange().

◆ mPath

wxString FindDialog::mPath
private

Definition at line 694 of file ExportMP3.cpp.

Referenced by FindDialog().

◆ mPathText

wxTextCtrl* FindDialog::mPathText
private

Definition at line 699 of file ExportMP3.cpp.

Referenced by OnBrowse(), and PopulateOrExchange().

◆ mTypes

FileNames::FileTypes FindDialog::mTypes
private

Definition at line 696 of file ExportMP3.cpp.

Referenced by FindDialog(), and OnBrowse().


The documentation for this class was generated from the following file:
FindDialog::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S)
Definition: ExportMP3.cpp:608
eIsCreating
@ eIsCreating
Definition: ShuttleGui.h:38
ShuttleGuiBase::StartVerticalLay
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1184
ShuttleGuiBase::AddTitle
void AddTitle(const TranslatableString &Prompt, int wrapWidth=0)
Centred text string.
Definition: ShuttleGui.cpp:281
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
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1238
HelpSystem::ShowHelp
static void ShowHelp(wxWindow *parent, const FilePath &localFileName, const URLString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:237
ID_BROWSE
#define ID_BROWSE
Definition: ExportMP3.cpp:581
FindDialog::mLibPath
wxFileName mLibPath
Definition: ExportMP3.cpp:692
ShuttleGui::Id
ShuttleGui & Id(int id)
Definition: ShuttleGui.cpp:2274
ID_DLOAD
#define ID_DLOAD
Definition: ExportMP3.cpp:582
FindDialog::mPath
wxString mPath
Definition: ExportMP3.cpp:694
XXO
#define XXO(s)
Definition: Internat.h:44
ShuttleGuiBase::EndHorizontalLay
void EndHorizontalLay()
Definition: ShuttleGui.cpp:1177
ShuttleGuiBase::StartHorizontalLay
void StartHorizontalLay(int PositionFlags=wxALIGN_CENTRE, int iProp=1)
Definition: ShuttleGui.cpp:1167
ShuttleGuiBase::AddTextBox
wxTextCtrl * AddTextBox(const TranslatableString &Caption, const wxString &Value, const int nChars)
Definition: ShuttleGui.cpp:638
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1229
FindDialog::mPathText
wxTextCtrl * mPathText
Definition: ExportMP3.cpp:699
ShuttleGuiBase::EndVerticalLay
void EndVerticalLay()
Definition: ShuttleGui.cpp:1203
name
const TranslatableString name
Definition: Distortion.cpp:98
FindDialog::mTypes
FileNames::FileTypes mTypes
Definition: ExportMP3.cpp:696
ShuttleGuiBase::AddButton
wxButton * AddButton(const TranslatableString &Text, int PositionFlags=wxALIGN_CENTRE, bool setDefault=false)
Definition: ShuttleGui.cpp:360
FindDialog::mName
wxString mName
Definition: ExportMP3.cpp:695
_
#define _(s)
Definition: Internat.h:75
wxDialogWrapper::wxDialogWrapper
wxDialogWrapper()
Definition: wxPanelWrapper.h:84
ShuttleGui::AddStandardButtons
void AddStandardButtons(long buttons=eOkButton|eCancelButton, wxWindow *extra=NULL)
Definition: ShuttleGui.cpp:2444
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:489
wxDialogWrapper::SetName
void SetName()
Definition: wxPanelWrapper.cpp:81
ShuttleGuiBase::AddVariableText
wxStaticText * AddVariableText(const TranslatableString &Str, bool bCenter=false, int PositionFlags=0, int wrapWidth=0)
Definition: ShuttleGui.cpp:463
ShuttleGuiBase::SetStretchyCol
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:202
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631