summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-04-23 02:44:45 +0000
committerDavid Robillard <d@drobilla.net>2012-04-23 02:44:45 +0000
commit48c263b99e62643df08e601e1ce88f279fa7873b (patch)
treecdbac713df2603765cb46c5490a27510899f8f3c
parent682201731f28c627cf39592f4718a959862fa5f2 (diff)
downloadingen-48c263b99e62643df08e601e1ce88f279fa7873b.tar.gz
ingen-48c263b99e62643df08e601e1ce88f279fa7873b.tar.bz2
ingen-48c263b99e62643df08e601e1ce88f279fa7873b.zip
Edge deletion via select and keyboard delete.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4254 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/gui/PatchCanvas.cpp16
1 files changed, 14 insertions, 2 deletions
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<Port*>(edgemm->get_tail());
+ Port* head = dynamic_cast<Port*>(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