aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/python
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2020-12-15 12:34:07 +0100
committerEike Ziller <eike.ziller@qt.io>2020-12-17 08:59:24 +0000
commit9f8a48b24536be4b5fd1f977ced7254f41e2832b (patch)
tree725545695d62f14d709796643c98e9ae0e6a717f /src/plugins/python
parent6ac319b94d8a37f26887e90c335783acdf3423aa (diff)
Python: Be less disrupting with the messages pane
Only pop it open directly after explicit interaction Task-number: QTCREATORBUG-24430 Change-Id: I55025a901cb3d694994614bae21204ab9da49fc0 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/python')
-rw-r--r--src/plugins/python/pythonproject.cpp6
-rw-r--r--src/plugins/python/pythonutils.cpp18
2 files changed, 13 insertions, 11 deletions
diff --git a/src/plugins/python/pythonproject.cpp b/src/plugins/python/pythonproject.cpp
index 9b568713844..db15e318bdb 100644
--- a/src/plugins/python/pythonproject.cpp
+++ b/src/plugins/python/pythonproject.cpp
@@ -302,7 +302,7 @@ bool PythonBuildSystem::saveRawList(const QStringList &rawList, const QString &f
QString errorMessage;
result = writePyProjectFile(fileName, content, rawList, &errorMessage);
if (!errorMessage.isEmpty())
- MessageManager::write(errorMessage);
+ MessageManager::writeDisrupting(errorMessage);
}
}
} else { // Old project file
@@ -404,12 +404,12 @@ void PythonBuildSystem::parse()
QString errorMessage;
m_rawFileList = readLinesJson(filePath, &errorMessage);
if (!errorMessage.isEmpty())
- MessageManager::write(errorMessage);
+ MessageManager::writeFlashing(errorMessage);
errorMessage.clear();
m_rawQmlImportPathList = readImportPathsJson(filePath, &errorMessage);
if (!errorMessage.isEmpty())
- MessageManager::write(errorMessage);
+ MessageManager::writeFlashing(errorMessage);
} else if (filePath.endsWith(".pyqtc")) {
// To keep compatibility with PyQt we keep the compatibility with plain
// text files as project files.
diff --git a/src/plugins/python/pythonutils.cpp b/src/plugins/python/pythonutils.cpp
index e08debf860c..56b2dbe6db0 100644
--- a/src/plugins/python/pythonutils.cpp
+++ b/src/plugins/python/pythonutils.cpp
@@ -269,8 +269,9 @@ public:
m_process.start(m_python.toString(), arguments);
- Core::MessageManager::write(tr("Running \"%1 %2\" to install Python language server")
- .arg(m_process.program(), m_process.arguments().join(' ')));
+ Core::MessageManager::writeDisrupting(
+ tr("Running \"%1 %2\" to install Python language server")
+ .arg(m_process.program(), m_process.arguments().join(' ')));
m_killTimer.setSingleShot(true);
m_killTimer.start(5 /*minutes*/ * 60 * 1000);
@@ -280,8 +281,9 @@ private:
void cancel()
{
SynchronousProcess::stopProcess(m_process);
- Core::MessageManager::write(tr("The Python language server installation was canceled by %1.")
- .arg(m_killTimer.isActive() ? tr("user") : tr("time out")));
+ Core::MessageManager::writeFlashing(
+ tr("The Python language server installation was canceled by %1.")
+ .arg(m_killTimer.isActive() ? tr("user") : tr("time out")));
}
void installFinished(int exitCode, QProcess::ExitStatus exitStatus)
@@ -291,7 +293,7 @@ private:
if (Client *client = registerLanguageServer(m_python))
LanguageClientManager::openDocumentWithClient(m_document, client);
} else {
- Core::MessageManager::write(
+ Core::MessageManager::writeFlashing(
tr("Installing the Python language server failed with exit code %1").arg(exitCode));
}
deleteLater();
@@ -301,14 +303,14 @@ private:
{
const QString &stdOut = QString::fromLocal8Bit(m_process.readAllStandardOutput().trimmed());
if (!stdOut.isEmpty())
- Core::MessageManager::write(stdOut);
+ Core::MessageManager::writeSilently(stdOut);
}
void errorAvailable()
{
const QString &stdErr = QString::fromLocal8Bit(m_process.readAllStandardError().trimmed());
if (!stdErr.isEmpty())
- Core::MessageManager::write(stdErr);
+ Core::MessageManager::writeSilently(stdErr);
}
QFutureInterface<void> m_future;
@@ -523,7 +525,7 @@ void openPythonRepl(const FilePath &file, ReplType type)
&ConsoleProcess::processError,
process,
[process, commandLine](const QString &errorString) {
- Core::MessageManager::write(
+ Core::MessageManager::writeDisrupting(
QCoreApplication::translate("Python",
"Failed to run Python (%1): \"%2\".")
.arg(commandLine, errorString));