TextEditor: Do not pop up general messages pane

General messages pane should only be opened on direct user interaction.

Task-number: QTCREATORBUG-24430
Change-Id: I62f6849ca5a32f0a75c5a91a667ee704d3632d1a
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2020-12-17 09:21:55 +01:00
parent c01c69fc99
commit efa0f74645
2 changed files with 10 additions and 13 deletions

View File

@@ -281,7 +281,7 @@ static void updateEditorText(QPlainTextEdit *editor, const QString &text)
static void showError(const QString &error) static void showError(const QString &error)
{ {
Core::MessageManager::write( Core::MessageManager::writeFlashing(
QString(QT_TRANSLATE_NOOP("TextEditor", "Error in text formatting: %1")) QString(QT_TRANSLATE_NOOP("TextEditor", "Error in text formatting: %1"))
.arg(error.trimmed())); .arg(error.trimmed()));
} }

View File

@@ -236,22 +236,19 @@ void Highlighter::addCustomHighlighterPath(const Utils::FilePath &path)
void Highlighter::downloadDefinitions(std::function<void()> callback) { void Highlighter::downloadDefinitions(std::function<void()> callback) {
auto downloader = auto downloader =
new KSyntaxHighlighting::DefinitionDownloader(highlightRepository()); new KSyntaxHighlighting::DefinitionDownloader(highlightRepository());
connect(downloader, &KSyntaxHighlighting::DefinitionDownloader::done, connect(downloader, &KSyntaxHighlighting::DefinitionDownloader::done, [downloader, callback]() {
[downloader, callback]() { Core::MessageManager::writeFlashing(tr("Highlighter updates: done"));
Core::MessageManager::write(tr("Highlighter updates: done"), downloader->deleteLater();
Core::MessageManager::ModeSwitch); reload();
downloader->deleteLater(); if (callback)
reload(); callback();
if (callback) });
callback();
});
connect(downloader, connect(downloader,
&KSyntaxHighlighting::DefinitionDownloader::informationMessage, &KSyntaxHighlighting::DefinitionDownloader::informationMessage,
[](const QString &message) { [](const QString &message) {
Core::MessageManager::write(tr("Highlighter updates:") + ' ' + Core::MessageManager::writeSilently(tr("Highlighter updates:") + ' ' + message);
message,
Core::MessageManager::ModeSwitch);
}); });
Core::MessageManager::writeDisrupting(tr("Highlighter updates: starting"));
downloader->start(); downloader->start();
} }