Button for core plugin is not generated to navigation bar. Added macro

for plugin path.
print
Rokos Josef 9 years ago
parent b927921fb3
commit b33ff1b169

@ -42,16 +42,19 @@ MainWindow::MainWindow(QWidget *parent) :
int i = 0; int i = 0;
foreach (IPlugin *plugin, Context::instance().plugins()) { foreach (IPlugin *plugin, Context::instance().plugins()) {
QToolButton *plugButton = new QToolButton(this); if (plugin->pluginId() != "CORE")
plugButton->setText(plugin->pluginName()); {
plugButton->setIcon(plugin->pluginIcon()); QToolButton *plugButton = new QToolButton(this);
plugButton->setIconSize(QSize(32, 32)); plugButton->setText(plugin->pluginName());
plugButton->setAutoRaise(true); plugButton->setIcon(plugin->pluginIcon());
plugButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); plugButton->setIconSize(QSize(32, 32));
ui->navigation->layout()->addWidget(plugButton); plugButton->setAutoRaise(true);
plugButton->setProperty(PLUGIN_INDEX, i); plugButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
ui->navigation->layout()->addWidget(plugButton);
plugButton->setProperty(PLUGIN_INDEX, i);
connect(plugButton, SIGNAL(clicked()), this, SLOT(openPlugin()) );
}
i++; i++;
connect(plugButton, SIGNAL(clicked()), this, SLOT(openPlugin()) );
} }
((QVBoxLayout*)ui->navigation->layout())->addStretch(1); ((QVBoxLayout*)ui->navigation->layout())->addStretch(1);

@ -52,7 +52,7 @@ void Context::loadPlugins()
m_plugins.append(new Users); m_plugins.append(new Users);
m_plugins.append(new Roles); m_plugins.append(new Roles);
QDir pluginsDir(qApp->applicationDirPath() + "/../../plugins"); QDir pluginsDir(qApp->applicationDirPath() + PLUGIN_ROOT);
foreach (QString fileName, pluginsDir.entryList(QStringList() << "*.so" << "*.dll")) { foreach (QString fileName, pluginsDir.entryList(QStringList() << "*.so" << "*.dll")) {
QPluginLoader pluginLoader(pluginsDir.absoluteFilePath(fileName)); QPluginLoader pluginLoader(pluginsDir.absoluteFilePath(fileName));

@ -13,5 +13,13 @@
#define TO_DEC(num) QDecDouble((double)num / DEC_MULTIPLE) #define TO_DEC(num) QDecDouble((double)num / DEC_MULTIPLE)
#define FROM_DEC(num) num.toDouble() * DEC_MULTIPLE #define FROM_DEC(num) num.toDouble() * DEC_MULTIPLE
#ifndef PLUGIN_ROOT
#ifdef _WIN32
#define PLUGIN_ROOT "/../../plugins"
#else
#define PLUGIN_ROOT "/../plugins"
#endif
#endif
#endif // DEFINE_H #endif // DEFINE_H

Loading…
Cancel
Save