| 225 | } |
| 226 | |
| 227 | void 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 | |
| 261 | void JSPluginManager::handlePluginPopupRequest(QAction *ac, const QPoint &pos) |
| 262 | { |