Commit f7bd1277 authored by Daniel Teske's avatar Daniel Teske

Only show the infobar once

Change-Id: I274627999649d00efead89222bbdc325e55932b7
Reviewed-on: http://codereview.qt.nokia.com/2281Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@nokia.com>
parent e424faaa
......@@ -55,7 +55,8 @@ using namespace CMakeProjectManager::Internal;
//
CMakeEditor::CMakeEditor(CMakeEditorWidget *editor)
: BaseTextEditor(editor)
: BaseTextEditor(editor),
m_infoBarShown(false)
{
setContext(Core::Context(CMakeProjectManager::Constants::C_CMAKEEDITOR,
TextEditor::Constants::C_TEXTEDITOR));
......@@ -78,6 +79,11 @@ QString CMakeEditor::id() const
void CMakeEditor::markAsChanged()
{
if (!file()->isModified())
return;
if (m_infoBarShown)
return;
m_infoBarShown = true;
Core::InfoBarEntry info(QLatin1String("CMakeEditor.RunCMake"),
tr("Changes to cmake files are shown in the project tree after building."));
info.setCustomButtonInfo(tr("Build now"), this, SLOT(build()));
......
......@@ -65,6 +65,8 @@ public:
private slots:
void markAsChanged();
void build();
private:
bool m_infoBarShown;
};
class CMakeEditorWidget : public TextEditor::BaseTextEditorWidget
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment