1945 |
// select item in instrument menu |
// select item in instrument menu |
1946 |
std::vector<Gtk::TreeModel::Path> rows = m_TreeViewInstruments.get_selection()->get_selected_rows(); |
std::vector<Gtk::TreeModel::Path> rows = m_TreeViewInstruments.get_selection()->get_selected_rows(); |
1947 |
if (!rows.empty()) { |
if (!rows.empty()) { |
1948 |
Gtk::TreeModel::iterator it = m_refInstrumentsTreeModel->get_iter(rows[0]); |
// convert index of visual selection (i.e. if filtered) to index of model |
1949 |
|
Gtk::TreeModel::Path row = m_refInstrumentsModelFilter->convert_path_to_child_path(rows[0]); |
1950 |
|
Gtk::TreeModel::iterator it = m_refInstrumentsTreeModel->get_iter(row); |
1951 |
if (it) { |
if (it) { |
1952 |
Gtk::TreePath path(it); |
Gtk::TreePath path(it); |
1953 |
int index = path[0]; |
int index = path[0]; |
3730 |
|
|
3731 |
void MainWindow::show_script_slots() { |
void MainWindow::show_script_slots() { |
3732 |
if (!file) return; |
if (!file) return; |
3733 |
|
|
3734 |
// get selected instrument |
// get selected instrument |
3735 |
std::vector<Gtk::TreeModel::Path> rows = m_TreeViewInstruments.get_selection()->get_selected_rows(); |
gig::Instrument* instrument = get_instrument(); |
|
if (rows.empty()) return; |
|
|
Gtk::TreeModel::iterator it = m_refInstrumentsTreeModel->get_iter(rows[0]); |
|
|
if (!it) return; |
|
|
Gtk::TreeModel::Row row = *it; |
|
|
gig::Instrument* instrument = row[m_InstrumentsModel.m_col_instr]; |
|
3736 |
if (!instrument) return; |
if (!instrument) return; |
3737 |
|
|
3738 |
ScriptSlots* window = new ScriptSlots; |
ScriptSlots* window = new ScriptSlots; |