Commit ede3869a authored by Jan Möbius's avatar Jan Möbius

Function to get current renderer

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13138 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 17d0ef46
......@@ -279,6 +279,13 @@ class BaseInterface {
*/
virtual void setRenderer(unsigned int _viewer, QString _rendererName) {};
/** \brief Get the current renderer for the given viewer
*
* @param _viewer Id of the viewer to set the renderer for
* @param _rendererName Name of the renderer that is currently active
*/
virtual void getCurrentRenderer(unsigned int _viewer, QString& _rendererName) {};
/** @} */
private slots :
......
......@@ -596,8 +596,11 @@ signals:
/// called to switch the renderer for a specific viewer
void slotSetRenderer(unsigned int _viewer, QString _rendererName);
/// called to get the currently active renderer renderer for a specific viewer
void slotGetCurrentRenderer(unsigned int _viewer, QString& _rendererName);
/// Get a Pointer to the Plugin with given _name (if it is loaded)
// void slotGetPlugin(QString _name, QObject* & _plugin );
// void slotGetPlugin(QString _name, QObject* & _plugin );
/** @} */
......
......@@ -410,6 +410,10 @@ void Core::slotSetRenderer(unsigned int _viewer, QString _rendererName) {
renderManager().setActive(_rendererName,_viewer);
}
void Core::slotGetCurrentRenderer(unsigned int _viewer, QString& _rendererName) {
_rendererName = renderManager().active(_viewer)->name;
}
//=============================================================================
......@@ -929,11 +929,18 @@ void Core::loadPlugin(QString filename, bool silent, QString& _licenseErrors, QO
connect(plugin, SIGNAL(setSlotDescription(QString,QString,QStringList,QStringList)),
this, SLOT(slotSetSlotDescription(QString,QString,QStringList,QStringList)) );
// =============================================
// Function allowing switching of renderers from other plugins
// =============================================
if ( checkSignal(plugin,"setRenderer(unsigned int,QString)" ) ) {
connect(plugin,SIGNAL(setRenderer(unsigned int,QString)),this,SLOT(slotSetRenderer(unsigned int,QString)));
}
if ( checkSignal(plugin,"getCurrentRenderer(unsigned int,QString&)" ) ) {
connect(plugin,SIGNAL(getCurrentRenderer(unsigned int,QString&)),this,SLOT(slotGetCurrentRenderer(unsigned int,QString&)), Qt::DirectConnection);
}
}
//Check if the plugin supports Logging
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment