Changeset f4dc2927 in OpenModelica


Ignore:
Timestamp:
2023-03-31T15:40:58+02:00 (13 months ago)
Author:
GitHub <noreply@…>
Branches:
maintenance/v1.22, maintenance/v1.23, master
Children:
afd0bf2d, b3dc696
Parents:
a510dec
git-author:
Adeel Asghar <adeel.asghar@…> (03/31/23 15:40:58)
git-committer:
GitHub <noreply@…> (03/31/23 15:40:58)
Message:

Disable the paste on read only models (#10483)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OMEdit/OMEditLIB/Modeling/ModelWidgetContainer.cpp

    r16ac91dd rf4dc2927  
    35413541    pExportMenu->addAction(MainWindow::instance()->getExportToOMNotebookAction());
    35423542    pMenu->addSeparator();
    3543     mpPasteAction->setEnabled(QApplication::clipboard()->mimeData()->hasFormat(Helper::cutCopyPasteFormat) && qobject_cast<const MimeData*>(QApplication::clipboard()->mimeData()));
     3543    bool isSystemLibrary = mpModelWidget->getLibraryTreeItem()->isSystemLibrary() || isVisualizationView();
     3544    mpPasteAction->setEnabled(!isSystemLibrary && QApplication::clipboard()->mimeData()->hasFormat(Helper::cutCopyPasteFormat) && qobject_cast<const MimeData*>(QApplication::clipboard()->mimeData()));
    35443545    pMenu->addAction(mpPasteAction);
    35453546    pMenu->addSeparator();
     
    47944795    copyItems();
    47954796  } else if (!shiftModifier && controlModifier && event->key() == Qt::Key_V && mpModelWidget->getLibraryTreeItem()->getLibraryType() == LibraryTreeItem::Modelica) {
    4796     pasteItems();
     4797    bool isSystemLibrary = mpModelWidget->getLibraryTreeItem()->isSystemLibrary() || isVisualizationView();
     4798    if (!isSystemLibrary) {
     4799      pasteItems();
     4800    }
    47974801  } else if (controlModifier && event->key() == Qt::Key_D && isAnyItemSelectedAndEditable(event->key())) {
    47984802    mpModelWidget->beginMacro("Duplicate by key press");
Note: See TracChangeset for help on using the changeset viewer.