forked from qt-creator/qt-creator
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:
@@ -55,7 +55,8 @@ using namespace CMakeProjectManager::Internal;
|
|||||||
//
|
//
|
||||||
|
|
||||||
CMakeEditor::CMakeEditor(CMakeEditorWidget *editor)
|
CMakeEditor::CMakeEditor(CMakeEditorWidget *editor)
|
||||||
: BaseTextEditor(editor)
|
: BaseTextEditor(editor),
|
||||||
|
m_infoBarShown(false)
|
||||||
{
|
{
|
||||||
setContext(Core::Context(CMakeProjectManager::Constants::C_CMAKEEDITOR,
|
setContext(Core::Context(CMakeProjectManager::Constants::C_CMAKEEDITOR,
|
||||||
TextEditor::Constants::C_TEXTEDITOR));
|
TextEditor::Constants::C_TEXTEDITOR));
|
||||||
@@ -78,6 +79,11 @@ QString CMakeEditor::id() const
|
|||||||
|
|
||||||
void CMakeEditor::markAsChanged()
|
void CMakeEditor::markAsChanged()
|
||||||
{
|
{
|
||||||
|
if (!file()->isModified())
|
||||||
|
return;
|
||||||
|
if (m_infoBarShown)
|
||||||
|
return;
|
||||||
|
m_infoBarShown = true;
|
||||||
Core::InfoBarEntry info(QLatin1String("CMakeEditor.RunCMake"),
|
Core::InfoBarEntry info(QLatin1String("CMakeEditor.RunCMake"),
|
||||||
tr("Changes to cmake files are shown in the project tree after building."));
|
tr("Changes to cmake files are shown in the project tree after building."));
|
||||||
info.setCustomButtonInfo(tr("Build now"), this, SLOT(build()));
|
info.setCustomButtonInfo(tr("Build now"), this, SLOT(build()));
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ public:
|
|||||||
private slots:
|
private slots:
|
||||||
void markAsChanged();
|
void markAsChanged();
|
||||||
void build();
|
void build();
|
||||||
|
private:
|
||||||
|
bool m_infoBarShown;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CMakeEditorWidget : public TextEditor::BaseTextEditorWidget
|
class CMakeEditorWidget : public TextEditor::BaseTextEditorWidget
|
||||||
|
|||||||
Reference in New Issue
Block a user