Avogadro
1.1.0
|
Public Slots | |
void | reload () |
Signals | |
void | reloadPlugins () |
Public Member Functions | |
PluginManager (QObject *parent=0) | |
void | setPluginPath (const QStringList &path) |
void | setPluginPath (const QString &path) |
void | addToPluginPath (const QStringList &path) |
void | addToPluginPath (const QString &path) |
QStringList | pluginPath () const |
void | loadFactories (const QString &dir="") |
QList< PluginFactory * > | factories (Plugin::Type type) |
PluginFactory * | factory (const QString &id, Plugin::Type type) |
Extension * | extension (const QString &id, QObject *parent=0) |
Tool * | tool (const QString &id, QObject *parent=0) |
Color * | color (const QString &id, QObject *parent=0) |
Engine * | engine (const QString &id, QObject *parent=0) |
QList< QString > | names (Plugin::Type type) |
QList< QString > | identifiers (Plugin::Type type) |
QList< QString > | descriptions (Plugin::Type type) |
QList< Extension * > | extensions (QObject *parent=0) |
QList< Tool * > | tools (QObject *parent=0) |
QList< Color * > | colors (QObject *parent=0) |
void | writeSettings (QSettings &settings) |
QList< QString > | toolScripts () |
QList< QString > | engineScripts () |
QList< QString > | extensionScripts () |
QList< PluginItem * > | pluginItems (Plugin::Type) |
Static Public Member Functions | |
static PluginManager * | instance () |
static void | loadPluginList (const QDir &dir, const QStringList &plugins, QSettings &settings) |
void Avogadro::PluginManager::addToPluginPath | ( | const QStringList & | path | ) |
Add list of directories to the search path.
void Avogadro::PluginManager::addToPluginPath | ( | const QString & | path | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Add the supplied path to the search path.
Color * Avogadro::PluginManager::color | ( | const QString & | id, |
QObject * | parent = 0 |
||
) |
Get a new instance of the color with identifier id
.
id
References Avogadro::PluginFactory::createInstance(), factories(), factory(), Avogadro::PluginFactory::identifier(), and loadFactories().
Referenced by colors().
QList< Color * > Avogadro::PluginManager::colors | ( | QObject * | parent = 0 | ) |
Get a list of all colors (new instances).
References color(), Avogadro::PluginFactory::createInstance(), factories(), factory(), and loadFactories().
QList< QString > Avogadro::PluginManager::descriptions | ( | Plugin::Type | type | ) |
Get a list with the plugin descriptions of type type
.
References QList::append(), Avogadro::PluginFactory::description(), factories(), factory(), and loadFactories().
Engine * Avogadro::PluginManager::engine | ( | const QString & | id, |
QObject * | parent = 0 |
||
) |
Get a new instance of the color with identifier id
.
id
References Avogadro::PluginFactory::createInstance(), factories(), factory(), Avogadro::PluginFactory::identifier(), and loadFactories().
Get a list of all python engine script filenames.
Referenced by loadFactories().
Extension * Avogadro::PluginManager::extension | ( | const QString & | id, |
QObject * | parent = 0 |
||
) |
Get a new instance of the extension with identifier id
.
id
References Avogadro::PluginFactory::createInstance(), factories(), factory(), Avogadro::PluginFactory::identifier(), and loadFactories().
Referenced by extensions().
QList< Extension * > Avogadro::PluginManager::extensions | ( | QObject * | parent = 0 | ) |
Get a list of all extension (new instances).
References Avogadro::PluginFactory::createInstance(), extension(), factories(), factory(), and loadFactories().
Get a list of all python extension script filenames.
Referenced by loadFactories().
QList< PluginFactory * > Avogadro::PluginManager::factories | ( | Plugin::Type | type | ) |
Get all the PluginFactory obacjects for a given type.
References loadFactories().
Referenced by color(), Avogadro::GLWidget::colorMap(), colors(), descriptions(), engine(), extension(), extensions(), identifiers(), Avogadro::GLWidget::loadDefaultEngines(), names(), tool(), and tools().
PluginFactory * Avogadro::PluginManager::factory | ( | const QString & | id, |
Plugin::Type | type | ||
) |
Get the PluginFactory of type type
with plugin identifier id
.
References Avogadro::PluginFactory::identifier(), and loadFactories().
Referenced by color(), colors(), descriptions(), engine(), extension(), extensions(), identifiers(), loadFactories(), names(), tool(), and tools().
QList< QString > Avogadro::PluginManager::identifiers | ( | Plugin::Type | type | ) |
Get a list with the plugin identifiers of type type
.
References QList::append(), factories(), factory(), Avogadro::PluginFactory::identifier(), and loadFactories().
PluginManager * Avogadro::PluginManager::instance | ( | ) | [static] |
Get the singleton instance of the PluginManager. Always use this function when using the PluginManager class. This pointer never has to be deleted.
Referenced by Avogadro::GLWidget::colorMap(), Avogadro::GLWidget::loadDefaultEngines(), loadFactories(), and loadPluginList().
void Avogadro::PluginManager::loadFactories | ( | const QString & | dir = "" | ) |
Find all plugins by looking through the plugin search path. If it was not set, the next directories are used <bin_location>/../<lib_dir>/avogadro/engines <bin_location>/../<lib_dir>/avogadro/tools <bin_location>/../<lib_dir>/avogadro/extensions <bin_location>/../<lib_dir>/avogadro/colors <bin_location>/../<lib_dir>/avogadro/contrib (external plugins)
You can set AVOGADRO_PLUGINS to designate a path at runtime to search.
dir | Path of directory to search for plugins instead of the default paths |
References QVector::append(), QSettings::beginGroup(), QSettings::endGroup(), engineScripts(), extensionScripts(), factory(), instance(), QString::isEmpty(), QPluginLoader::staticInstances(), toolScripts(), and Avogadro::PluginFactory::type().
Referenced by color(), colors(), descriptions(), engine(), extension(), extensions(), factories(), factory(), identifiers(), names(), tool(), and tools().
void Avogadro::PluginManager::loadPluginList | ( | const QDir & | dir, |
const QStringList & | plugins, | ||
QSettings & | settings | ||
) | [static] |
Load plugins with file names listed in plugins from directory dir and enable/disable them using settings
References QDir::absoluteFilePath(), QString::indexOf(), instance(), and QLibrary::isLibrary().
QList< QString > Avogadro::PluginManager::names | ( | Plugin::Type | type | ) |
Get a list with the plugin names of type type
.
References QList::append(), factories(), factory(), loadFactories(), and Avogadro::PluginFactory::name().
QList< PluginItem * > Avogadro::PluginManager::pluginItems | ( | Plugin::Type | type | ) |
Use by the plugin manager settings dialog
Get the search path for plugins.
void Avogadro::PluginManager::setPluginPath | ( | const QStringList & | path | ) |
Set the search path for plugins as list of directories.
void Avogadro::PluginManager::setPluginPath | ( | const QString & | path | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Set the search path for plugins.
Tool * Avogadro::PluginManager::tool | ( | const QString & | id, |
QObject * | parent = 0 |
||
) |
Get a new instance of the tool with identifier id
.
id
References Avogadro::PluginFactory::createInstance(), factories(), factory(), Avogadro::PluginFactory::identifier(), and loadFactories().
Referenced by tools().
QList< Tool * > Avogadro::PluginManager::tools | ( | QObject * | parent = 0 | ) |
Get a list of all tools (new instances).
References Avogadro::PluginFactory::createInstance(), factories(), factory(), loadFactories(), and tool().
Get a list of all python tool script filenames.
Referenced by loadFactories().
void Avogadro::PluginManager::writeSettings | ( | QSettings & | settings | ) |
Write the settings of the PluginManager in order to save them to disk.
References QSettings::beginGroup(), QSettings::endGroup(), Avogadro::PluginItem::identifier(), Avogadro::PluginItem::isEnabled(), QString::number(), and QSettings::setValue().