summaryrefslogtreecommitdiffstats
path: root/src/gui/NodeModule.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-01-08 19:02:11 +0000
committerDavid Robillard <d@drobilla.net>2013-01-08 19:02:11 +0000
commit19b6f2d1c1e8ddcc52b45b4a2c17d4f0317ceabc (patch)
tree72c29bc1ec7f8937c11de859d99f0b50e4cb3386 /src/gui/NodeModule.cpp
parente6996e3794a0cebe3d196759c98eaa6103bd559c (diff)
downloadingen-19b6f2d1c1e8ddcc52b45b4a2c17d4f0317ceabc.tar.gz
ingen-19b6f2d1c1e8ddcc52b45b4a2c17d4f0317ceabc.tar.bz2
ingen-19b6f2d1c1e8ddcc52b45b4a2c17d4f0317ceabc.zip
Re-enable node documentation.
Separate setting documentation from showing documentation pane, and make the latter a user option. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4909 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/NodeModule.cpp')
-rw-r--r--src/gui/NodeModule.cpp39
1 files changed, 19 insertions, 20 deletions
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index d38bea21..5542bef6 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -72,6 +72,9 @@ NodeModule::NodeModule(GraphCanvas& canvas,
signal_moved().connect(
sigc::mem_fun(this, &NodeModule::store_location));
+ signal_selected().connect(
+ sigc::mem_fun(this, &NodeModule::on_selected));
+
const PluginModel* plugin = dynamic_cast<const PluginModel*>(block->plugin());
if (plugin) {
plugin->signal_changed().connect(
@@ -427,29 +430,25 @@ NodeModule::property_changed(const Raul::URI& key, const Raul::Atom& value)
}
}
-void
-NodeModule::set_selected(gboolean b)
+bool
+NodeModule::on_selected(gboolean selected)
{
- if (b != get_selected()) {
- Ganv::Module::set_selected(b);
- #if 0
- if (b) {
- GraphWindow* win = app().window_factory()->parent_graph_window(block());
- if (win) {
- std::string doc;
- bool html = false;
- if (block()->plugin_model()) {
- doc = block()->plugin_model()->documentation(&html);
- }
- if (!doc.empty()) {
- win->show_documentation(doc, html);
- } else {
- win->hide_documentation();
- }
- }
+ GraphWindow* win = app().window_factory()->parent_graph_window(block());
+ if (!win) {
+ return true;
+ }
+
+ if (selected && win->documentation_is_visible()) {
+ GraphWindow* win = app().window_factory()->parent_graph_window(block());
+ std::string doc;
+ bool html = false;
+ if (block()->plugin_model()) {
+ doc = block()->plugin_model()->documentation(&html);
}
- #endif
+ win->set_documentation(doc, html);
}
+
+ return true;
}
} // namespace GUI