summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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);