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 478 of file ExportMP3.cpp.

Constructor & Destructor Documentation

◆ FindDialog()

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

Definition at line 484 of file ExportMP3.cpp.

486 : wxDialogWrapper(parent, wxID_ANY,
487 /* i18n-hint: LAME is the name of an MP3 converter and should not be translated*/
488 XO("Locate LAME"))
489 {
490 SetName();
491 ShuttleGui S(this, eIsCreating);
492
493 mPath = path;
494 mName = name;
495 mTypes = std::move( types );
496
497 mLibPath.Assign(mPath, mName);
498
500 }
const TranslatableString name
Definition: Distortion.cpp:76
XO("Cut/Copy/Paste")
@ eIsCreating
Definition: ShuttleGui.h:37
#define S(N)
Definition: ToChars.cpp:64
wxFileName mLibPath
Definition: ExportMP3.cpp:586
FileNames::FileTypes mTypes
Definition: ExportMP3.cpp:590
wxString mPath
Definition: ExportMP3.cpp:588
void PopulateOrExchange(ShuttleGui &S)
Definition: ExportMP3.cpp:502
wxString mName
Definition: ExportMP3.cpp:589
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640

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 576 of file ExportMP3.cpp.

577 {
578 return mLibPath.GetFullPath();
579 }

References mLibPath.

Referenced by MP3Exporter::FindLibrary().

Here is the caller graph for this function:

◆ OnBrowse()

void FindDialog::OnBrowse ( wxCommandEvent &  WXUNUSEDevent)
inline

Definition at line 550 of file ExportMP3.cpp.

551 {
552 /* i18n-hint: It's asking for the location of a file, for
553 * example, "Where is lame_enc.dll?" - you could translate
554 * "Where would I find the file %s" instead if you want. */
555 auto question = XO("Where is %s?").Format( mName );
556
557 wxString path = SelectFile(FileNames::Operation::_None,
558 question,
559 mLibPath.GetPath(),
560 mLibPath.GetName(),
561 wxT(""),
562 mTypes,
563 wxFD_OPEN | wxRESIZE_BORDER,
564 this);
565 if (!path.empty()) {
566 mLibPath = path;
567 mPathText->SetValue(path);
568 }
569 }
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:593

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 571 of file ExportMP3.cpp.

572 {
573 HelpSystem::ShowHelp(this, L"FAQ:Installing_the_LAME_MP3_Encoder");
574 }
static void ShowHelp(wxWindow *parent, const FilePath &localFileName, const URLString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:231

References HelpSystem::ShowHelp().

Here is the call graph for this function:

◆ PopulateOrExchange()

void FindDialog::PopulateOrExchange ( ShuttleGui S)
inline

Definition at line 502 of file ExportMP3.cpp.

503 {
504 S.SetBorder(10);
505 S.StartVerticalLay(true);
506 {
507 S.AddTitle(
508 XO("Audacity needs the file %s to create MP3s.")
509 .Format( mName ) );
510
511 S.SetBorder(3);
512 S.StartHorizontalLay(wxALIGN_LEFT, true);
513 {
514 S.AddTitle( XO("Location of %s:").Format( mName ) );
515 }
516 S.EndHorizontalLay();
517
518 S.StartMultiColumn(2, wxEXPAND);
519 S.SetStretchyCol(0);
520 {
521 if (mLibPath.GetFullPath().empty()) {
522 mPathText = S.AddTextBox( {},
523 /* i18n-hint: There is a button to the right of the arrow.*/
524 wxString::Format(_("To find %s, click here -->"), mName), 0);
525 }
526 else {
527 mPathText = S.AddTextBox( {}, mLibPath.GetFullPath(), 0);
528 }
529 S.Id(ID_BROWSE).AddButton(XXO("Browse..."), wxALIGN_RIGHT);
530 S.AddVariableText(
531 /* i18n-hint: There is a button to the right of the arrow.*/
532 XO("To get a free copy of LAME, click here -->"), true);
533 /* i18n-hint: (verb)*/
534 S.Id(ID_DLOAD).AddButton(XXO("Download"), wxALIGN_RIGHT);
535 }
536 S.EndMultiColumn();
537
538 S.AddStandardButtons();
539 }
540 S.EndVerticalLay();
541
542 Layout();
543 Fit();
544 SetMinSize(GetSize());
545 Center();
546
547 return;
548 }
#define ID_DLOAD
Definition: ExportMP3.cpp:476
#define ID_BROWSE
Definition: ExportMP3.cpp:475
XXO("&Cut/Copy/Paste Toolbar")
#define _(s)
Definition: Internat.h:73
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 586 of file ExportMP3.cpp.

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

◆ mName

wxString FindDialog::mName
private

Definition at line 589 of file ExportMP3.cpp.

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

◆ mPath

wxString FindDialog::mPath
private

Definition at line 588 of file ExportMP3.cpp.

Referenced by FindDialog().

◆ mPathText

wxTextCtrl* FindDialog::mPathText
private

Definition at line 593 of file ExportMP3.cpp.

Referenced by OnBrowse(), and PopulateOrExchange().

◆ mTypes

FileNames::FileTypes FindDialog::mTypes
private

Definition at line 590 of file ExportMP3.cpp.

Referenced by FindDialog(), and OnBrowse().


The documentation for this class was generated from the following file: