Audacity 3.2.0
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 }
const TranslatableString name
Definition: Distortion.cpp:74
XO("Cut/Copy/Paste")
@ eIsCreating
Definition: ShuttleGui.h:39
#define S(N)
Definition: ToChars.cpp:64
wxFileName mLibPath
Definition: ExportMP3.cpp:692
FileNames::FileTypes mTypes
Definition: ExportMP3.cpp:696
wxString mPath
Definition: ExportMP3.cpp:694
void PopulateOrExchange(ShuttleGui &S)
Definition: ExportMP3.cpp:608
wxString mName
Definition: ExportMP3.cpp:695
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:628

References eIsCreating, mLibPath, mName, mPath, mTypes, name, PopulateOrExchange(), S, 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 }
wxT("CloseDown"))
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
wxTextCtrl * mPathText
Definition: ExportMP3.cpp:699

References mLibPath, mName, mPathText, mTypes, SelectFile(), wxT(), 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 }
static void ShowHelp(wxWindow *parent, const FilePath &localFileName, const URLString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:234

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 }
#define ID_DLOAD
Definition: ExportMP3.cpp:582
#define ID_BROWSE
Definition: ExportMP3.cpp:581
XXO("&Cut/Copy/Paste Toolbar")
#define _(s)
Definition: Internat.h:75
Abstract base class used in importing a file.

References _, ID_BROWSE, ID_DLOAD, mLibPath, mName, mPathText, S, 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: