summaryrefslogtreecommitdiffstats
path: root/src/gui/GraphBox.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-03-14 23:02:37 -0400
committerDavid Robillard <d@drobilla.net>2016-03-14 23:02:37 -0400
commit33458809b8126c250f8808de3adb45c32d9fa19c (patch)
tree906140caf953f1cb11f41a7b80dc181d202bc478 /src/gui/GraphBox.cpp
parent7fa32b8bf0223e9c83d4dbff13e93d98dc9b07ca (diff)
downloadingen-33458809b8126c250f8808de3adb45c32d9fa19c.tar.gz
ingen-33458809b8126c250f8808de3adb45c32d9fa19c.tar.bz2
ingen-33458809b8126c250f8808de3adb45c32d9fa19c.zip
Add key binding for moving to parent graph
Diffstat (limited to 'src/gui/GraphBox.cpp')
-rw-r--r--src/gui/GraphBox.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/gui/GraphBox.cpp b/src/gui/GraphBox.cpp
index 2f48e164..52ec9672 100644
--- a/src/gui/GraphBox.cpp
+++ b/src/gui/GraphBox.cpp
@@ -87,6 +87,7 @@ GraphBox::GraphBox(BaseObjectType* cobject,
xml->get_widget("graph_view_control_window_menuitem", _menu_view_control_window);
xml->get_widget("graph_view_engine_window_menuitem", _menu_view_engine_window);
xml->get_widget("graph_properties_menuitem", _menu_view_graph_properties);
+ xml->get_widget("graph_parent_menuitem", _menu_parent);
xml->get_widget("graph_refresh_menuitem", _menu_refresh);
xml->get_widget("graph_fullscreen_menuitem", _menu_fullscreen);
xml->get_widget("graph_animate_signals_menuitem", _menu_animate_signals);
@@ -130,8 +131,10 @@ GraphBox::GraphBox(BaseObjectType* cobject,
sigc::mem_fun(this, &GraphBox::event_close));
_menu_quit->signal_activate().connect(
sigc::mem_fun(this, &GraphBox::event_quit));
+ _menu_parent->signal_activate().connect(
+ sigc::mem_fun(this, &GraphBox::event_parent_activated));
_menu_refresh->signal_activate().connect(
- sigc::mem_fun(this, &GraphBox::event_refresh_toggled));
+ sigc::mem_fun(this, &GraphBox::event_refresh_activated));
_menu_fullscreen->signal_activate().connect(
sigc::mem_fun(this, &GraphBox::event_fullscreen_toggled));
_menu_animate_signals->signal_activate().connect(
@@ -302,6 +305,8 @@ GraphBox::set_graph(SPtr<const GraphModel> graph,
}
}
+ _menu_parent->property_sensitive() = bool(graph->parent());
+
new_port_connection = graph->signal_new_port().connect(
sigc::mem_fun(this, &GraphBox::graph_port_added));
removed_port_connection = graph->signal_removed_port().connect(
@@ -747,7 +752,16 @@ GraphBox::event_arrange()
}
void
-GraphBox::event_refresh_toggled()
+GraphBox::event_parent_activated()
+{
+ SPtr<Client::GraphModel> parent = dynamic_ptr_cast<Client::GraphModel>(_graph->parent());
+ if (parent) {
+ _app->window_factory()->present_graph(parent, _window);
+ }
+}
+
+void
+GraphBox::event_refresh_activated()
{
_app->interface()->get(_graph->uri());
}