1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-11 09:31:13 +02:00

Changes to a number of dialogs so that the nvda screen reader can read their titles. The accessibility name of the dialog is set to the title of the dialog.

This commit is contained in:
David Bailes 2015-05-12 14:29:27 +01:00
parent a3b1803bf0
commit 66084b65ef
13 changed files with 22 additions and 0 deletions

View File

@ -177,6 +177,7 @@ AboutDialog::AboutDialog(wxWindow * parent)
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{ {
SetName(GetTitle());
this->SetBackgroundColour(theTheme.Colour( clrAboutBoxBackground )); this->SetBackgroundColour(theTheme.Colour( clrAboutBoxBackground ));
icon = NULL; icon = NULL;
ShuttleGui S( this, eIsCreating ); ShuttleGui S( this, eIsCreating );

View File

@ -1056,6 +1056,7 @@ void AudacityApp::GenerateCrashReport(wxDebugReport::Context ctx)
_("Audacity Support Data"), _("Audacity Support Data"),
rpt.GetCompressedFileName(), rpt.GetCompressedFileName(),
wxOK | wxCENTER); wxOK | wxCENTER);
dlg.SetName(dlg.GetTitle());
dlg.ShowModal(); dlg.ShowModal();
wxLogMessage(wxT("Report generated to: %s"), wxLogMessage(wxT("Report generated to: %s"),

View File

@ -165,6 +165,7 @@ void AudacityLogger::Show(bool show)
// This is the first use, so create the frame // This is the first use, so create the frame
wxFrame *frame = new wxFrame(NULL, wxID_ANY, _("Audacity Log")); wxFrame *frame = new wxFrame(NULL, wxID_ANY, _("Audacity Log"));
frame->SetName(frame->GetTitle());
frame->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); frame->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
// loads either the XPM or the windows resource, depending on the platform // loads either the XPM or the windows resource, depending on the platform

View File

@ -200,6 +200,8 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
mBitmap(NULL), mBitmap(NULL),
mAnalyst(new SpectrumAnalyst()) mAnalyst(new SpectrumAnalyst())
{ {
SetName(GetTitle());
mMouseX = 0; mMouseX = 0;
mMouseY = 0; mMouseY = 0;
mRate = 0; mRate = 0;

View File

@ -54,6 +54,8 @@ HistoryWindow::HistoryWindow(AudacityProject *parent, UndoManager *manager):
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ) wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
{ {
SetName(GetTitle());
mManager = manager; mManager = manager;
mProject = parent; mProject = parent;
mSelected = 0; mSelected = 0;

View File

@ -105,6 +105,8 @@ LabelDialog::LabelDialog(wxWindow *parent,
mRate(rate), mRate(rate),
mFormat(format) mFormat(format)
{ {
SetName(GetTitle());
// Create the main sizer // Create the main sizer
wxBoxSizer *vs = new wxBoxSizer(wxVERTICAL); wxBoxSizer *vs = new wxBoxSizer(wxVERTICAL);

View File

@ -6356,6 +6356,7 @@ void AudacityProject::OnAudioDeviceInfo()
wxString info = gAudioIO->GetDeviceInfo(); wxString info = gAudioIO->GetDeviceInfo();
wxDialog dlg(this, wxID_ANY, wxString(_("Audio Device Info"))); wxDialog dlg(this, wxID_ANY, wxString(_("Audio Device Info")));
dlg.SetName(dlg.GetTitle());
ShuttleGui S(&dlg, eIsCreating); ShuttleGui S(&dlg, eIsCreating);
wxTextCtrl *text; wxTextCtrl *text;
@ -6488,6 +6489,7 @@ void AudacityProject::OnResample()
while (true) while (true)
{ {
wxDialog dlg(this, wxID_ANY, wxString(_("Resample"))); wxDialog dlg(this, wxID_ANY, wxString(_("Resample")));
dlg.SetName(dlg.GetTitle());
ShuttleGui S(&dlg, eIsCreating); ShuttleGui S(&dlg, eIsCreating);
wxString rate; wxString rate;
wxArrayString rates; wxArrayString rates;

View File

@ -664,6 +664,8 @@ TagsEditor::TagsEditor(wxWindow * parent,
mEditTitle(editTitle), mEditTitle(editTitle),
mEditTrack(editTrack) mEditTrack(editTrack)
{ {
SetName(GetTitle());
names[0] = LABEL_ARTIST; names[0] = LABEL_ARTIST;
names[1] = LABEL_TITLE; names[1] = LABEL_TITLE;
names[2] = LABEL_ALBUM; names[2] = LABEL_ALBUM;

View File

@ -70,6 +70,8 @@ TimerRecordDialog::TimerRecordDialog(wxWindow* parent)
: wxDialog(parent, -1, _("Audacity Timer Record"), wxDefaultPosition, : wxDialog(parent, -1, _("Audacity Timer Record"), wxDefaultPosition,
wxDefaultSize, wxCAPTION) wxDefaultSize, wxCAPTION)
{ {
SetName(GetTitle());
m_DateTime_Start = wxDateTime::UNow(); m_DateTime_Start = wxDateTime::UNow();
long seconds; // default duration is 1 hour = 3600 seconds long seconds; // default duration is 1 hour = 3600 seconds
gPrefs->Read(wxT("/TimerRecord/LastDuration"), &seconds, 3600); gPrefs->Read(wxT("/TimerRecord/LastDuration"), &seconds, 3600);

View File

@ -227,6 +227,8 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id,
wxDialog(parent, id, title, pos, wxDefaultSize, wxDialog(parent, id, title, pos, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX ) wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX )
{ {
SetName(GetTitle());
foregrounddB = 1234.0; foregrounddB = 1234.0;
backgrounddB = 1234.0; backgrounddB = 1234.0;

View File

@ -236,6 +236,7 @@ static wxString AskCopyOrEdit()
if (oldAskPref) { if (oldAskPref) {
wxString newCopyPref = wxT("copy"); wxString newCopyPref = wxT("copy");
wxDialog dialog(NULL, -1, wxString(_("Warning"))); wxDialog dialog(NULL, -1, wxString(_("Warning")));
dialog.SetName(dialog.GetTitle());
wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL); wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL);
dialog.SetSizer(vbox); dialog.SetSizer(vbox);

View File

@ -92,6 +92,7 @@ int wxTreebookExt::ChangeSelection(size_t n) {
int i = wxTreebook::ChangeSelection(n); int i = wxTreebook::ChangeSelection(n);
wxString Temp = GetPageText( n ); wxString Temp = GetPageText( n );
((wxDialog*)GetParent())->SetTitle( Temp ); ((wxDialog*)GetParent())->SetTitle( Temp );
((wxDialog*)GetParent())->SetName( Temp );
return i; return i;
}; };
@ -100,6 +101,7 @@ int wxTreebookExt::SetSelection(size_t n)
int i = wxTreebook::SetSelection(n); int i = wxTreebook::SetSelection(n);
wxString Temp = wxString(_("Preferences: ")) + GetPageText( n ); wxString Temp = wxString(_("Preferences: ")) + GetPageText( n );
((wxDialog*)GetParent())->SetTitle( Temp ); ((wxDialog*)GetParent())->SetTitle( Temp );
((wxDialog*)GetParent())->SetName( Temp );
return i; return i;
} }

View File

@ -56,6 +56,8 @@ WarningDialog::WarningDialog(wxWindow *parent, wxString message, bool showCancel
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
(showCancelButton ? wxDEFAULT_DIALOG_STYLE : wxCAPTION | wxSYSTEM_MENU)) // Unlike wxDEFAULT_DIALOG_STYLE, no wxCLOSE_BOX. (showCancelButton ? wxDEFAULT_DIALOG_STYLE : wxCAPTION | wxSYSTEM_MENU)) // Unlike wxDEFAULT_DIALOG_STYLE, no wxCLOSE_BOX.
{ {
SetName(GetTitle());
SetIcon(wxArtProvider::GetIcon(wxART_WARNING, wxART_MESSAGE_BOX)); SetIcon(wxArtProvider::GetIcon(wxART_WARNING, wxART_MESSAGE_BOX));
ShuttleGui S(this, eIsCreating); ShuttleGui S(this, eIsCreating);