along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id$
*/
#include <cstdlib>
using namespace sigc;
using namespace ARDOUR;
+using namespace PBD;
using namespace Gtk;
void
items.push_back (MenuElem (_("Activate All"), mem_fun(*this, &Editor::activate_all_edit_groups)));
items.push_back (MenuElem (_("Disable All"), mem_fun(*this, &Editor::disable_all_edit_groups)));
items.push_back (SeparatorElem());
+ items.push_back (MenuElem (_("Show All"), mem_fun(*this, &Editor::show_all_edit_groups)));
+ items.push_back (MenuElem (_("Hide All"), mem_fun(*this, &Editor::hide_all_edit_groups)));
+ items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Add group"), mem_fun(*this, &Editor::new_edit_group)));
}
}
}
+void
+Editor::show_all_edit_groups ()
+{
+ Gtk::TreeModel::Children children = group_model->children();
+ for(Gtk::TreeModel::Children::iterator iter = children.begin(); iter != children.end(); ++iter) {
+ (*iter)[group_columns.is_visible] = true;
+ }
+}
+
+void
+Editor::hide_all_edit_groups ()
+{
+ Gtk::TreeModel::Children children = group_model->children();
+ for(Gtk::TreeModel::Children::iterator iter = children.begin(); iter != children.end(); ++iter) {
+ (*iter)[group_columns.is_visible] = false;
+ }
+}
+
void
Editor::new_edit_group ()
{
if (edit_group_list_menu == 0) {
build_edit_group_list_menu ();
}
- edit_group_list_menu->popup (1, 0);
+ edit_group_list_menu->popup (1, ev->time);
return true;
}
if ((iter = group_model->get_iter (path))) {
if ((group = (*iter)[group_columns.routegroup]) != 0) {
// edit_route_group (group);
+#ifdef GTKOSX
+ edit_group_display.queue_draw();
+#endif
return true;
}
}
case 1:
if ((iter = group_model->get_iter (path))) {
- bool visible = (*iter)[group_columns.is_visible];
- (*iter)[group_columns.is_visible] = !visible;
+ bool active = (*iter)[group_columns.is_active];
+ (*iter)[group_columns.is_active] = !active;
+#ifdef GTKOSX
+ edit_group_display.queue_draw();
+#endif
return true;
}
break;
-
+
case 2:
if ((iter = group_model->get_iter (path))) {
- bool active = (*iter)[group_columns.is_active];
- (*iter)[group_columns.is_active] = !active;
+ bool visible = (*iter)[group_columns.is_visible];
+ (*iter)[group_columns.is_visible] = !visible;
+#ifdef GTKOSX
+ edit_group_display.queue_draw();
+#endif
return true;
}
break;
-
+
default:
break;
}
bool active = (*iter)[group_columns.is_active];
group->set_active (active, this);
-
+
+ bool visible = (*iter)[group_columns.is_visible];
+ group->set_hidden (!visible, this);
string name = (*iter)[group_columns.text];
row[group_columns.is_active] = group->is_active();
row[group_columns.is_visible] = !group->is_hidden();
+ in_edit_group_row_change = true;
+
row[group_columns.routegroup] = group;
+
if (!group->name().empty()) {
row[group_columns.text] = group->name();
} else {
CellRendererText* name_cell = dynamic_cast<CellRendererText*>(edit_group_display.get_column_cell_renderer (0));
edit_group_display.set_cursor (group_model->get_path (row), *col, *name_cell, true);
}
+
+ in_edit_group_row_change = false;
}
void
/* just rebuild the while thing */
- edit_group_display.set_model (Glib::RefPtr<TreeModel>(0));
group_model->clear ();
- {
- TreeModel::Row row;
- row = *(group_model->append());
- row[group_columns.is_active] = false;
- row[group_columns.is_visible] = true;
- row[group_columns.text] = (_("-all-"));
- row[group_columns.routegroup] = 0;
- }
-
session->foreach_edit_group (mem_fun (*this, &Editor::add_edit_group));
- edit_group_display.set_model (group_model);
}
void