Generic highlighter: Show/hide info bar whenever the editor is configured.

This commit is contained in:
Leandro Melo
2010-09-20 11:47:01 +02:00
parent 58b800218b
commit 4d0176cd74
3 changed files with 11 additions and 3 deletions

View File

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