654 |
// Add the TreeView's view columns: |
// Add the TreeView's view columns: |
655 |
m_TreeView.append_column(_("Nr"), m_Columns.m_col_nr); |
m_TreeView.append_column(_("Nr"), m_Columns.m_col_nr); |
656 |
m_TreeView.append_column_editable(_("Instrument"), m_Columns.m_col_name); |
m_TreeView.append_column_editable(_("Instrument"), m_Columns.m_col_name); |
657 |
|
m_TreeView.append_column(_("Scripts"), m_Columns.m_col_scripts); |
658 |
m_TreeView.set_headers_visible(true); |
m_TreeView.set_headers_visible(true); |
659 |
|
|
660 |
// establish drag&drop within the instrument tree view, allowing to reorder |
// establish drag&drop within the instrument tree view, allowing to reorder |
2099 |
for (gig::Instrument* instrument = gig->GetFirstInstrument() ; instrument ; |
for (gig::Instrument* instrument = gig->GetFirstInstrument() ; instrument ; |
2100 |
instrument = gig->GetNextInstrument(), ++index) { |
instrument = gig->GetNextInstrument(), ++index) { |
2101 |
Glib::ustring name(gig_to_utf8(instrument->pInfo->Name)); |
Glib::ustring name(gig_to_utf8(instrument->pInfo->Name)); |
2102 |
|
const int iScriptSlots = instrument->ScriptSlotCount(); |
2103 |
|
|
2104 |
Gtk::TreeModel::iterator iter = m_refTreeModel->append(); |
Gtk::TreeModel::iterator iter = m_refTreeModel->append(); |
2105 |
Gtk::TreeModel::Row row = *iter; |
Gtk::TreeModel::Row row = *iter; |
2106 |
row[m_Columns.m_col_nr] = index; |
row[m_Columns.m_col_nr] = index; |
2107 |
row[m_Columns.m_col_name] = name; |
row[m_Columns.m_col_name] = name; |
2108 |
row[m_Columns.m_col_instr] = instrument; |
row[m_Columns.m_col_instr] = instrument; |
2109 |
|
row[m_Columns.m_col_scripts] = iScriptSlots ? ToString(iScriptSlots) : ""; |
2110 |
|
|
2111 |
add_instrument_to_menu(name); |
add_instrument_to_menu(name); |
2112 |
} |
} |
2245 |
|
|
2246 |
ScriptSlots* window = new ScriptSlots; |
ScriptSlots* window = new ScriptSlots; |
2247 |
window->setInstrument(instrument); |
window->setInstrument(instrument); |
2248 |
|
window->signal_script_slots_changed().connect( |
2249 |
|
sigc::mem_fun(*this, &MainWindow::onScriptSlotsModified) |
2250 |
|
); |
2251 |
//window->reparent(*this); |
//window->reparent(*this); |
2252 |
window->show(); |
window->show(); |
2253 |
} |
} |
2254 |
|
|
2255 |
|
void MainWindow::onScriptSlotsModified(gig::Instrument* pInstrument) { |
2256 |
|
if (!pInstrument) return; |
2257 |
|
const int iScriptSlots = pInstrument->ScriptSlotCount(); |
2258 |
|
|
2259 |
|
Glib::RefPtr<Gtk::TreeModel> model = m_TreeView.get_model(); |
2260 |
|
for (int i = 0; i < model->children().size(); ++i) { |
2261 |
|
Gtk::TreeModel::Row row = model->children()[i]; |
2262 |
|
if (row[m_Columns.m_col_instr] != pInstrument) continue; |
2263 |
|
row[m_Columns.m_col_scripts] = iScriptSlots ? ToString(iScriptSlots) : ""; |
2264 |
|
break; |
2265 |
|
} |
2266 |
|
} |
2267 |
|
|
2268 |
void MainWindow::on_action_refresh_all() { |
void MainWindow::on_action_refresh_all() { |
2269 |
__refreshEntireGUI(); |
__refreshEntireGUI(); |
2270 |
} |
} |
2579 |
rowInstr[m_Columns.m_col_nr] = m_refTreeModel->children().size() - 1; |
rowInstr[m_Columns.m_col_nr] = m_refTreeModel->children().size() - 1; |
2580 |
rowInstr[m_Columns.m_col_name] = name; |
rowInstr[m_Columns.m_col_name] = name; |
2581 |
rowInstr[m_Columns.m_col_instr] = instrument; |
rowInstr[m_Columns.m_col_instr] = instrument; |
2582 |
|
rowInstr[m_Columns.m_col_scripts] = ""; |
2583 |
instrument_name_connection.unblock(); |
instrument_name_connection.unblock(); |
2584 |
|
|
2585 |
add_instrument_to_menu(name); |
add_instrument_to_menu(name); |