CMakeEditor: Replace member var with InfoBar call

This changes behavior. Editing a cmake file then building then editing
it again will display the warning again. It currently doesn't.

Change-Id: I8ecb31956102680e953a40dcb5e95bde819aa652
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Orgad Shaneh
2013-01-08 22:42:14 +02:00
committed by Daniel Teske
parent 68b9966bf2
commit d3302d83a6
2 changed files with 6 additions and 8 deletions

View File

@@ -56,8 +56,7 @@ using namespace CMakeProjectManager::Internal;
//
CMakeEditor::CMakeEditor(CMakeEditorWidget *editor)
: BaseTextEditor(editor),
m_infoBarShown(false)
: BaseTextEditor(editor)
{
setContext(Core::Context(CMakeProjectManager::Constants::C_CMAKEEDITOR,
TextEditor::Constants::C_TEXTEDITOR));
@@ -82,13 +81,14 @@ void CMakeEditor::markAsChanged()
{
if (!document()->isModified())
return;
if (m_infoBarShown)
Core::InfoBar *infoBar = document()->infoBar();
Core::Id infoRunCmake("CMakeEditor.RunCMake");
if (!infoBar->canInfoBeAdded(infoRunCmake))
return;
m_infoBarShown = true;
Core::InfoBarEntry info(Core::Id("CMakeEditor.RunCMake"),
Core::InfoBarEntry info(infoRunCmake,
tr("Changes to cmake files are shown in the project tree after building."));
info.setCustomButtonInfo(tr("Build now"), this, SLOT(build()));
document()->infoBar()->addInfo(info);
infoBar->addInfo(info);
}
void CMakeEditor::build()