/*
- * Copyright (C) 2016 Robin Gareus <robin@gareus.org>
+ * Copyright (C) 2016-2018 Robin Gareus <robin@gareus.org>
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <gtkmm/frame.h>
setup_list ();
show_all ();
-
+
script_combo_changed();
}
{
_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);
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();