From 48c263b99e62643df08e601e1ce88f279fa7873b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 23 Apr 2012 02:44:45 +0000 Subject: Edge deletion via select and keyboard delete. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4254 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/PatchCanvas.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/gui') diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp index 1eb1413f..4cc46c4c 100644 --- a/src/gui/PatchCanvas.cpp +++ b/src/gui/PatchCanvas.cpp @@ -612,7 +612,7 @@ PatchCanvas::clear_selection() } static void -destroy_module(GanvNode* node, void* data) +destroy_node(GanvNode* node, void* data) { if (!GANV_IS_MODULE(node)) { return; @@ -632,10 +632,22 @@ destroy_module(GanvNode* node, void* data) } } +static void +destroy_edge(GanvEdge* edge, void* data) +{ + App* app = (App*)data; + Ganv::Edge* edgemm = Glib::wrap(edge); + + Port* tail = dynamic_cast(edgemm->get_tail()); + Port* head = dynamic_cast(edgemm->get_head()); + app->engine()->disconnect(tail->model()->path(), head->model()->path()); +} + void PatchCanvas::destroy_selection() { - for_each_selected_node(destroy_module, &_app); + for_each_selected_node(destroy_node, &_app); + for_each_selected_edge(destroy_edge, &_app); } void -- cgit v1.2.1