14#include <wx/stattext.h>
15#include <wx/textctrl.h>
27 const std::vector<wxString>& plugins,
31 , m_scanType(scanType)
34 auto layout = std::make_unique<wxBoxSizer>(wxVERTICAL);
36 layout->AddSpacer(40);
38 auto header =
safenew wxStaticText(
this, wxID_ANY,
_(
"Incompatible plugin(s) found"));
39 header->SetFont(wxFont(wxFontInfo(12).Bold(
true)));
40 layout->Add(header, 0, wxLEFT | wxRIGHT, 40);
41 layout->AddSpacer(10);
43 mText =
safenew wxStaticText(
this, wxID_ANY, wxEmptyString);
44 mText->SetFont(wxFont(wxFontInfo(10)));
46 layout->Add(
mText, 0, wxLEFT | wxRIGHT, 40);
47 layout->AddSpacer(40);
49 mPluginList =
safenew wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY | wxTE_MULTILINE | wxNO_BORDER);
50 layout->Add(
mPluginList, 1, wxEXPAND | wxLEFT | wxRIGHT, 40);
52 auto buttonsLayout = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
56 auto pluginManagerButton =
safenew wxButton(
this, wxID_ANY,
_(
"&Manage Plugins"));
58 buttonsLayout->Add(pluginManagerButton);
60 buttonsLayout->AddSpacer(15);
63 auto continueButton =
safenew wxButton(
this, wxID_OK,
68 continueButton->SetDefault();
69 continueButton->SetFocusFromKbd();
71 buttonsLayout->Add(continueButton);
72 layout->Add(buttonsLayout.release(), 0, wxALIGN_RIGHT | wxALL, 15);
77 SetSizer(layout.release());
85 "Audacity has found %d incompatible plugins which could "\
86 "not be loaded. We have disabled these plugins to avoid any "\
87 "stalling or crashes. If you would still like to attempt "\
88 "to use these plugins, you can enable them using "\
89 "\"Manage Plugins\". Otherwise, select \"Continue\".")
90 .
Format(
static_cast<int>(plugins.size())).Translation());
95 "Audacity has found %d incompatible plugins which could "\
96 "not be loaded. We have disabled these plugins to avoid any "\
97 "stalling or crashes.")
98 .
Format(
static_cast<int>(plugins.size())).Translation());
100 mText->Wrap(GetClientSize().GetWidth() - 80);
102 wxString pluginListText;
103 for(
const auto& path : plugins)
104 pluginListText += path +
"\n";
115 if(dlg.ShowModal() == wxID_OK)
Toolkit-neutral facade for basic user interface services.
void OnContinueClicked(wxCommandEvent &)
void OnPluginManagerClicked(wxCommandEvent &)
void SetPlugins(const std::vector< wxString > &plugins)
IncompatiblePluginsDialog(wxWindow *parent, wxWindowID id, ScanType scanType, const std::vector< wxString > &plugins={ }, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
void CallAfter(Action action)
Schedule an action to be done later, and in the main thread.