Can extension check if some other extension is enabled?
I’d like to add dialog “Atom properties” for customization of colors, radii, and labels for every atom type. But it will require several engines to be available.
–
Regards,
Konstantin
Can extension check if some other extension is enabled?
I’d like to add dialog “Atom properties” for customization of colors, radii, and labels for every atom type. But it will require several engines to be available.
–
Regards,
Konstantin
I’d like to add dialog “Atom properties” for customization of colors, radii, and labels for every atom type. But it will require several engines to be available.
You can already check engines, given a GLWidget. Here’s how the vibration extension does it:
foreach (Engine *engine, m_widget->engines()) {
if (engine->identifier() == "Force") {
m_dialog->setDisplayForceVectors(engine->isEnabled());
connect(engine, SIGNAL(enableToggled(bool)), m_dialog, SLOT(setDisplayForceVectors(bool)));
}
}
Right now, I’d have to think about accessing extensions or tools. We probably need to add API for that.
Cheers,
-Geoff
On Feb 5, 2010, at 9:52 AM, Konstantin Tokarev wrote:
Right now, I’d have to think about accessing extensions or tools. We probably need to add API for that.
It would be great if one extension could get pointer to another. It will make possible data interchange between extensions without without bloating of Molecule and properties
Well, if you look in glwidget.cpp, you can see how to access the PluginManager::instance. So I guess my suggestion would be to add a new method to GLWidget to access the current PluginManager. You could then access extensions, tools, color maps, etc. from the PluginManager. The catch, of course, is that you can have an engine plugin loaded, but not enabled. We already have a clean API for engines though.
That’s along the lines I was suggesting yesterday.
Hope that helps,
-Geoff