mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-16 08:34:10 +02:00
Bug 2274 - Enh: Dialog for orphan block files has no "?" Help button
also Bug 2273 - Enh: Dialog for missing block files has no "?" Help button These now link to the appropriate page in the manual.
This commit is contained in:
parent
b85a393af4
commit
41619af8cd
@ -279,7 +279,9 @@ void ModuleManager::Initialize(CommandHandler &cmdHandler)
|
||||
int action;
|
||||
action = ShowMultiDialog(msg, XO("Audacity Module Loader"),
|
||||
buttons,
|
||||
XO("Try and load this module?"), false);
|
||||
"",
|
||||
XO("Try and load this module?"),
|
||||
false);
|
||||
#ifdef EXPERIMENTAL_MODULE_PREFS
|
||||
// If we're not prompting always, accept the answer permanantly
|
||||
if( iModuleStatus == kModuleNew ){
|
||||
|
@ -61,7 +61,9 @@ int ProjectFSCK(
|
||||
XO("Continue with repairs noted in log, and check for more errors. This will save the project in its current state, unless you \"Close project immediately\" on further error alerts.")
|
||||
};
|
||||
wxLog::FlushActive(); // MultiDialog has "Show Log..." button, so make sure log is current.
|
||||
action = ShowMultiDialog(msg, XO("Warning - Problems Reading Sequence Tags"), buttons);
|
||||
action = ShowMultiDialog(msg,
|
||||
XO("Warning - Problems Reading Sequence Tags"),
|
||||
buttons,"");
|
||||
if (action == 0)
|
||||
nResult = FSCKstatus_CLOSE_REQ;
|
||||
else
|
||||
@ -117,7 +119,10 @@ XO("Project check of \"%s\" folder \
|
||||
XO("Replace missing audio with silence (permanent immediately)."),
|
||||
};
|
||||
wxLog::FlushActive(); // MultiDialog has "Show Log..." button, so make sure log is current.
|
||||
action = ShowMultiDialog(msg, XO("Warning - Missing Aliased File(s)"), buttons);
|
||||
action = ShowMultiDialog(msg,
|
||||
XO("Warning - Missing Aliased File(s)"),
|
||||
buttons,
|
||||
"");
|
||||
}
|
||||
|
||||
if (action == 0)
|
||||
@ -195,7 +200,10 @@ XO("Project check of \"%s\" folder \
|
||||
XO("Close project immediately with no further changes"),
|
||||
};
|
||||
wxLog::FlushActive(); // MultiDialog has "Show Log..." button, so make sure log is current.
|
||||
action = ShowMultiDialog(msg, XO("Warning - Missing Alias Summary File(s)"), buttons);
|
||||
action = ShowMultiDialog(msg,
|
||||
XO("Warning - Missing Alias Summary File(s)"),
|
||||
buttons,
|
||||
"");
|
||||
}
|
||||
|
||||
if (action == 2)
|
||||
@ -268,7 +276,10 @@ XO("Project check of \"%s\" folder \
|
||||
XO("Replace missing audio with silence (permanent immediately)"),
|
||||
};
|
||||
wxLog::FlushActive(); // MultiDialog has "Show Log..." button, so make sure log is current.
|
||||
action = ShowMultiDialog(msg, XO("Warning - Missing Audio Data Block File(s)"), buttons);
|
||||
action = ShowMultiDialog(msg,
|
||||
XO("Warning - Missing Audio Data Block File(s)"),
|
||||
buttons,
|
||||
"Warning_-_Missing_Audio_Data_Block_Files");
|
||||
}
|
||||
|
||||
if (action == 0)
|
||||
@ -340,7 +351,11 @@ other projects. \
|
||||
XO("Delete orphan files (permanent immediately)"),
|
||||
};
|
||||
wxLog::FlushActive(); // MultiDialog has "Show Log..." button, so make sure log is current.
|
||||
action = ShowMultiDialog(msg, XO("Warning - Orphan Block File(s)"), buttons);
|
||||
action = ShowMultiDialog(msg,
|
||||
XO("Warning - Orphan Block File(s)"),
|
||||
buttons,
|
||||
"Warning_-_Orphan_Block_Files"
|
||||
);
|
||||
}
|
||||
|
||||
if (action == 1)
|
||||
|
@ -36,6 +36,9 @@ for each problem encountered, since there can be many orphans.
|
||||
|
||||
#include "../AudacityLogger.h"
|
||||
#include "wxPanelWrapper.h"
|
||||
#include "../Theme.h"
|
||||
#include "../AllThemeResources.h"
|
||||
#include "../widgets/HelpSystem.h"
|
||||
|
||||
class MultiDialog final : public wxDialogWrapper
|
||||
{
|
||||
@ -44,14 +47,17 @@ public:
|
||||
const TranslatableString &message,
|
||||
const TranslatableString &title,
|
||||
const TranslatableStrings &buttons,
|
||||
const wxString &helpPage,
|
||||
const TranslatableString &boxMsg, bool log);
|
||||
~MultiDialog() {};
|
||||
|
||||
private:
|
||||
void OnOK( wxCommandEvent &event );
|
||||
void OnShowLog(wxCommandEvent& event);
|
||||
void OnHelp(wxCommandEvent& event);
|
||||
|
||||
wxRadioBox* mRadioBox;
|
||||
wxString mHelpPage;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
@ -61,16 +67,21 @@ private:
|
||||
BEGIN_EVENT_TABLE(MultiDialog, wxDialogWrapper)
|
||||
EVT_BUTTON( wxID_OK, MultiDialog::OnOK )
|
||||
EVT_BUTTON(ID_SHOW_LOG_BUTTON, MultiDialog::OnShowLog)
|
||||
EVT_BUTTON(wxID_HELP, MultiDialog::OnHelp)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
MultiDialog::MultiDialog(wxWindow * pParent,
|
||||
const TranslatableString &message,
|
||||
const TranslatableString &title,
|
||||
const TranslatableStrings &buttons,
|
||||
const TranslatableString &boxMsg, bool log)
|
||||
const wxString &helpPage,
|
||||
const TranslatableString &boxMsg,
|
||||
bool log
|
||||
)
|
||||
: wxDialogWrapper(pParent, wxID_ANY, title,
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxCAPTION) // not wxDEFAULT_DIALOG_STYLE because we don't want wxCLOSE_BOX and wxSYSTEM_MENU
|
||||
wxCAPTION), // not wxDEFAULT_DIALOG_STYLE because we don't want wxCLOSE_BOX and wxSYSTEM_MENU
|
||||
mHelpPage( helpPage)
|
||||
{
|
||||
SetName();
|
||||
|
||||
@ -120,17 +131,24 @@ MultiDialog::MultiDialog(wxWindow * pParent,
|
||||
if (log)
|
||||
{
|
||||
S
|
||||
.Id( ID_SHOW_LOG_BUTTON )
|
||||
.Id(ID_SHOW_LOG_BUTTON)
|
||||
.AddButton(
|
||||
XO("Show Log for Details"), wxALIGN_LEFT | wxALL,
|
||||
// set default to encourage user to look at files.
|
||||
true );
|
||||
true);
|
||||
|
||||
S.AddSpace( 40, 0 );
|
||||
S.AddSpace(40, 0);
|
||||
}
|
||||
|
||||
auto pButton = S.Id( wxID_OK )
|
||||
.AddButton( XO("OK"), wxALIGN_CENTER, !log );
|
||||
auto pButton = S.Id(wxID_OK)
|
||||
.AddButton(XO("OK"), wxALIGN_CENTER, !log);
|
||||
|
||||
if (!mHelpPage.IsEmpty()) {
|
||||
auto pHelpBtn = S.Id(wxID_HELP)
|
||||
.AddBitmapButton(theTheme.Bitmap(bmpHelpIcon), wxALIGN_CENTER, false);
|
||||
pHelpBtn->SetToolTip(XO("Help").Translation());
|
||||
pHelpBtn->SetLabel(XO("Help").Translation()); // for screen readers
|
||||
}
|
||||
}
|
||||
S.EndHorizontalLay();
|
||||
}
|
||||
@ -155,10 +173,15 @@ void MultiDialog::OnShowLog(wxCommandEvent & WXUNUSED(event))
|
||||
}
|
||||
}
|
||||
|
||||
void MultiDialog::OnHelp(wxCommandEvent & WXUNUSED(event))
|
||||
{
|
||||
HelpSystem::ShowHelp(FindWindow(wxID_HELP), mHelpPage, true);
|
||||
}
|
||||
|
||||
int ShowMultiDialog(const TranslatableString &message,
|
||||
const TranslatableString &title,
|
||||
const TranslatableStrings &buttons,
|
||||
const wxString &helpPage,
|
||||
const TranslatableString &boxMsg, bool log)
|
||||
{
|
||||
wxWindow * pParent = wxTheApp->GetTopWindow();
|
||||
@ -170,7 +193,7 @@ int ShowMultiDialog(const TranslatableString &message,
|
||||
pParent = NULL;
|
||||
}
|
||||
MultiDialog dlog(pParent,
|
||||
message, title, buttons, boxMsg, log);
|
||||
message, title, buttons, helpPage, boxMsg, log);
|
||||
// If dialog does not have a parent, cannot be centred on it.
|
||||
if (pParent != NULL)
|
||||
dlog.CentreOnParent();
|
||||
|
@ -27,6 +27,7 @@ const TranslatableString &DefaultMultiDialogMessage();
|
||||
int ShowMultiDialog(const TranslatableString &message,
|
||||
const TranslatableString &title,
|
||||
const TranslatableStrings &buttons,
|
||||
const wxString & helpPage,
|
||||
const TranslatableString &boxMsg
|
||||
= DefaultMultiDialogMessage(),
|
||||
bool log = true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user