- added plugin file name to the filters tooltips

- added ctrl+l shortcut for layer dialog (apply filter changed to ctrl+p)
This commit is contained in:
Guido Ranzuglia granzuglia 2012-12-13 17:44:01 +00:00
parent aaf921fec6
commit 6bfab050e3
4 changed files with 21 additions and 6 deletions

View File

@ -108,6 +108,7 @@ void PluginManager::loadPlugins(RichParameterSet& defaultGlobal)
meshFilterPlug.push_back(iFilter);
foreach(QAction *filterAction, iFilter->actions())
{
filterAction->setData(QVariant(fileName));
actionFilterMap.insert(filterAction->text(),filterAction);
stringFilterMap.insert(filterAction->text(),iFilter);
iFilter->initGlobalParameterSet(filterAction,defaultGlobal);
@ -170,6 +171,11 @@ QMap<QString, RichParameterSet> PluginManager::generateFilterParameterMap()
return FPM;
}
QString PluginManager::osDependentFileBaseName(const QString &plname)
{
return (DLLFileNamePreamble() + plname + "."+DLLExtension());
}
QString PluginManager::getBaseDirPath()
{
QDir baseDir(qApp->applicationDirPath());
@ -280,7 +286,7 @@ void PluginManager::loadXMLPlugin( const QString& fileName )
if (fin.suffix() == "xml")
{
QString dllfile = DLLFileNamePreamble() + fin.completeBaseName() + "."+DLLExtension();
QString dllfile = osDependentFileBaseName(fin.completeBaseName());
MeshLabXMLFilterContainer fc;
//fc.filterInterface = NULL;
@ -330,6 +336,7 @@ void PluginManager::loadXMLPlugin( const QString& fileName )
{
QString completename = plugnamespace;
fc.act = new QAction(filter,par);
fc.act->setData(QVariant(dllfile));
stringXMLFilterMap.insert(filter,fc);
QString filterFunction = pluginfo->filterScriptCode(filter);
if (filterFunction == "")

View File

@ -89,9 +89,10 @@ public:
QStringList pluginsLoaded;
static QString osDependentFileBaseName(const QString& plname);
static QString osIndependentPluginName(const QString& plname);
static QString pluginNameSpace();
//highlight and autocomplete
//highlight and autocomplete
/*QStringList pluginnamespaces;
QStringList filterscriptnames;*/
QList<LibraryElementInfo> libinfolist;

View File

@ -470,6 +470,7 @@ private:
QAction *onscreenHelpAct;
QAction *checkUpdatesAct;
////////////////////////////////////////////////////
static QString getDecoratedFileName(const QString& name);
};
/// Event filter that is installed to intercept the open events sent directly by the Operative System

View File

@ -312,6 +312,7 @@ void MainWindow::createActions()
showLayerDlgAct = new QAction (QIcon(":/images/layers.png"),tr("Show Layer Dialog"), this);
showLayerDlgAct->setCheckable(true);
showLayerDlgAct->setChecked(true);
showLayerDlgAct->setShortcut(Qt::CTRL+Qt::Key_L);
connect(showLayerDlgAct, SIGNAL(triggered(bool)), this, SLOT(showLayerDlg(bool)));
@ -392,7 +393,7 @@ void MainWindow::createActions()
//////////////Action Menu Filters /////////////////////////////////////////////////////////////////////
lastFilterAct = new QAction(tr("Apply filter"),this);
lastFilterAct->setShortcutContext(Qt::ApplicationShortcut);
lastFilterAct->setShortcut(Qt::CTRL+Qt::Key_L);
lastFilterAct->setShortcut(Qt::CTRL+Qt::Key_P);
lastFilterAct->setEnabled(false);
connect(lastFilterAct, SIGNAL(triggered()), this, SLOT(applyLastFilter()));
@ -691,6 +692,11 @@ void MainWindow::initItemForSearching(QAction* act)
wama.addWordsPerAction(*act,tx);
}
QString MainWindow::getDecoratedFileName(const QString& name)
{
return QString("<br><b><i>(") + name + ")</i></b>";
}
void MainWindow::fillFilterMenu()
{
filterMenu->clear();
@ -737,8 +743,8 @@ void MainWindow::fillFilterMenu()
for(msi = PM.stringFilterMap.begin(); msi != PM.stringFilterMap.end();++msi)
{
MeshFilterInterface * iFilter= msi.value();
QAction *filterAction = iFilter->AC((msi.key()));
filterAction->setToolTip(iFilter->filterInfo(filterAction));
QAction *filterAction = iFilter->AC((msi.key()));
filterAction->setToolTip(iFilter->filterInfo(filterAction) + "<br>" + getDecoratedFileName(filterAction->data().toString()));
connect(filterAction,SIGNAL(triggered()),this,SLOT(startFilter()));
int filterClass = iFilter->getClass(filterAction);
@ -832,7 +838,7 @@ void MainWindow::fillFilterMenu()
try
{
QString help = info->filterHelp(filterName);
filterAction->setToolTip(help);
filterAction->setToolTip(help + getDecoratedFileName(filterAction->data().toString()));
connect(filterAction,SIGNAL(triggered()),this,SLOT(startFilter()));
QString filterClasses = info->filterAttribute(filterName,MLXMLElNames::filterClass);