mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
Connect Script Manager "Edit" -> Lua Scripting Window
This commit is contained in:
parent
ceb7884380
commit
05149f9bc5
3 changed files with 15 additions and 15 deletions
|
|
@ -24,6 +24,7 @@
|
||||||
#include "LuaBridge/LuaBridge.h"
|
#include "LuaBridge/LuaBridge.h"
|
||||||
|
|
||||||
#include "lua_script_manager.h"
|
#include "lua_script_manager.h"
|
||||||
|
#include "luawindow.h"
|
||||||
#include "script_selector.h"
|
#include "script_selector.h"
|
||||||
#include "pbd/i18n.h"
|
#include "pbd/i18n.h"
|
||||||
|
|
||||||
|
|
@ -226,7 +227,7 @@ LuaScriptManager::action_selection_changed ()
|
||||||
|
|
||||||
if (row && row[_a_model.enabled]) {
|
if (row && row[_a_model.enabled]) {
|
||||||
_a_del_button.set_sensitive (true);
|
_a_del_button.set_sensitive (true);
|
||||||
_a_edit_button.set_sensitive (false); // TODO
|
_a_edit_button.set_sensitive (true);
|
||||||
_a_call_button.set_sensitive (true);
|
_a_call_button.set_sensitive (true);
|
||||||
} else {
|
} else {
|
||||||
_a_del_button.set_sensitive (false);
|
_a_del_button.set_sensitive (false);
|
||||||
|
|
@ -276,20 +277,7 @@ LuaScriptManager::edit_action_btn_clicked ()
|
||||||
if (!li->lua_action (id, name, script, args)) {
|
if (!li->lua_action (id, name, script, args)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
LuaWindow::instance()->edit_script (name, script);
|
||||||
// TODO text-editor window, update script directly
|
|
||||||
|
|
||||||
if (!LuaScripting::try_compile (script, args)) {
|
|
||||||
// compilation failed, keep editing
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (li->set_lua_action (id, name, script, args)) {
|
|
||||||
// OK
|
|
||||||
} else {
|
|
||||||
// load failed, keep editing..
|
|
||||||
}
|
|
||||||
action_selection_changed ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -322,6 +322,17 @@ LuaWindow::clear_output ()
|
||||||
tb->set_text ("");
|
tb->set_text ("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LuaWindow::edit_script (const std::string& name, const std::string& script)
|
||||||
|
{
|
||||||
|
ScriptBuffer* sb = new LuaWindow::ScriptBuffer (name);
|
||||||
|
sb->script = script;
|
||||||
|
script_buffers.push_back (ScriptBufferPtr (sb));
|
||||||
|
script_selection_changed (script_buffers.back ());
|
||||||
|
refresh_scriptlist ();
|
||||||
|
show_window ();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LuaWindow::new_script ()
|
LuaWindow::new_script ()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ class LuaWindow :
|
||||||
|
|
||||||
void show_window ();
|
void show_window ();
|
||||||
bool hide_window (GdkEventAny *ev);
|
bool hide_window (GdkEventAny *ev);
|
||||||
|
void edit_script (const std::string&, const std::string&);
|
||||||
|
|
||||||
void set_session (ARDOUR::Session* s);
|
void set_session (ARDOUR::Session* s);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue