| 296 | } |
| 297 | |
| 298 | void |
| 299 | Viewer::treeContextMenu(const QPoint& pos) |
| 300 | { |
| 301 | QPoint globalPos = this->ui.repoView->viewport()->mapToGlobal(pos); |
| 302 | |
| 303 | QAction* selectedItem = treeMenu.exec(globalPos); |
| 304 | if (selectedItem) { |
| 305 | if (selectedItem->iconText() == EXPAND_ACTION) |
| 306 | { |
| 307 | expand(true); |
| 308 | selectedItem->setText(COLLAPSE_ACTION); |
| 309 | selectedItem->setIconText(COLLAPSE_ACTION); |
| 310 | |
| 311 | } |
| 312 | else if (selectedItem->iconText() == COLLAPSE_ACTION) |
| 313 | { |
| 314 | expand(false); |
| 315 | selectedItem->setText(EXPAND_ACTION); |
| 316 | selectedItem->setIconText(EXPAND_ACTION); |
| 317 | } |
| 318 | else if (selectedItem->iconText() == SELECTION_TO_NODE_VIEW || |
| 319 | selectedItem->iconText() == SELECTION_TO_GRAPH_VIEW) |
| 320 | { |
| 321 | // reset all the display flags |
| 322 | this->dataSource_->modelRoot()->resetDisplays(); |
| 323 | |
| 324 | QModelIndexList q = this->ui.repoView->selectionModel()->selectedRows(); |
| 325 | for (int c = 0; c < q.size(); ++c) { |
| 326 | // get the node and set the display flag |
| 327 | TreeNode *t = model_->getNode(q[c]); |
| 328 | t->setDisplay(true); |
| 329 | } |
| 330 | |
| 331 | if (selectedItem->iconText() == SELECTION_TO_NODE_VIEW) |
| 332 | { |
| 333 | updateNodeView(true); |
| 334 | } |
| 335 | else { |
| 336 | updateGraphView(true); |
| 337 | } |
| 338 | } |
| 339 | else if (selectedItem->iconText() == NODE_VIEW_OPTIONS_ACTION) |
| 340 | { |
| 341 | showNodeOptions(); |
| 342 | } |
| 343 | else if (selectedItem->iconText() == GRAPH_OPTIONS_ACTION) |
| 344 | { |
| 345 | showGraphOptions(); |
| 346 | } |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | void |
| 351 | Viewer::nodeContextMenu(const QPoint& pos) |
nothing calls this directly
no test coverage detected