Only show the infobar once

Change-Id: I274627999649d00efead89222bbdc325e55932b7
Reviewed-on: http://codereview.qt.nokia.com/2281
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
Daniel Teske
2011-07-27 13:41:30 +02:00
parent e424faaa6b
commit f7bd1277f4
2 changed files with 9 additions and 1 deletions

View File

@@ -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()));

View File

@@ -65,6 +65,8 @@ public:
private slots:
void markAsChanged();
void build();
private:
bool m_infoBarShown;
};
class CMakeEditorWidget : public TextEditor::BaseTextEditorWidget