mirror of https://github.com/odrling/Aegisub
Selectable thread priority for Auto4/Lua
Originally committed to SVN as r754.
This commit is contained in:
parent
c0b3721a7f
commit
34e0ef4145
|
@ -39,6 +39,7 @@
|
||||||
#include "ass_file.h"
|
#include "ass_file.h"
|
||||||
#include "ass_override.h"
|
#include "ass_override.h"
|
||||||
#include "text_file_reader.h"
|
#include "text_file_reader.h"
|
||||||
|
#include "options.h"
|
||||||
#include "../lua51/src/lualib.h"
|
#include "../lua51/src/lualib.h"
|
||||||
#include "../lua51/src/lauxlib.h"
|
#include "../lua51/src/lauxlib.h"
|
||||||
#include <wx/msgdlg.h>
|
#include <wx/msgdlg.h>
|
||||||
|
@ -413,7 +414,13 @@ namespace Automation4 {
|
||||||
, nargs(_nargs)
|
, nargs(_nargs)
|
||||||
, nresults(_nresults)
|
, nresults(_nresults)
|
||||||
{
|
{
|
||||||
|
int prio = Options.AsInt(_T("Automation Thread Priority"));
|
||||||
|
if (prio == 0) prio = 50; // normal
|
||||||
|
else if (prio == 1) prio = 30; // below normal
|
||||||
|
else if (prio == 2) prio = 10; // lowest
|
||||||
|
else prio = 50; // fallback normal
|
||||||
Create();
|
Create();
|
||||||
|
SetPriority(prio);
|
||||||
Run();
|
Run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -554,11 +554,16 @@ DialogOptions::DialogOptions(wxWindow *parent)
|
||||||
Bind(control,_T("Automation Autoload Path"));
|
Bind(control,_T("Automation Autoload Path"));
|
||||||
autoSizer2->Add(control,1,wxEXPAND);
|
autoSizer2->Add(control,1,wxEXPAND);
|
||||||
autoSizer2->Add(new wxStaticText(autoPage,-1,_("Trace level: ")),0,wxALIGN_CENTER_VERTICAL | wxRIGHT,10);
|
autoSizer2->Add(new wxStaticText(autoPage,-1,_("Trace level: ")),0,wxALIGN_CENTER_VERTICAL | wxRIGHT,10);
|
||||||
wxString choices[6] = { _("0: Fatal"), _("1: Error"), _("2: Warning"), _("3: Hint"), _("4: Debug"), _("5: Trace") };
|
wxString trace_choices[6] = { _("0: Fatal"), _("1: Error"), _("2: Warning"), _("3: Hint"), _("4: Debug"), _("5: Trace") };
|
||||||
control = new wxComboBox(autoPage,-1,_T(""),wxDefaultPosition,wxDefaultSize,6,choices,wxCB_READONLY | wxCB_DROPDOWN);
|
control = new wxComboBox(autoPage,-1,_T(""),wxDefaultPosition,wxDefaultSize,6,trace_choices,wxCB_READONLY | wxCB_DROPDOWN);
|
||||||
Bind(control,_T("Automation Trace Level"));
|
Bind(control,_T("Automation Trace Level"));
|
||||||
autoSizer2->Add(control,1,wxEXPAND);
|
autoSizer2->Add(control,1,wxEXPAND);
|
||||||
autoSizer2->AddGrowableCol(1,1);
|
autoSizer2->AddGrowableCol(1,1);
|
||||||
|
autoSizer2->Add(new wxStaticText(autoPage,-1,_("Thread priority: ")),0,wxALIGN_CENTER_VERTICAL | wxRIGHT,10);
|
||||||
|
wxString prio_choices[3] = { _("Normal"), _("Below Normal (recommended)"), _("Lowest") };
|
||||||
|
control = new wxComboBox(autoPage,-1,_T(""),wxDefaultPosition,wxDefaultSize,3,prio_choices,wxCB_READONLY|wxCB_DROPDOWN);
|
||||||
|
Bind(control, _T("Automation Thread Priority"));
|
||||||
|
autoSizer2->Add(control, 1, wxEXPAND);
|
||||||
|
|
||||||
// Sizers
|
// Sizers
|
||||||
autoSizer1->Add(autoSizer2,1,wxEXPAND | wxALL,5);
|
autoSizer1->Add(autoSizer2,1,wxEXPAND | wxALL,5);
|
||||||
|
|
|
@ -167,6 +167,7 @@ void OptionsManager::LoadDefaults() {
|
||||||
SetText(_T("Automation Include Path"), AegisubApp::folderName + _T("automation/include/"));
|
SetText(_T("Automation Include Path"), AegisubApp::folderName + _T("automation/include/"));
|
||||||
SetText(_T("Automation Autoload Path"), AegisubApp::folderName + _T("automation/autoload/"));
|
SetText(_T("Automation Autoload Path"), AegisubApp::folderName + _T("automation/autoload/"));
|
||||||
SetInt(_T("Automation Trace Level"), 3);
|
SetInt(_T("Automation Trace Level"), 3);
|
||||||
|
SetInt(_T("Automation Thread Priority"), 1); // "below normal"
|
||||||
|
|
||||||
// Generate colors
|
// Generate colors
|
||||||
wxColour tempCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
|
wxColour tempCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
|
||||||
|
|
Loading…
Reference in New Issue