+ allow to open system macros in read-only mode

This commit is contained in:
wmayer
2016-01-12 01:26:34 +01:00
parent 0ba829de41
commit e0ee8bb8ca
3 changed files with 35 additions and 26 deletions

View File

@@ -155,9 +155,11 @@ void PythonEditor::drawMarker(int line, int x, int y, QPainter* p)
void PythonEditor::contextMenuEvent ( QContextMenuEvent * e )
{
QMenu* menu = createStandardContextMenu();
menu->addSeparator();
menu->addAction( tr("Comment"), this, SLOT( onComment() ), Qt::ALT + Qt::Key_C );
menu->addAction( tr("Uncomment"), this, SLOT( onUncomment() ), Qt::ALT + Qt::Key_U );
if (!isReadOnly()) {
menu->addSeparator();
menu->addAction( tr("Comment"), this, SLOT( onComment() ), Qt::ALT + Qt::Key_C );
menu->addAction( tr("Uncomment"), this, SLOT( onUncomment() ), Qt::ALT + Qt::Key_U );
}
menu->exec(e->globalPos());
delete menu;