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

Constructor & Destructor Documentation

◆ FindDialog()

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

Definition at line 482 of file ExportMP3.cpp.

484 : wxDialogWrapper(parent, wxID_ANY,
485 /* i18n-hint: LAME is the name of an MP3 converter and should not be translated*/
486 XO("Locate LAME"))
487 {
488 SetName();
489 ShuttleGui S(this, eIsCreating);
490
491 mPath = path;
492 mName = name;
493 mTypes = std::move( types );
494
495 mLibPath.Assign(mPath, mName);
496
498 }
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:584
FileNames::FileTypes mTypes
Definition: ExportMP3.cpp:588
wxString mPath
Definition: ExportMP3.cpp:586
void PopulateOrExchange(ShuttleGui &S)
Definition: ExportMP3.cpp:500
wxString mName
Definition: ExportMP3.cpp:587
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 574 of file ExportMP3.cpp.

575 {
576 return mLibPath.GetFullPath();
577 }

References mLibPath.

Referenced by MP3Exporter::FindLibrary().

Here is the caller graph for this function:

◆ OnBrowse()

void FindDialog::OnBrowse ( wxCommandEvent &  WXUNUSEDevent)
inline

Definition at line 548 of file ExportMP3.cpp.

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

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

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

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

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

◆ mName

wxString FindDialog::mName
private

Definition at line 587 of file ExportMP3.cpp.

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

◆ mPath

wxString FindDialog::mPath
private

Definition at line 586 of file ExportMP3.cpp.

Referenced by FindDialog().

◆ mPathText

wxTextCtrl* FindDialog::mPathText
private

Definition at line 591 of file ExportMP3.cpp.

Referenced by OnBrowse(), and PopulateOrExchange().

◆ mTypes

FileNames::FileTypes FindDialog::mTypes
private

Definition at line 588 of file ExportMP3.cpp.

Referenced by FindDialog(), and OnBrowse().


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