| 320 | } |
| 321 | |
| 322 | void InputEditorView::updateMenu() |
| 323 | { |
| 324 | /* Sanity check if this slot is called too early */ |
| 325 | if (!insertAct) |
| 326 | return; |
| 327 | |
| 328 | /* Get the lowest selected row and count markers */ |
| 329 | int min_row = 1 << 30; |
| 330 | const QModelIndexList indexes = selectionModel()->selectedRows(); |
| 331 | |
| 332 | int markers_count = 0; |
| 333 | for (const QModelIndex index : indexes) { |
| 334 | if (inputEditorModel->hasMarker(index.row())) { |
| 335 | markers_count++; |
| 336 | currentMarkerText = inputEditorModel->getMarkerText(index.row()); |
| 337 | } |
| 338 | if (index.row() < min_row) |
| 339 | min_row = index.row(); |
| 340 | } |
| 341 | |
| 342 | markAct->setText(markers_count ? tr("Edit marker") : tr("Add marker")); |
| 343 | unmarkAct->setText((markers_count > 1) ? tr("Remove markers") : tr("Remove marker")); |
| 344 | unmarkAct->setEnabled(markers_count); |
| 345 | |
| 346 | if (static_cast<uint32_t>(min_row) < context->framecount) { |
| 347 | eventAct->setEnabled(false); |
| 348 | } |
| 349 | else { |
| 350 | eventAct->setEnabled(true); |
| 351 | } |
| 352 | |
| 353 | undoAct->setEnabled(movie->changelog->canUndo()); |
| 354 | redoAct->setEnabled(movie->changelog->canRedo()); |
| 355 | } |
| 356 | |
| 357 | void InputEditorView::mousePressEvent(QMouseEvent *event) |
| 358 | { |
nothing calls this directly
no test coverage detected