along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id$
*/
#include <cstdlib>
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 ((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;
}
}
if ((iter = group_model->get_iter (path))) {
bool active = (*iter)[group_columns.is_active];
(*iter)[group_columns.is_active] = !active;
+#ifdef GTKOSX
+ edit_group_display.queue_draw();
+#endif
return true;
}
break;
if ((iter = group_model->get_iter (path))) {
bool visible = (*iter)[group_columns.is_visible];
(*iter)[group_columns.is_visible] = !visible;
+#ifdef GTKOSX
+ edit_group_display.queue_draw();
+#endif
return true;
}
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];
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));
}