forked from qt-creator/qt-creator
TextEditor: Update actions after toggling read only mode.
Task-number: QTCREATORBUG-9188 Change-Id: I3448645397e7a39487f2e961728ebef924eec7f6 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -5773,6 +5773,7 @@ void BaseTextEditorWidget::unfoldAll()
|
|||||||
void BaseTextEditorWidget::setReadOnly(bool b)
|
void BaseTextEditorWidget::setReadOnly(bool b)
|
||||||
{
|
{
|
||||||
QPlainTextEdit::setReadOnly(b);
|
QPlainTextEdit::setReadOnly(b);
|
||||||
|
emit readOnlyChanged();
|
||||||
if (b)
|
if (b)
|
||||||
setTextInteractionFlags(textInteractionFlags() | Qt::TextSelectableByKeyboard);
|
setTextInteractionFlags(textInteractionFlags() | Qt::TextSelectableByKeyboard);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -325,6 +325,7 @@ public slots:
|
|||||||
signals:
|
signals:
|
||||||
void changed();
|
void changed();
|
||||||
void assistFinished();
|
void assistFinished();
|
||||||
|
void readOnlyChanged();
|
||||||
|
|
||||||
// ITextEditor
|
// ITextEditor
|
||||||
void contentsChanged();
|
void contentsChanged();
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ void TextEditorActionHandler::setupActions(BaseTextEditorWidget *editor)
|
|||||||
QObject::connect(editor, SIGNAL(undoAvailable(bool)), this, SLOT(updateUndoAction()));
|
QObject::connect(editor, SIGNAL(undoAvailable(bool)), this, SLOT(updateUndoAction()));
|
||||||
QObject::connect(editor, SIGNAL(redoAvailable(bool)), this, SLOT(updateRedoAction()));
|
QObject::connect(editor, SIGNAL(redoAvailable(bool)), this, SLOT(updateRedoAction()));
|
||||||
QObject::connect(editor, SIGNAL(copyAvailable(bool)), this, SLOT(updateCopyAction()));
|
QObject::connect(editor, SIGNAL(copyAvailable(bool)), this, SLOT(updateCopyAction()));
|
||||||
|
QObject::connect(editor, SIGNAL(readOnlyChanged()), this, SLOT(updateActions()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user