|
|
|
|
@ -883,9 +883,31 @@ void MainWindow::remove_line_melody(const Gtk::TreeModel::Path&, const Gtk::Tree
|
|
|
|
|
imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU);
|
|
|
|
|
lblWarning->set_text("");
|
|
|
|
|
}
|
|
|
|
|
this->validate_melody();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::validate_melody() {
|
|
|
|
|
Glib::RefPtr<Gtk::TreeModel> treeViewMelody_model = treeViewMelody->get_model();
|
|
|
|
|
Gtk::TreeModel::Children children = treeViewMelody_model->children();
|
|
|
|
|
int count = 0;
|
|
|
|
|
for(Gtk::TreeModel::iterator iter = children.begin(); iter != children.end(); ++iter) {
|
|
|
|
|
Gtk::TreeModel::Row row = *iter;
|
|
|
|
|
if (row[m_columns_melody.check_button]) {
|
|
|
|
|
count+=1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (count>1) {
|
|
|
|
|
for(Gtk::TreeModel::iterator iter = children.begin(); iter != children.end(); ++iter) {
|
|
|
|
|
Gtk::TreeModel::Row row = *iter;
|
|
|
|
|
if (row[m_columns_melody.check_button]) {
|
|
|
|
|
count-=1;
|
|
|
|
|
row[m_columns_melody.check_button] = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool MainWindow::focus_tree_view(GdkEventFocus*) {
|
|
|
|
|
treeViewKernel->set_can_focus(false);
|
|
|
|
|
treeViewIPT->set_can_focus(false);
|
|
|
|
|
|