MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / handlePluginActionTriggered

Method handlePluginActionTriggered

src/jsplugin/JSPluginManager.cpp:227–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227void JSPluginManager::handlePluginActionTriggered()
228{
229 QAction *ac = qobject_cast<QAction *>(sender());
230 if (!ac)
231 return;
232
233 QString moduleGuid = ac->data().toString();
234 if (moduleGuid.isEmpty())
235 return;
236
237 JSPluginModule *moduleData = moduleByGUID(moduleGuid);
238 if (!moduleData)
239 return;
240
241 QString slotType = moduleData->spec()->slotType();
242 if ( slotType == "SelectorWindow" ) {
243 QToolBar *bar = qobject_cast<QToolBar *>(ac->parentWidget());
244 if (!bar)
245 return;
246 QToolButton *button = qobject_cast<QToolButton *>(bar->widgetForAction(ac));
247 if (!button)
248 return;
249 QRect rc = button->rect();
250 QPoint pt = button->mapToGlobal(QPoint(rc.width()/2, rc.height()));
251 showPluginSelectorWindow(moduleData, pt);
252 } else if ( slotType == "HtmlDialog" ) {
253 showPluginHtmlDialog(moduleData);
254 } else if ( slotType == "MainTabView") {
255 showPluginMainTabView(moduleData);
256 } else if ( slotType == "ExecuteScript" ) {
257 executeModuleScript(moduleData);
258 }
259}
260
261void JSPluginManager::handlePluginPopupRequest(QAction *ac, const QPoint &pos)
262{

Callers

nothing calls this directly

Calls 7

isEmptyMethod · 0.80
slotTypeMethod · 0.80
widthMethod · 0.80
heightMethod · 0.80
toStringMethod · 0.45
dataMethod · 0.45
specMethod · 0.45

Tested by

no test coverage detected