Ctrl/Ctrl+Shift click Automation toolbar button to reload autoload/all scripts.

Originally committed to SVN as r1318.
This commit is contained in:
Niels Martin Hansen 2007-06-30 19:21:06 +00:00
parent 336f0621d7
commit 3e411f1eed
2 changed files with 29 additions and 4 deletions

View File

@ -12,6 +12,7 @@ Please visit http://aegisub.net to download latest version
o It is now possible to write macros that manipulate subtitles directly
o Scripts have full access to the entire subtitle file, not only the "Events" section
o Scripts are automatically reloaded when the Export dialog is opened (this can be changed in Options)
- Ctrl or Ctrl+Shift click on the Automation toolbar button to reload autoload/all scripts
- Video mode changes:
o It has been mostly rewriten and now uses OpenGL instead of software rendering, making it much faster on computers with video cards that don't belong to the stone age. (AMZ)
o Optionally, it can use a Pixel Shader to convert YV12 to RGB32 in hardware, which is much faster, with a decent video card. (AMZ)

View File

@ -696,7 +696,7 @@ void FrameMain::OnExportSubtitles(wxCommandEvent & WXUNUSED(event)) {
}
}
}
if (autoreload & 1) {
if (autoreload & 2) {
// Global scripts
wxGetApp().global_scripts->Reload();
}
@ -954,9 +954,33 @@ void FrameMain::OnOpenLog (wxCommandEvent &event) {
///////////////////
// Open Automation
void FrameMain::OnOpenAutomation (wxCommandEvent &event) {
VideoContext::Get()->Stop();
DialogAutomation dlg(this, local_scripts);
dlg.ShowModal();
if (wxGetMouseState().ControlDown()) {
wxGetApp().global_scripts->Reload();
if (wxGetMouseState().ShiftDown()) {
const std::vector<Automation4::Script*> scripts = local_scripts->GetScripts();
for (size_t i = 0; i < scripts.size(); ++i) {
try {
scripts[i]->Reload();
}
catch (const wchar_t *e) {
wxLogError(e);
}
catch (...) {
wxLogError(_T("An unknown error occurred reloading Automation script '%s'."), scripts[i]->GetName().c_str());
}
}
StatusTimeout(_("Reloaded all Automation scripts"));
}
else {
StatusTimeout(_("Reloaded autoload Automation scripts"));
}
}
else {
VideoContext::Get()->Stop();
DialogAutomation dlg(this, local_scripts);
dlg.ShowModal();
}
}