| 49 | } |
| 50 | |
| 51 | void FindPlugin::registerShortcut() |
| 52 | { |
| 53 | auto mFind = ActionManager::instance()->actionContainer(M_FIND); |
| 54 | mFind->insertGroup("Find.FindMenu.Actions", "Find.FindMenu.Advanced"); |
| 55 | |
| 56 | QAction *advancedFindAction = new QAction(tr("Advanced Find"), mFind); |
| 57 | auto cmd = ActionManager::instance()->registerAction(advancedFindAction, "Find.AdvancedFind"); |
| 58 | cmd->setDefaultKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_F); |
| 59 | mFind->addAction(cmd, "Find.FindMenu.Advanced"); |
| 60 | connect(advancedFindAction, &QAction::triggered, qApp, [=] { |
| 61 | windowService->switchWidgetNavigation(MWNA_ADVANCEDSEARCH); |
| 62 | if (!advSearchWidget) |
| 63 | return; |
| 64 | |
| 65 | auto editSrv = dpfGetService(EditorService); |
| 66 | const auto &selectedText = editSrv->getSelectedText(); |
| 67 | if (!selectedText.isEmpty()) |
| 68 | advSearchWidget->setSearchText(selectedText); |
| 69 | }); |
| 70 | } |
| 71 | |
| 72 | dpf::Plugin::ShutdownFlag FindPlugin::stop() |
| 73 | { |
nothing calls this directly
no test coverage detected