diff --git a/src/plugins/texteditor/plaintexteditor.cpp b/src/plugins/texteditor/plaintexteditor.cpp index 56be20f9f5f..67b99faabfc 100644 --- a/src/plugins/texteditor/plaintexteditor.cpp +++ b/src/plugins/texteditor/plaintexteditor.cpp @@ -214,6 +214,8 @@ void PlainTextEditor::configure(const Core::MimeType &mimeType) // because Kate recommends to configure indentation through another feature. Maybe we should // provide something similar in Creator? For now, only normal indentation is supported. m_indenter.reset(new NormalIndenter); + + emit configured(editableInterface()); } bool PlainTextEditor::isMissingSyntaxDefinition() const diff --git a/src/plugins/texteditor/plaintexteditor.h b/src/plugins/texteditor/plaintexteditor.h index 55fb62ca035..2d8a2309ccc 100644 --- a/src/plugins/texteditor/plaintexteditor.h +++ b/src/plugins/texteditor/plaintexteditor.h @@ -81,6 +81,9 @@ public slots: private slots: void configure(); +signals: + void configured(Core::IEditor *editor); + protected: virtual BaseTextEditorEditable *createEditableInterface() { return new PlainTextEditorEditable(this); } virtual void indentBlock(QTextDocument *doc, QTextBlock block, QChar typedChar); diff --git a/src/plugins/texteditor/plaintexteditorfactory.cpp b/src/plugins/texteditor/plaintexteditorfactory.cpp index e060df18731..a26f3bd2df9 100644 --- a/src/plugins/texteditor/plaintexteditorfactory.cpp +++ b/src/plugins/texteditor/plaintexteditorfactory.cpp @@ -83,6 +83,8 @@ Core::IEditor *PlainTextEditorFactory::createEditor(QWidget *parent) { PlainTextEditor *rc = new PlainTextEditor(parent); TextEditorPlugin::instance()->initializeEditor(rc); + connect(rc, SIGNAL(configured(Core::IEditor*)), + this, SLOT(updateEditorInfoBar(Core::IEditor*))); return rc->editableInterface(); } @@ -95,14 +97,15 @@ void PlainTextEditorFactory::updateEditorInfoBar(Core::IEditor *editor) TextEditorSettings::instance()->highlighterSettings().alertWhenNoDefinition()) { Core::EditorManager::instance()->showEditorInfoBar( Constants::INFO_SYNTAX_DEFINITION, - tr("A highlight definition was not found for this file. Would you like to try to find one?"), + tr("A highlight definition was not found for this file. " + "Would you like to try to find one?"), tr("Show highlighter options"), Manager::instance(), SLOT(showGenericHighlighterOptions())); + return; } - } else { - Core::EditorManager::instance()->hideEditorInfoBar(Constants::INFO_SYNTAX_DEFINITION); } + Core::EditorManager::instance()->hideEditorInfoBar(Constants::INFO_SYNTAX_DEFINITION); } void PlainTextEditorFactory::addMimeType(const QString &type)