mirror of https://github.com/odrling/Aegisub
Use LocalScriptManager::Reload rather than looping over the scripts manually in the am/manager command
Originally committed to SVN as r5638.
This commit is contained in:
parent
af9315f1aa
commit
6d0e44baad
|
@ -59,30 +59,16 @@ namespace {
|
|||
/// Open automation manager.
|
||||
struct am_manager : public Command {
|
||||
CMD_NAME("am/manager")
|
||||
STR_MENU("&Automation..")
|
||||
STR_MENU("&Automation...")
|
||||
STR_DISP("Automation")
|
||||
STR_HELP("Open automation manager.")
|
||||
|
||||
void operator()(agi::Context *c) {
|
||||
#ifdef __APPLE__
|
||||
if (wxGetMouseState().CmdDown()) {
|
||||
#else
|
||||
if (wxGetMouseState().ControlDown()) {
|
||||
#endif
|
||||
wxGetApp().global_scripts->Reload();
|
||||
|
||||
if (wxGetMouseState().ShiftDown()) {
|
||||
const std::vector<Automation4::Script*>& scripts = c->local_scripts->GetScripts();
|
||||
for (size_t i = 0; i < scripts.size(); ++i) {
|
||||
try {
|
||||
scripts[i]->Reload();
|
||||
} catch (const char *e) {
|
||||
wxLogError(e);
|
||||
} catch (...) {
|
||||
wxLogError("An unknown error occurred reloading Automation script '%s'.", scripts[i]->GetName());
|
||||
}
|
||||
}
|
||||
|
||||
c->local_scripts->Reload();
|
||||
wxGetApp().frame->StatusTimeout(_("Reloaded all Automation scripts"));
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue