forked from qt-creator/qt-creator
QML/JS: Fix that warnings about editing .ui.qml files accumulated
Splitting the editor would add the warning again. Since the warning is a document property, handle it in the document instead of the widgets. Change-Id: Ie20377b05dee14983f7ff46ba04ed2af2b737c96 Task-number: QTCREATORBUG-14923 Reviewed-by: Marco Benelli <marco.benelli@theqtcompany.com> Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
committed by
Thomas Hartmann
parent
53e1c84f50
commit
78e8871207
@@ -58,7 +58,6 @@
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/id.h>
|
||||
#include <coreplugin/infobar.h>
|
||||
#include <coreplugin/modemanager.h>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
@@ -112,7 +111,6 @@ QmlJSEditorWidget::QmlJSEditorWidget()
|
||||
{
|
||||
m_outlineCombo = 0;
|
||||
m_contextPane = 0;
|
||||
m_firstSementicInfo = true;
|
||||
m_findReferences = new FindReferences(this);
|
||||
|
||||
setLanguageSettingsId(QmlJSTools::Constants::QML_JS_SETTINGS_ID);
|
||||
@@ -949,16 +947,6 @@ void QmlJSEditorWidget::semanticInfoUpdated(const SemanticInfo &semanticInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if (m_firstSementicInfo) {
|
||||
m_firstSementicInfo = false;
|
||||
if (semanticInfo.document->language() == Dialect::QmlQtQuick2Ui) {
|
||||
InfoBarEntry info(Id(Constants::QML_UI_FILE_WARNING),
|
||||
tr("This file should only be edited in <b>Design</b> mode."));
|
||||
info.setCustomButtonInfo(tr("Switch Mode"), []() { ModeManager::activateMode(Core::Constants::MODE_DESIGN); });
|
||||
textDocument()->infoBar()->addInfo(info);
|
||||
}
|
||||
}
|
||||
|
||||
updateUses();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user