mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-13 08:09:39 +00:00
consistent search engine organization
This commit is contained in:
parent
8d0638f23c
commit
98a9fc8bf3
@ -119,7 +119,7 @@ void PluginInfoDialog::on_loadPluginsPushButton_clicked()
|
||||
QStringList fileList = QFileDialog::getOpenFileNames(this, "Load Plugins", "", pluginFileFormat);
|
||||
PluginManager& pm = meshlab::pluginManagerInstance();
|
||||
bool loadOk = false;
|
||||
for (const QString& fileName : fileList){
|
||||
for (const QString& fileName : qAsConst(fileList)){
|
||||
QFileInfo finfo(fileName);
|
||||
|
||||
try {
|
||||
|
||||
@ -256,8 +256,6 @@ private:
|
||||
void createActions();
|
||||
void createMenus();
|
||||
void initSearchEngine();
|
||||
void initItemForSearching(QAction* act);
|
||||
void initMenuForSearching(QMenu* menu);
|
||||
void fillFilterMenu();
|
||||
void fillRenderMenu();
|
||||
void fillShadersMenu();
|
||||
|
||||
@ -658,40 +658,23 @@ void MainWindow::createMenus()
|
||||
|
||||
void MainWindow::initSearchEngine()
|
||||
{
|
||||
wama.clear();
|
||||
for (const auto& p : PM.filterPluginIterator()){
|
||||
for (QAction* act : p->actions())
|
||||
initItemForSearching(act);
|
||||
wama.addAction(act);
|
||||
}
|
||||
/*for (const auto& p : PM.editPluginFactoryIterator()){
|
||||
for (const auto& p : PM.editPluginFactoryIterator()){
|
||||
for (QAction* act : p->actions())
|
||||
initItemForSearching(act);
|
||||
wama.addAction(act);
|
||||
}
|
||||
for (const auto& p : PM.renderPluginIterator()){
|
||||
for (QAction* act : p->actions())
|
||||
initItemForSearching(act);
|
||||
}*/
|
||||
|
||||
initMenuForSearching(editMenu);
|
||||
initMenuForSearching(renderMenu);
|
||||
}
|
||||
|
||||
void MainWindow::initMenuForSearching(QMenu* menu)
|
||||
{
|
||||
if (menu == NULL)
|
||||
return;
|
||||
const QList<QAction*>& acts = menu->actions();
|
||||
for(QAction* act: acts) {
|
||||
QMenu* submenu = act->menu();
|
||||
if (!act->isSeparator() && (submenu == NULL))
|
||||
initItemForSearching(act);
|
||||
else if (!act->isSeparator())
|
||||
initMenuForSearching(submenu);
|
||||
wama.addAction(act);
|
||||
}
|
||||
for (const auto& p : PM.decoratePluginIterator()){
|
||||
for (QAction* act : p->actions())
|
||||
wama.addAction(act);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::initItemForSearching(QAction* act)
|
||||
{
|
||||
wama.addAction(act);
|
||||
}
|
||||
|
||||
QString MainWindow::getDecoratedFileName(const QString& name)
|
||||
@ -928,20 +911,6 @@ void MainWindow::updateAllPluginsActions()
|
||||
|
||||
filterToolBar->clear();
|
||||
updateFilterToolBar();
|
||||
|
||||
//TODO update the searcher: this seems to be an impossible task due to unreadable code.
|
||||
//for now, just close and reopen meshlab....
|
||||
/*
|
||||
disconnect(searchShortCut, SIGNAL(activated()), searchButton, SLOT(openMenu()));
|
||||
wama.clear();
|
||||
delete searchMenu;
|
||||
|
||||
initSearchEngine();
|
||||
int longest = longestActionWidthInAllMenus();
|
||||
searchMenu = new SearchMenu(wama, 15, searchButton, longest);
|
||||
searchButton->setMenu(searchMenu);
|
||||
connect(searchShortCut, SIGNAL(activated()), searchButton, SLOT(openMenu()));
|
||||
*/
|
||||
}
|
||||
|
||||
void MainWindow::loadDefaultSettingsFromPlugins()
|
||||
|
||||
@ -2576,6 +2576,7 @@ void MainWindow::aboutPlugins()
|
||||
PluginInfoDialog dialog(this);
|
||||
dialog.exec();
|
||||
updateAllPluginsActions();
|
||||
initSearchEngine();
|
||||
QSettings settings;
|
||||
QStringList disabledPlugins;
|
||||
for (MeshLabPlugin* pf : PM.pluginIterator(true)){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user