summaryrefslogtreecommitdiffstats
path: root/src/libs/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-10-03 05:30:41 +0000
committerDavid Robillard <d@drobilla.net>2007-10-03 05:30:41 +0000
commit00cc6439dc4241bb1c8ba99632b6627b0f1617d7 (patch)
treea3ea7b21fde179208a725b48b1ced96ed9ec843c /src/libs/gui
parent6aa595b3c50dbd409dfd934477c95adff196a807 (diff)
downloadingen-00cc6439dc4241bb1c8ba99632b6627b0f1617d7.tar.gz
ingen-00cc6439dc4241bb1c8ba99632b6627b0f1617d7.tar.bz2
ingen-00cc6439dc4241bb1c8ba99632b6627b0f1617d7.zip
Fix embed gui/popup gui/show controls items in node menu.
git-svn-id: http://svn.drobilla.net/lad/ingen@804 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/gui')
-rw-r--r--src/libs/gui/NodeModule.cpp29
-rw-r--r--src/libs/gui/NodeModule.hpp8
2 files changed, 25 insertions, 12 deletions
diff --git a/src/libs/gui/NodeModule.cpp b/src/libs/gui/NodeModule.cpp
index 0ab3cfa8..d7d5ccfc 100644
--- a/src/libs/gui/NodeModule.cpp
+++ b/src/libs/gui/NodeModule.cpp
@@ -72,6 +72,7 @@ NodeModule::create_menu()
xml->get_widget_derived("object_menu", _menu);
_menu->init(_node);
_menu->signal_embed_gui.connect(sigc::mem_fun(this, &NodeModule::embed_gui));
+ _menu->signal_popup_gui.connect(sigc::hide_return(sigc::mem_fun(this, &NodeModule::popup_gui)));
set_menu(_menu);
}
@@ -243,8 +244,8 @@ NodeModule::remove_port(SharedPtr<PortModel> port)
}
-void
-NodeModule::show_control_window()
+bool
+NodeModule::popup_gui()
{
#ifdef HAVE_SLV2
if (_node->plugin()->type() == PluginModel::LV2) {
@@ -261,16 +262,28 @@ NodeModule::show_control_window()
win->add(*widget);
widget->show_all();
win->present();
+ return true;
} else {
- cerr << "No LV2 GUI, showing builtin controls" << endl;
- App::instance().window_factory()->present_controls(_node);
+ cerr << "No LV2 GUI" << endl;
}
- } else {
- App::instance().window_factory()->present_controls(_node);
}
-#else
- App::instance().window_factory()->present_controls(_node);
#endif
+ return false;
+}
+
+
+void
+NodeModule::show_control_window()
+{
+ App::instance().window_factory()->present_controls(_node);
+}
+
+
+void
+NodeModule::on_double_click(GdkEventButton* ev)
+{
+ if ( ! popup_gui() )
+ show_control_window();
}
diff --git a/src/libs/gui/NodeModule.hpp b/src/libs/gui/NodeModule.hpp
index 00e5835d..7dd0fdee 100644
--- a/src/libs/gui/NodeModule.hpp
+++ b/src/libs/gui/NodeModule.hpp
@@ -61,15 +61,15 @@ public:
virtual void store_location();
- void show_control_window();
-
SharedPtr<NodeModel> node() const { return _node; }
protected:
NodeModule(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<NodeModel> node);
- virtual void on_double_click(GdkEventButton* ev) { show_control_window(); }
- virtual void on_middle_click(GdkEventButton* ev) { show_control_window(); }
+ void on_double_click(GdkEventButton* ev);
+
+ void show_control_window();
+ bool popup_gui();
void rename();
void set_metadata(const std::string& key, const Atom& value);