replace ::cast_dynamic() with relevant ActionManager::get_*_action() calls
[ardour.git] / gtk2_ardour / script_selector.cc
index ea28c414b60304b30984de2b881c6aaf0d1d0c66..94233021dc74f955df3d2c1c5b972c8594077e4a 100644 (file)
@@ -79,7 +79,7 @@ ScriptSelector::ScriptSelector (std::string title, LuaScriptInfo::ScriptType typ
 
        setup_list ();
        show_all ();
-       
+
        script_combo_changed();
 }
 
@@ -88,27 +88,29 @@ 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
 ScriptSelector::setup_list ()
 {
        _combocon.block();
-       
+
        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);
                }
        }
-       
+
        _script_combo.clear();
-       _script_combo.set_row_separator_func ( sigc::mem_fun (*this, &ScriptSelector::script_separator) );
+       _script_combo.set_row_separator_func (sigc::mem_fun (*this, &ScriptSelector::script_separator));
+
+       if (_script_type == LuaScriptInfo::EditorAction) {
+               _script_combo.append_text ("Shortcut");
+               _script_combo.append_text ("--separator--");
+       }
 
-       _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) {
                _script_combo.append_text (*i);
@@ -126,14 +128,14 @@ ScriptSelector::script_combo_changed ()
        std::string nm = _script_combo.get_active_text();
 
        for (LuaScriptList::const_iterator s = _scripts.begin(); s != _scripts.end(); ++s) {
-               if ( (*s)->name == nm ) {
+               if ((*s)->name == nm) {
                        _script = (*s);
                }
        }
 
        if (_script) {
-               
-               if (_script->name == "Shortcut" ) {
+
+               if (_script->name == "Shortcut") {
                        _type.hide();
                        _type_label.hide();
                        _author.hide();