From 2ee9a06f4cb70f8ff5fe7e73385f3fdcb413640b Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Tue, 25 Nov 2014 13:08:18 +0100 Subject: [PATCH] Debugger: Use Core::AsynchronousMessageBox Nested event loops can lead to crashes, so it is better to use a dialog which does not have have its own event loop. Change-Id: Icd2390c9026bc1ef88e72a570df5813fe5cbdaa2 Reviewed-by: hjk --- src/plugins/debugger/breakwindow.cpp | 1 - src/plugins/debugger/cdb/cdbengine.cpp | 8 ++--- src/plugins/debugger/debuggerengine.cpp | 9 +++-- src/plugins/debugger/debuggerengine.h | 1 - src/plugins/debugger/debuggerplugin.cpp | 9 ++--- src/plugins/debugger/gdb/coregdbadapter.cpp | 7 ++-- src/plugins/debugger/gdb/gdbengine.cpp | 33 ++++++++++--------- .../debugger/gdb/remotegdbserveradapter.cpp | 5 +-- .../debugger/gdb/startgdbserverdialog.cpp | 8 ++--- src/plugins/debugger/gdb/termgdbadapter.cpp | 5 ++- src/plugins/debugger/lldb/lldbengine.cpp | 6 ++-- src/plugins/debugger/memoryagent.cpp | 5 ++- src/plugins/debugger/pdb/pdbengine.cpp | 8 ++--- .../debugger/qml/qscriptdebuggerclient.cpp | 5 +-- .../shared/cdbsymbolpathlisteditor.cpp | 9 ++--- src/plugins/debugger/stackwindow.cpp | 4 +-- src/plugins/debugger/watchwindow.cpp | 5 +-- 17 files changed, 65 insertions(+), 63 deletions(-) diff --git a/src/plugins/debugger/breakwindow.cpp b/src/plugins/debugger/breakwindow.cpp index 7b6cb5b485..257ceee12d 100644 --- a/src/plugins/debugger/breakwindow.cpp +++ b/src/plugins/debugger/breakwindow.cpp @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 103ee14a2a..19f072808c 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -55,6 +55,7 @@ #include #include +#include #include #include @@ -72,7 +73,6 @@ #include #include -#include #include @@ -534,7 +534,7 @@ void CdbEngine::consoleStubError(const QString &msg) STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineIll") notifyEngineIll(); } - showMessageBox(QMessageBox::Critical, tr("Debugger Error"), msg); + Core::AsynchronousMessageBox::critical(tr("Debugger Error"), msg); } void CdbEngine::consoleStubProcessStarted() @@ -552,7 +552,7 @@ void CdbEngine::consoleStubProcessStarted() QString errorMessage; if (!launchCDB(attachParameters, &errorMessage)) { showMessage(errorMessage, LogError); - showMessageBox(QMessageBox::Critical, tr("Failed to Start the Debugger"), errorMessage); + Core::AsynchronousMessageBox::critical(tr("Failed to Start the Debugger"), errorMessage); STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineSetupFailed") notifyEngineSetupFailed(); } @@ -599,7 +599,7 @@ void CdbEngine::setupEngine() qDebug(" #include #include +#include #include #include @@ -72,8 +73,6 @@ #include #include -#include - using namespace Core; using namespace Debugger::Internal; using namespace ProjectExplorer; @@ -1733,7 +1732,7 @@ void DebuggerEngine::showStoppedBySignalMessageBox(QString meaning, QString name "" "
Signal name : %1
Signal meaning : %2
") .arg(name, meaning); - showMessageBox(QMessageBox::Information, tr("Signal received"), msg); + Core::AsynchronousMessageBox::information(tr("Signal received"), msg); } void DebuggerEngine::showStoppedByExceptionMessageBox(const QString &description) @@ -1741,7 +1740,7 @@ void DebuggerEngine::showStoppedByExceptionMessageBox(const QString &description const QString msg = tr("

The inferior stopped because it triggered an exception.

%1"). arg(description); - showMessageBox(QMessageBox::Information, tr("Exception Triggered"), msg); + Core::AsynchronousMessageBox::information(tr("Exception Triggered"), msg); } void DebuggerEngine::openMemoryView(quint64 startAddr, unsigned flags, @@ -1897,7 +1896,7 @@ void DebuggerEngine::validateExecutable(DebuggerStartParameters *sp) return; } if (warnOnRelease) { - showMessageBox(QMessageBox::Information, tr("Warning"), + Core::AsynchronousMessageBox::information(tr("Warning"), tr("This does not seem to be a \"Debug\" build.\n" "Setting breakpoints by file name and line number may fail.") + QLatin1Char('\n') + detailedWarning); diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index 0b8f999ec6..aff6e4a8cd 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -42,7 +42,6 @@ QT_BEGIN_NAMESPACE class QDebug; class QPoint; -class QMessageBox; class QAbstractItemModel; QT_END_NAMESPACE diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index a387e4dd52..85fb547f8f 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -78,6 +78,7 @@ #include #include #include +#include #include #include @@ -1589,8 +1590,8 @@ DebuggerRunControl *DebuggerPluginPrivate::attachToRunningProcess(Kit *kit, IDevice::ConstPtr device = DeviceKitInformation::device(kit); QTC_ASSERT(device, return 0); if (process.pid == 0) { - QMessageBox::warning(ICore::dialogParent(), tr("Warning"), - tr("Cannot attach to process with PID 0")); + Core::AsynchronousMessageBox::warning(tr("Warning"), + tr("Cannot attach to process with PID 0")); return 0; } @@ -1598,14 +1599,14 @@ DebuggerRunControl *DebuggerPluginPrivate::attachToRunningProcess(Kit *kit, if (const ToolChain *tc = ToolChainKitInformation::toolChain(kit)) isWindows = tc->targetAbi().os() == Abi::WindowsOS; if (isWindows && isWinProcessBeingDebugged(process.pid)) { - QMessageBox::warning(ICore::mainWindow(), tr("Process Already Under Debugger Control"), + Core::AsynchronousMessageBox::warning(tr("Process Already Under Debugger Control"), tr("The process %1 is already under the control of a debugger.\n" "Qt Creator cannot attach to it.").arg(process.pid)); return 0; } if (device->type() != PE::DESKTOP_DEVICE_TYPE) { - QMessageBox::warning(ICore::mainWindow(), tr("Not a Desktop Device Type"), + Core::AsynchronousMessageBox::warning(tr("Not a Desktop Device Type"), tr("It is only possible to attach to a locally running process.")); return 0; } diff --git a/src/plugins/debugger/gdb/coregdbadapter.cpp b/src/plugins/debugger/gdb/coregdbadapter.cpp index deec4147ed..64f4d87d2c 100644 --- a/src/plugins/debugger/gdb/coregdbadapter.cpp +++ b/src/plugins/debugger/gdb/coregdbadapter.cpp @@ -30,6 +30,8 @@ #include "coregdbadapter.h" +#include + #include #include #include @@ -39,7 +41,6 @@ #include #include -#include #include using namespace Utils; @@ -185,7 +186,7 @@ void GdbCoreEngine::continueSetupEngine() if (cinfo.isCore) { m_executable = cinfo.foundExecutableName; if (m_executable.isEmpty()) { - showMessageBox(QMessageBox::Warning, + Core::AsynchronousMessageBox::warning( tr("Error Loading Symbols"), tr("No executable to load symbols from specified core.")); notifyEngineSetupFailed(); @@ -196,7 +197,7 @@ void GdbCoreEngine::continueSetupEngine() if (isCore) { startGdb(); } else { - showMessageBox(QMessageBox::Warning, + Core::AsynchronousMessageBox::warning( tr("Error Loading Core File"), tr("The specified file does not appear to be a core file.")); notifyEngineSetupFailed(); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 287c9e21fd..4eef71ad5e 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -65,6 +65,7 @@ #include #include +#include #include #include #include @@ -1072,7 +1073,7 @@ void GdbEngine::handleResultRecord(GdbResponse *response) // with helpers enabled. In this case we get a second response with // msg="Cannot find new threads: generic error" showMessage(_("APPLYING WORKAROUND #1")); - showMessageBox(QMessageBox::Critical, + Core::AsynchronousMessageBox::critical( tr("Executable failed"), QString::fromLocal8Bit(msg)); showStatusMessage(tr("Process failed to start")); //shutdown(); @@ -1098,7 +1099,7 @@ void GdbEngine::handleResultRecord(GdbResponse *response) //showStatusMessage(tr("Executable failed: %1") // .arg(QString::fromLocal8Bit(msg))); //shutdown(); - //showMessageBox(QMessageBox::Critical, + //Core::AsynchronousMessageBox::critical( // tr("Executable failed"), QString::fromLocal8Bit(msg)); } else if (msg.contains("Cannot insert breakpoint")) { // For breakpoints set by address to non-existent addresses we @@ -1112,7 +1113,7 @@ void GdbEngine::handleResultRecord(GdbResponse *response) // long as the breakpoints are enabled. // FIXME: Should we silently disable the offending breakpoints? showMessage(_("APPLYING WORKAROUND #5")); - showMessageBox(QMessageBox::Critical, + Core::AsynchronousMessageBox::critical( tr("Setting breakpoints failed"), QString::fromLocal8Bit(msg)); QTC_CHECK(state() == InferiorRunOk); notifyInferiorSpontaneousStop(); @@ -1128,7 +1129,7 @@ void GdbEngine::handleResultRecord(GdbResponse *response) if (!m_lastWinException.isEmpty()) logMsg = m_lastWinException + QLatin1Char('\n'); logMsg += QString::fromLocal8Bit(msg); - showMessageBox(QMessageBox::Critical, tr("Executable Failed"), logMsg); + Core::AsynchronousMessageBox::critical(tr("Executable Failed"), logMsg); showStatusMessage(tr("Executable failed: %1").arg(logMsg)); } } @@ -1793,7 +1794,7 @@ void GdbEngine::handlePythonSetup(const GdbResponse &response) QString out1 = _("The selected build of GDB does not support Python scripting."); QString out2 = _("It cannot be used in Qt Creator."); showStatusMessage(out1 + QLatin1Char(' ') + out2); - showMessageBox(QMessageBox::Critical, tr("Execution Error"), out1 + _("
") + out2); + Core::AsynchronousMessageBox::critical(tr("Execution Error"), out1 + _("
") + out2); } notifyEngineSetupFailed(); } @@ -1801,7 +1802,7 @@ void GdbEngine::handlePythonSetup(const GdbResponse &response) void GdbEngine::showExecutionError(const QString &message) { - showMessageBox(QMessageBox::Critical, tr("Execution Error"), + Core::AsynchronousMessageBox::critical(tr("Execution Error"), tr("Cannot continue debugged process:") + QLatin1Char('\n') + message); } @@ -1933,7 +1934,7 @@ void GdbEngine::handleInferiorShutdown(const GdbResponse &response) notifyInferiorShutdownOk(); return; } - showMessageBox(QMessageBox::Critical, + Core::AsynchronousMessageBox::critical( tr("Failed to shut down application"), msgInferiorStopFailed(QString::fromLocal8Bit(ba))); notifyInferiorShutdownFailed(); @@ -2206,7 +2207,7 @@ void GdbEngine::handleExecuteNext(const GdbResponse &response) showExecutionError(QString::fromLocal8Bit(msg)); notifyInferiorRunFailed(); } else { - showMessageBox(QMessageBox::Critical, tr("Execution Error"), + Core::AsynchronousMessageBox::critical(tr("Execution Error"), tr("Cannot continue debugged process:") + QLatin1Char('\n') + QString::fromLocal8Bit(msg)); notifyInferiorIll(); } @@ -3061,7 +3062,7 @@ void GdbEngine::handleShowModuleSymbols(const GdbResponse &response) file.remove(); Internal::showModuleSymbols(modulePath, symbols); } else { - showMessageBox(QMessageBox::Critical, tr("Cannot Read Symbols"), + Core::AsynchronousMessageBox::critical(tr("Cannot Read Symbols"), tr("Cannot read symbols for module \"%1\".").arg(fileName)); } } @@ -3528,7 +3529,7 @@ void GdbEngine::createSnapshot() postCommand("gcore " + fileName.toLocal8Bit(), NeedsStop|ConsoleCommand, CB(handleMakeSnapshot), fileName); } else { - showMessageBox(QMessageBox::Critical, tr("Snapshot Creation Error"), + Core::AsynchronousMessageBox::critical(tr("Snapshot Creation Error"), tr("Cannot create snapshot file.")); } } @@ -3551,7 +3552,7 @@ void GdbEngine::handleMakeSnapshot(const GdbResponse &response) DebuggerRunControlFactory::createAndScheduleRun(sp); } else { QByteArray msg = response.data["msg"].data(); - showMessageBox(QMessageBox::Critical, tr("Snapshot Creation Error"), + Core::AsynchronousMessageBox::critical(tr("Snapshot Creation Error"), tr("Cannot create snapshot:") + QLatin1Char('\n') + QString::fromLocal8Bit(msg)); } } @@ -4299,7 +4300,7 @@ void GdbEngine::loadInitScript() if (QFileInfo(script).isReadable()) { postCommand("source " + script.toLocal8Bit()); } else { - showMessageBox(QMessageBox::Warning, + Core::AsynchronousMessageBox::warning( tr("Cannot find debugger initialization script"), tr("The debugger settings point to a script file at \"%1\" " "which is not accessible. If a script file is not needed, " @@ -4336,7 +4337,7 @@ void GdbEngine::handleGdbError(QProcess::ProcessError error) default: //m_gdbProc->kill(); //notifyEngineIll(); - showMessageBox(QMessageBox::Critical, tr("GDB I/O Error"), msg); + Core::AsynchronousMessageBox::critical(tr("GDB I/O Error"), msg); break; } } @@ -4364,7 +4365,7 @@ void GdbEngine::handleGdbFinished(int code, QProcess::ExitStatus type) const QString msg = type == QProcess::CrashExit ? tr("The gdb process terminated.") : tr("The gdb process terminated unexpectedly (code %1)").arg(code); - showMessageBox(QMessageBox::Critical, tr("Unexpected GDB Exit"), msg); + Core::AsynchronousMessageBox::critical(tr("Unexpected GDB Exit"), msg); break; } } @@ -4531,7 +4532,7 @@ void GdbEngine::notifyInferiorSetupFailed(const QString &msg) return; // Adapter crashed meanwhile, so this notification is meaningless. } showMessage(_("INFERIOR START FAILED")); - showMessageBox(QMessageBox::Critical, tr("Failed to start application"), msg); + Core::AsynchronousMessageBox::critical(tr("Failed to start application"), msg); DebuggerEngine::notifyInferiorSetupFailed(); } @@ -4553,7 +4554,7 @@ void GdbEngine::handleAdapterCrashed(const QString &msg) m_gdbProc->kill(); if (!msg.isEmpty()) - showMessageBox(QMessageBox::Critical, tr("Adapter crashed"), msg); + Core::AsynchronousMessageBox::critical(tr("Adapter crashed"), msg); } void GdbEngine::createFullBacktrace() diff --git a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp index 836ef3eb6e..63cacf3a7d 100644 --- a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp +++ b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp @@ -38,12 +38,13 @@ #include #include +#include + #include #include #include #include -#include namespace Debugger { namespace Internal { @@ -130,7 +131,7 @@ void GdbRemoteServerEngine::uploadProcError(QProcess::ProcessError error) } showMessage(msg, StatusBar); - showMessageBox(QMessageBox::Critical, tr("Error"), msg); + Core::AsynchronousMessageBox::critical(tr("Error"), msg); } void GdbRemoteServerEngine::readUploadStandardOutput() diff --git a/src/plugins/debugger/gdb/startgdbserverdialog.cpp b/src/plugins/debugger/gdb/startgdbserverdialog.cpp index 1147074722..462deb6128 100644 --- a/src/plugins/debugger/gdb/startgdbserverdialog.cpp +++ b/src/plugins/debugger/gdb/startgdbserverdialog.cpp @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -45,7 +46,6 @@ #include #include -#include #include using namespace Core; @@ -90,7 +90,7 @@ GdbServerStarter::~GdbServerStarter() void GdbServerStarter::handleRemoteError(const QString &errorMsg) { - QMessageBox::critical(0, tr("Remote Error"), errorMsg); + Core::AsynchronousMessageBox::critical(tr("Remote Error"), errorMsg); } void GdbServerStarter::portGathererError(const QString &text) @@ -191,7 +191,7 @@ void GdbServerStarter::attach(int port) localExecutable = candidate; } if (localExecutable.isEmpty()) { - QMessageBox::warning(ICore::mainWindow(), tr("Warning"), + Core::AsynchronousMessageBox::warning(tr("Warning"), tr("Cannot find local executable for remote process \"%1\".") .arg(d->process.exe)); return; @@ -199,7 +199,7 @@ void GdbServerStarter::attach(int port) QList abis = Abi::abisOfBinary(Utils::FileName::fromString(localExecutable)); if (abis.isEmpty()) { - QMessageBox::warning(ICore::mainWindow(), tr("Warning"), + Core::AsynchronousMessageBox::warning(tr("Warning"), tr("Cannot find ABI for remote process \"%1\".") .arg(d->process.exe)); return; diff --git a/src/plugins/debugger/gdb/termgdbadapter.cpp b/src/plugins/debugger/gdb/termgdbadapter.cpp index 682c9526da..ed09de635b 100644 --- a/src/plugins/debugger/gdb/termgdbadapter.cpp +++ b/src/plugins/debugger/gdb/termgdbadapter.cpp @@ -39,8 +39,7 @@ #include #include #include - -#include +#include using namespace Utils; @@ -188,7 +187,7 @@ void GdbTermEngine::interruptInferior2() void GdbTermEngine::stubError(const QString &msg) { - showMessageBox(QMessageBox::Critical, tr("Debugger Error"), msg); + Core::AsynchronousMessageBox::critical(tr("Debugger Error"), msg); } void GdbTermEngine::stubExited() diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index ee0b45a772..d669c4e016 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -55,6 +55,7 @@ #include #include +#include #include #include @@ -66,7 +67,6 @@ #include #include -#include #include using namespace Utils; @@ -949,7 +949,7 @@ void LldbEngine::handleLldbError(QProcess::ProcessError error) default: //setState(EngineShutdownRequested, true); m_lldbProc.kill(); - showMessageBox(QMessageBox::Critical, tr("LLDB I/O Error"), + Core::AsynchronousMessageBox::critical(tr("LLDB I/O Error"), errorMessage(error)); break; } @@ -1441,7 +1441,7 @@ void LldbEngine::stubStarted() void LldbEngine::stubError(const QString &msg) { - showMessageBox(QMessageBox::Critical, tr("Debugger Error"), msg); + Core::AsynchronousMessageBox::critical(tr("Debugger Error"), msg); } void LldbEngine::stubExited() diff --git a/src/plugins/debugger/memoryagent.cpp b/src/plugins/debugger/memoryagent.cpp index a38249abb5..2c800ade31 100644 --- a/src/plugins/debugger/memoryagent.cpp +++ b/src/plugins/debugger/memoryagent.cpp @@ -40,13 +40,12 @@ #include #include #include +#include #include #include #include -#include - #include using namespace Core; @@ -197,7 +196,7 @@ void MemoryAgent::createBinEditor(quint64 addr, unsigned flags, const QString &title, QWidget *parent) { if (!doCreateBinEditor(addr, flags, ml, pos, title, parent)) - showMessageBox(QMessageBox::Warning, + Core::AsynchronousMessageBox::warning( tr("No Memory Viewer Available"), tr("The memory contents cannot be shown as no viewer plugin " "for binary data has been loaded.")); diff --git a/src/plugins/debugger/pdb/pdbengine.cpp b/src/plugins/debugger/pdb/pdbengine.cpp index 8c2b432cba..43ea8668f9 100644 --- a/src/plugins/debugger/pdb/pdbengine.cpp +++ b/src/plugins/debugger/pdb/pdbengine.cpp @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -61,7 +62,6 @@ #include #include -#include #include @@ -198,7 +198,7 @@ void PdbEngine::setupInferior() QString fileName = QFileInfo(startParameters().executable).absoluteFilePath(); QFile scriptFile(fileName); if (!scriptFile.open(QIODevice::ReadOnly|QIODevice::Text)) { - showMessageBox(QMessageBox::Critical, tr("Python Error"), + Core::AsynchronousMessageBox::critical(tr("Python Error"), _("Cannot open script file %1:\n%2"). arg(fileName, scriptFile.errorString())); notifyInferiorSetupFailed(); @@ -555,8 +555,8 @@ void PdbEngine::handlePdbError(QProcess::ProcessError error) default: //setState(EngineShutdownRequested, true); m_pdbProc.kill(); - showMessageBox(QMessageBox::Critical, tr("Pdb I/O Error"), - errorMessage(error)); + Core::AsynchronousMessageBox::critical(tr("Pdb I/O Error"), + errorMessage(error)); break; } } diff --git a/src/plugins/debugger/qml/qscriptdebuggerclient.cpp b/src/plugins/debugger/qml/qscriptdebuggerclient.cpp index 5013e29e6d..61d3664552 100644 --- a/src/plugins/debugger/qml/qscriptdebuggerclient.cpp +++ b/src/plugins/debugger/qml/qscriptdebuggerclient.cpp @@ -37,8 +37,9 @@ #include #include +#include + #include -#include #include using QmlDebug::QmlDebugStream; @@ -448,7 +449,7 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data) .arg(error.toHtmlEscaped()) : tr("

An uncaught exception occurred in \"%1\":

%2

") .arg(QLatin1String(stackFrames.value(0).fileUrl), error.toHtmlEscaped()); - showMessageBox(QMessageBox::Information, tr("Uncaught Exception"), msg); + Core::AsynchronousMessageBox::information(tr("Uncaught Exception"), msg); } else { QString file; int line = -1; diff --git a/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp b/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp index 391445ba3b..77ce4174e2 100644 --- a/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp +++ b/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp @@ -31,6 +31,7 @@ #include "cdbsymbolpathlisteditor.h" #include +#include #include #include @@ -98,15 +99,15 @@ void CacheDirectoryDialog::accept() } // Does a file of the same name exist? if (fi.exists()) { - QMessageBox::warning(this, tr("Already Exists"), - tr("A file named \"%1\" already exists.").arg(cache)); + Core::AsynchronousMessageBox::warning(tr("Already Exists"), + tr("A file named \"%1\" already exists.").arg(cache)); return; } // Create QDir root(QDir::root()); if (!root.mkpath(cache)) { - QMessageBox::warning(this, tr("Cannot Create"), - tr("The folder \"%1\" could not be created.").arg(cache)); + Core::AsynchronousMessageBox::warning(tr("Cannot Create"), + tr("The folder \"%1\" could not be created.").arg(cache)); return; } QDialog::accept(); diff --git a/src/plugins/debugger/stackwindow.cpp b/src/plugins/debugger/stackwindow.cpp index 5b8cadab56..c621d84d19 100644 --- a/src/plugins/debugger/stackwindow.cpp +++ b/src/plugins/debugger/stackwindow.cpp @@ -37,6 +37,7 @@ #include "debuggerdialogs.h" #include "memoryagent.h" +#include #include @@ -50,7 +51,6 @@ #include #include #include -#include #include namespace Debugger { @@ -127,7 +127,7 @@ void saveTaskFile(QWidget *parent, const StackHandler *sh) const QString fileName = fileDialog.selectedFiles().front(); file.setFileName(fileName); if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { - QMessageBox::warning(parent, StackTreeView::tr("Cannot Open Task File"), + Core::AsynchronousMessageBox::warning(StackTreeView::tr("Cannot Open Task File"), StackTreeView::tr("Cannot open \"%1\": %2").arg(QDir::toNativeSeparators(fileName), file.errorString())); } } diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index 02737482e8..94bc92da7a 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -44,6 +44,8 @@ #include +#include + #include #include #include @@ -55,7 +57,6 @@ #include #include #include -#include #include #include #include @@ -436,7 +437,7 @@ static void addStackLayoutMemoryView(DebuggerEngine *engine, bool separateView, end += 8 - remainder; // Anything found and everything in a sensible range (static data in-between)? if (end <= start || end - start > 100 * 1024) { - QMessageBox::information(parent, + Core::AsynchronousMessageBox::information( WatchTreeView::tr("Cannot Display Stack Layout"), WatchTreeView::tr("Could not determine a suitable address range.")); return; -- GitLab