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

Constructor & Destructor Documentation

◆ FindDialog()

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

Definition at line 480 of file ExportMP3.cpp.

482 : wxDialogWrapper(parent, wxID_ANY,
483 /* i18n-hint: LAME is the name of an MP3 converter and should not be translated*/
484 XO("Locate LAME"))
485 {
486 SetName();
487 ShuttleGui S(this, eIsCreating);
488
489 mPath = path;
490 mName = name;
491 mTypes = std::move( types );
492
493 mLibPath.Assign(mPath, mName);
494
496 }
XO("Cut/Copy/Paste")
@ eIsCreating
Definition: ShuttleGui.h:37
wxString name
Definition: TagsEditor.cpp:166
#define S(N)
Definition: ToChars.cpp:64
wxFileName mLibPath
Definition: ExportMP3.cpp:582
FileNames::FileTypes mTypes
Definition: ExportMP3.cpp:586
wxString mPath
Definition: ExportMP3.cpp:584
void PopulateOrExchange(ShuttleGui &S)
Definition: ExportMP3.cpp:498
wxString mName
Definition: ExportMP3.cpp:585
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 572 of file ExportMP3.cpp.

573 {
574 return mLibPath.GetFullPath();
575 }

References mLibPath.

Referenced by MP3Exporter::FindLibrary().

Here is the caller graph for this function:

◆ OnBrowse()

void FindDialog::OnBrowse ( wxCommandEvent &  WXUNUSEDevent)
inline

Definition at line 546 of file ExportMP3.cpp.

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

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

568 {
569 HelpSystem::ShowHelp(this, L"FAQ:Installing_the_LAME_MP3_Encoder");
570 }
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 498 of file ExportMP3.cpp.

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

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

◆ mName

wxString FindDialog::mName
private

Definition at line 585 of file ExportMP3.cpp.

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

◆ mPath

wxString FindDialog::mPath
private

Definition at line 584 of file ExportMP3.cpp.

Referenced by FindDialog().

◆ mPathText

wxTextCtrl* FindDialog::mPathText
private

Definition at line 589 of file ExportMP3.cpp.

Referenced by OnBrowse(), and PopulateOrExchange().

◆ mTypes

FileNames::FileTypes FindDialog::mTypes
private

Definition at line 586 of file ExportMP3.cpp.

Referenced by FindDialog(), and OnBrowse().


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