| 76 | } |
| 77 | |
| 78 | void FindPlugin::registerToSidebar() |
| 79 | { |
| 80 | QAction *action = new QAction(MWNA_ADVANCEDSEARCH, this); |
| 81 | action->setIcon(QIcon::fromTheme("search")); |
| 82 | auto actionImpl = new AbstractAction(action); |
| 83 | windowService->addNavigationItem(actionImpl, Priority::highest); |
| 84 | |
| 85 | std::function<AbstractWidget *()> findCreator = [this]() -> AbstractWidget * { |
| 86 | advSearchWidget = new AdvancedSearchWidget(); |
| 87 | advSearchWidget->initOperator(); |
| 88 | return new AbstractWidget(advSearchWidget); |
| 89 | }; |
| 90 | |
| 91 | windowService->registerWidgetCreator(MWNA_ADVANCEDSEARCH, findCreator); |
| 92 | windowService->setDockHeaderName(MWNA_ADVANCEDSEARCH, tr("ADVANCED SEARCH")); |
| 93 | windowService->bindWidgetToNavigation(MWNA_ADVANCEDSEARCH, actionImpl); |
| 94 | |
| 95 | connect(action, &QAction::triggered, this, &FindPlugin::switchToSearch, Qt::DirectConnection); |
| 96 | } |
nothing calls this directly
no test coverage detected