1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-07 12:12:23 +01:00

bug 26 followup - warn of missing alias on variety of instances (export/import/effect/mix,) in addition to first time the read fails.\nIn addition make sure there is only one warning on the screen at a time, bringing the old one to the foreground (although for things like export/effect there will be a progress bar in front of it, the missing files dialog will be above the project window when it finishes)

This commit is contained in:
mchinen
2011-03-23 01:01:17 +00:00
parent 686f3796ae
commit dc12d8a8f4
6 changed files with 120 additions and 9 deletions

View File

@@ -35,6 +35,9 @@ Gives an Error message with an option for help.
#include "../Internat.h"
#include "../Project.h"
#include "../Prefs.h"
#include "../AudioIO.h"
class ErrorDialog : public wxDialog
{
@@ -46,6 +49,8 @@ class ErrorDialog : public wxDialog
const wxString & helpURL,
const bool Close = true, const bool modal = true);
virtual ~ErrorDialog(){}
private:
wxString dhelpURL;
bool dClose;
@@ -57,11 +62,39 @@ private:
};
// special case for alias missing dialog because we keep track of if it exists.
class AliasedFileMissingDialog : public ErrorDialog
{
public:
AliasedFileMissingDialog(wxWindow *parent,
const wxString & dlogTitle,
const wxString & message,
const wxString & helpURL,
const bool Close = true, const bool modal = true);
virtual ~AliasedFileMissingDialog();
};
BEGIN_EVENT_TABLE(ErrorDialog, wxDialog)
EVT_BUTTON( wxID_OK, ErrorDialog::OnOk)
EVT_BUTTON( wxID_HELP, ErrorDialog::OnHelp)
END_EVENT_TABLE()
AliasedFileMissingDialog::AliasedFileMissingDialog(wxWindow *parent,
const wxString & dlogTitle,
const wxString & message,
const wxString & helpURL,
const bool Close, const bool modal):
ErrorDialog(parent, dlogTitle, message, helpURL, Close, modal)
{
gAudioIO->SetMissingAliasFileDialog(this);
}
AliasedFileMissingDialog::~AliasedFileMissingDialog()
{
gAudioIO->SetMissingAliasFileDialog(NULL);
}
ErrorDialog::ErrorDialog(
wxWindow *parent,
const wxString & dlogTitle,
@@ -272,6 +305,27 @@ void ShowModelessErrorDialog(wxWindow *parent,
dlog->Show();
}
void ShowAliasMissingDialog(wxWindow *parent,
const wxString &dlogTitle,
const wxString &message,
const wxString &helpURL,
const bool Close)
{
ErrorDialog *dlog = new AliasedFileMissingDialog(parent, dlogTitle, message, helpURL, Close, false);
// Don't center because in many cases (effect, export, etc) there will be a progress bar in the center that blocks this.
// instead put it just above or on the top of the project.
wxPoint point;
point.x = 0;
point.y = parent ? parent->GetPosition().y - 200 : 100;
if (point.y < 100)
point.y = 100;
dlog->SetPosition(point);
dlog->CentreOnParent(wxHORIZONTAL);
dlog->Show();
}
/// Mostly we use this so that we have the code for resizability
/// in one place. Other considerations like screen readers are also