diff options
author | Robin Gareus <robin@gareus.org> | 2018-03-19 15:43:07 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2018-03-19 15:43:07 +0100 |
commit | ecb6e7fcfe2ea4637824408dd5134592a49a36cb (patch) | |
tree | 18751705dcc8beec8cfd6a8c9d409292c2633098 /gtk2_ardour/script_selector.cc | |
parent | 2fa6314fb44f5136ce726408dc907dc5ff3b6cea (diff) |
Fix "Shortcut" special-case in the script-selector.
The Script-selector is used in various places, not just for
Action-scripts.
Also add a "--" prefix for the separator to avoid name conflicts with
actual script names.
Diffstat (limited to 'gtk2_ardour/script_selector.cc')
-rw-r--r-- | gtk2_ardour/script_selector.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gtk2_ardour/script_selector.cc b/gtk2_ardour/script_selector.cc index 28488a7b99..94233021dc 100644 --- a/gtk2_ardour/script_selector.cc +++ b/gtk2_ardour/script_selector.cc @@ -88,7 +88,7 @@ ScriptSelector::script_separator (const Glib::RefPtr<Gtk::TreeModel> &, const Gt { _script_combo.set_active (i); - return _script_combo.get_active_text () == "separator"; + return _script_combo.get_active_text () == "--separator--"; } void @@ -98,7 +98,7 @@ ScriptSelector::setup_list () vector<string> script_names; for (LuaScriptList::const_iterator s = _scripts.begin(); s != _scripts.end(); ++s) { - if ((*s)->name != "Shortcut") { + if ((*s)->name != "Shortcut" || _script_type != LuaScriptInfo::EditorAction) { script_names.push_back ((*s)->name); } } @@ -106,8 +106,10 @@ ScriptSelector::setup_list () _script_combo.clear(); _script_combo.set_row_separator_func (sigc::mem_fun (*this, &ScriptSelector::script_separator)); - _script_combo.append_text ("Shortcut"); - _script_combo.append_text ("separator"); + if (_script_type == LuaScriptInfo::EditorAction) { + _script_combo.append_text ("Shortcut"); + _script_combo.append_text ("--separator--"); + } vector<string>::const_iterator i; for (i = script_names.begin(); i != script_names.end(); ++i) { |