840 |
"Use SHIFT + left click or CTRL + left click to select the instruments " |
"Use SHIFT + left click or CTRL + left click to select the instruments " |
841 |
"you want to combine." |
"you want to combine." |
842 |
)); |
)); |
843 |
m_treeView.append_column("Instrument", m_columns.m_col_name); |
m_treeView.append_column(_("Nr"), m_columns.m_col_index); |
844 |
m_treeView.set_headers_visible(false); |
m_treeView.append_column(_("Instrument"), m_columns.m_col_name); |
845 |
|
m_treeView.set_headers_visible(true); |
846 |
m_treeView.get_selection()->set_mode(Gtk::SELECTION_MULTIPLE); |
m_treeView.get_selection()->set_mode(Gtk::SELECTION_MULTIPLE); |
847 |
m_treeView.get_selection()->signal_changed().connect( |
m_treeView.get_selection()->signal_changed().connect( |
848 |
sigc::mem_fun(*this, &CombineInstrumentsDialog::onSelectionChanged) |
sigc::mem_fun(*this, &CombineInstrumentsDialog::onSelectionChanged) |
867 |
Glib::ustring name(gig_to_utf8(instr->pInfo->Name)); |
Glib::ustring name(gig_to_utf8(instr->pInfo->Name)); |
868 |
Gtk::TreeModel::iterator iter = m_refTreeModel->append(); |
Gtk::TreeModel::iterator iter = m_refTreeModel->append(); |
869 |
Gtk::TreeModel::Row row = *iter; |
Gtk::TreeModel::Row row = *iter; |
870 |
|
row[m_columns.m_col_index] = i; |
871 |
row[m_columns.m_col_name] = name; |
row[m_columns.m_col_name] = name; |
872 |
row[m_columns.m_col_instr] = instr; |
row[m_columns.m_col_instr] = instr; |
873 |
} |
} |
905 |
} |
} |
906 |
} |
} |
907 |
|
|
908 |
|
void CombineInstrumentsDialog::setSelectedInstruments(const std::set<int>& instrumentIndeces) { |
909 |
|
typedef Gtk::TreeModel::Children Children; |
910 |
|
Children children = m_refTreeModel->children(); |
911 |
|
for (Children::iterator iter = children.begin(); |
912 |
|
iter != children.end(); ++iter) |
913 |
|
{ |
914 |
|
Gtk::TreeModel::Row row = *iter; |
915 |
|
int index = row[m_columns.m_col_index]; |
916 |
|
if (instrumentIndeces.count(index)) |
917 |
|
m_treeView.get_selection()->select(iter); |
918 |
|
} |
919 |
|
} |
920 |
|
|
921 |
void CombineInstrumentsDialog::combineSelectedInstruments() { |
void CombineInstrumentsDialog::combineSelectedInstruments() { |
922 |
std::vector<gig::Instrument*> instruments; |
std::vector<gig::Instrument*> instruments; |
923 |
std::vector<Gtk::TreeModel::Path> v = m_treeView.get_selection()->get_selected_rows(); |
std::vector<Gtk::TreeModel::Path> v = m_treeView.get_selection()->get_selected_rows(); |