| 208 | } |
| 209 | |
| 210 | void PluginStartupRegistration::Run(std::chrono::seconds timeout) |
| 211 | { |
| 212 | PluginScanDialog dialog(nullptr, wxID_ANY, XO("Searching for plugins")); |
| 213 | wxTimer timeoutTimer(&dialog, OnPluginScanTimeout); |
| 214 | mScanDialog = &dialog; |
| 215 | mTimeoutTimer = &timeoutTimer; |
| 216 | mTimeout = timeout; |
| 217 | |
| 218 | dialog.Bind(wxEVT_BUTTON, [this](wxCommandEvent& evt) { |
| 219 | evt.Skip(); |
| 220 | if(evt.GetId() == wxID_IGNORE) |
| 221 | Skip(); |
| 222 | }); |
| 223 | dialog.Bind(wxEVT_TIMER, [this](wxTimerEvent& evt) { |
| 224 | if(evt.GetId() == OnPluginScanTimeout) |
| 225 | { |
| 226 | if(mValidator && mValidator->InactiveSince() < mRequestStartTime) |
| 227 | Skip(); |
| 228 | //else |
| 229 | // wxMessageBox("Please check for plugin popups!"); |
| 230 | } |
| 231 | else |
| 232 | evt.Skip(); |
| 233 | }); |
| 234 | dialog.Bind(wxEVT_CLOSE_WINDOW, [this](wxCloseEvent& evt) { |
| 235 | evt.Skip(); |
| 236 | mValidator.reset(); |
| 237 | PluginManager::Get().Save(); |
| 238 | PluginManager::Get().NotifyPluginsChanged(); |
| 239 | }); |
| 240 | |
| 241 | dialog.CenterOnScreen(); |
| 242 | ProcessNext(); |
| 243 | dialog.ShowModal(); |
| 244 | } |
| 245 | |
| 246 | void PluginStartupRegistration::Stop() |
| 247 | { |
nothing calls this directly
no test coverage detected