summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/GraphBox.cpp18
-rw-r--r--src/gui/GraphBox.hpp4
-rw-r--r--src/gui/ingen_gui.ui12
3 files changed, 31 insertions, 3 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());
}
diff --git a/src/gui/GraphBox.hpp b/src/gui/GraphBox.hpp
index c5a31677..ab3ee5ff 100644
--- a/src/gui/GraphBox.hpp
+++ b/src/gui/GraphBox.hpp
@@ -114,7 +114,8 @@ private:
void event_select_all();
void event_close();
void event_quit();
- void event_refresh_toggled();
+ void event_parent_activated();
+ void event_refresh_activated();
void event_fullscreen_toggled();
void event_doc_pane_toggled();
void event_status_bar_toggled();
@@ -167,6 +168,7 @@ private:
Gtk::MenuItem* _menu_increase_font_size;
Gtk::MenuItem* _menu_decrease_font_size;
Gtk::MenuItem* _menu_normal_font_size;
+ Gtk::MenuItem* _menu_parent;
Gtk::MenuItem* _menu_refresh;
Gtk::MenuItem* _menu_fullscreen;
Gtk::MenuItem* _menu_arrange;
diff --git a/src/gui/ingen_gui.ui b/src/gui/ingen_gui.ui
index d9caaad4..69fed01a 100644
--- a/src/gui/ingen_gui.ui
+++ b/src/gui/ingen_gui.ui
@@ -1156,6 +1156,18 @@ See COPYING file included with this distribution, or http://www.gnu.org/licenses
</object>
</child>
<child>
+ <object class="GtkImageMenuItem" id="graph_parent_menuitem">
+ <property name="label">_Parent</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <accelerator key="BackSpace" signal="activate"/>
+ <signal name="activate" handler="graph_parent_menuitem" swapped="no"/>
+ </object>
+ </child>
+ <child>
<object class="GtkImageMenuItem" id="graph_refresh_menuitem">
<property name="label">gtk-refresh</property>
<property name="use_action_appearance">False</property>