mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-24 14:20:19 +01:00
Multiple export dialog bugs fixed
Bug 2062 - Export as WAV does not remember the previously used setting
Bug 1355 - "Other uncompressed files" does not (visually) update target
file extension according to the chosen "Header" type
Bug 1356 - "Other uncompressed files" forces the default extension for
the format in the exported file
Bug 1381 - Export other uncompressed formats incorrectly assumes max 255
channels
(and possibly others...not the best bugzilla searcher)
This commit is contained in:
@@ -472,6 +472,35 @@ int FileDialog::ShowModal()
|
||||
return wxDialog::ShowModal();
|
||||
}
|
||||
|
||||
// Change the currently displayed extension
|
||||
void FileDialog::SetFileExtension(const wxString& extension)
|
||||
{
|
||||
wxString filename;
|
||||
|
||||
#if defined(__WXGTK3__)
|
||||
filename = wxString::FromUTF8(gtk_file_chooser_get_current_name(m_fc));
|
||||
#else
|
||||
GtkWidget *entry = find_widget(m_widget, "GtkFileChooserEntry", 0);
|
||||
if (entry)
|
||||
{
|
||||
filename = wxString::FromUTF8(gtk_entry_get_text(GTK_ENTRY(entry)));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (filename == wxEmptyString)
|
||||
{
|
||||
filename = m_fc.GetFilename();
|
||||
}
|
||||
|
||||
if (filename != wxEmptyString)
|
||||
{
|
||||
wxFileName fn(filename);
|
||||
fn.SetExt(extension);
|
||||
|
||||
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(m_widget), fn.GetFullName().utf8_str());
|
||||
}
|
||||
}
|
||||
|
||||
void FileDialog::DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
|
||||
int WXUNUSED(width), int WXUNUSED(height),
|
||||
int WXUNUSED(sizeFlags))
|
||||
@@ -571,7 +600,7 @@ void FileDialog::SetWildcard(const wxString& wildCard)
|
||||
|
||||
void FileDialog::SetFilterIndex(int filterIndex)
|
||||
{
|
||||
m_fc.SetFilterIndex( filterIndex);
|
||||
m_fc.SetFilterIndex( filterIndex );
|
||||
}
|
||||
|
||||
int FileDialog::GetFilterIndex() const
|
||||
|
||||
@@ -25,23 +25,23 @@ public:
|
||||
FileDialog() { }
|
||||
|
||||
FileDialog(wxWindow *parent,
|
||||
const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& defaultDir = wxEmptyString,
|
||||
const wxString& defaultFile = wxEmptyString,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
long style = wxFD_DEFAULT_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& sz = wxDefaultSize,
|
||||
const wxString& name = wxFileDialogNameStr);
|
||||
const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& defaultDir = wxEmptyString,
|
||||
const wxString& defaultFile = wxEmptyString,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
long style = wxFD_DEFAULT_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& sz = wxDefaultSize,
|
||||
const wxString& name = wxFileDialogNameStr);
|
||||
bool Create(wxWindow *parent,
|
||||
const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& defaultDir = wxEmptyString,
|
||||
const wxString& defaultFile = wxEmptyString,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
long style = wxFD_DEFAULT_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& sz = wxDefaultSize,
|
||||
const wxString& name = wxFileDialogNameStr);
|
||||
const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& defaultDir = wxEmptyString,
|
||||
const wxString& defaultFile = wxEmptyString,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
long style = wxFD_DEFAULT_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& sz = wxDefaultSize,
|
||||
const wxString& name = wxFileDialogNameStr);
|
||||
virtual ~FileDialog();
|
||||
|
||||
virtual wxString GetPath() const;
|
||||
@@ -61,6 +61,8 @@ public:
|
||||
|
||||
virtual bool SupportsExtraControl() const { return true; }
|
||||
|
||||
virtual void SetFileExtension(const wxString& extension);
|
||||
|
||||
// Implementation only.
|
||||
void GTKSelectionChanged(const wxString& filename);
|
||||
void GTKFolderChanged();
|
||||
|
||||
Reference in New Issue
Block a user