MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / registerShortcut

Method registerShortcut

src/plugins/find/findplugin.cpp:51–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51void 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
72dpf::Plugin::ShutdownFlag FindPlugin::stop()
73{

Callers

nothing calls this directly

Calls 9

connectFunction · 0.85
actionContainerMethod · 0.80
insertGroupMethod · 0.80
registerActionMethod · 0.80
setDefaultKeySequenceMethod · 0.80
setSearchTextMethod · 0.80
addActionMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected