478 |
m_refScriptsTreeModel = ScriptsTreeStore::create(m_ScriptsModel); |
m_refScriptsTreeModel = ScriptsTreeStore::create(m_ScriptsModel); |
479 |
m_TreeViewScripts.set_model(m_refScriptsTreeModel); |
m_TreeViewScripts.set_model(m_refScriptsTreeModel); |
480 |
m_TreeViewScripts.set_tooltip_text(_( |
m_TreeViewScripts.set_tooltip_text(_( |
481 |
|
"Use CTRL + double click for editing a script." |
482 |
|
"\n\n" |
483 |
"Note: instrument scripts are a LinuxSampler extension of the gig " |
"Note: instrument scripts are a LinuxSampler extension of the gig " |
484 |
"format. This feature will not work with the GigaStudio software!" |
"format. This feature will not work with the GigaStudio software!" |
485 |
)); |
)); |
489 |
m_TreeViewScripts.signal_button_press_event().connect_notify( |
m_TreeViewScripts.signal_button_press_event().connect_notify( |
490 |
sigc::mem_fun(*this, &MainWindow::on_script_treeview_button_release) |
sigc::mem_fun(*this, &MainWindow::on_script_treeview_button_release) |
491 |
); |
); |
492 |
|
//FIXME: why the heck does this double click signal_row_activated() only fired while CTRL key is pressed ? |
493 |
|
m_TreeViewScripts.signal_row_activated().connect( |
494 |
|
sigc::mem_fun(*this, &MainWindow::script_double_clicked) |
495 |
|
); |
496 |
m_refScriptsTreeModel->signal_row_changed().connect( |
m_refScriptsTreeModel->signal_row_changed().connect( |
497 |
sigc::mem_fun(*this, &MainWindow::script_name_changed) |
sigc::mem_fun(*this, &MainWindow::script_name_changed) |
498 |
); |
); |
2570 |
} |
} |
2571 |
} |
} |
2572 |
|
|
2573 |
|
void MainWindow::script_double_clicked(const Gtk::TreeModel::Path& path, |
2574 |
|
Gtk::TreeViewColumn* column) |
2575 |
|
{ |
2576 |
|
Gtk::TreeModel::iterator iter = m_refScriptsTreeModel->get_iter(path); |
2577 |
|
if (!iter) return; |
2578 |
|
Gtk::TreeModel::Row row = *iter; |
2579 |
|
gig::Script* script = row[m_ScriptsModel.m_col_script]; |
2580 |
|
if (!script) return; |
2581 |
|
|
2582 |
|
ScriptEditor* editor = new ScriptEditor; |
2583 |
|
editor->setScript(script); |
2584 |
|
//editor->reparent(*this); |
2585 |
|
editor->show(); |
2586 |
|
} |
2587 |
|
|
2588 |
void MainWindow::instrument_name_changed(const Gtk::TreeModel::Path& path, |
void MainWindow::instrument_name_changed(const Gtk::TreeModel::Path& path, |
2589 |
const Gtk::TreeModel::iterator& iter) { |
const Gtk::TreeModel::iterator& iter) { |
2590 |
if (!iter) return; |
if (!iter) return; |