Commit 26331f77 authored by hjk's avatar hjk

Debugger: Avoid messagesboxes on the same topic at the same time

Task-number: QTCREATORBUG-16971
Change-Id: I625f04cbd8f609c66597450dbad22ebc6eadcfe5
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
parent c16d3505
......@@ -383,6 +383,7 @@ public:
// Safety net to avoid infinite lookups.
QSet<QString> m_lookupRequests; // FIXME: Integrate properly.
QPointer<QWidget> m_alertBox;
};
......@@ -1813,8 +1814,11 @@ QString DebuggerEngine::msgInterrupted()
return tr("Interrupted.");
}
void DebuggerEngine::showStoppedBySignalMessageBox(QString meaning, QString name)
bool DebuggerEngine::showStoppedBySignalMessageBox(QString meaning, QString name)
{
if (d->m_alertBox)
return false;
if (name.isEmpty())
name = ' ' + tr("<Unknown>", "name") + ' ';
if (meaning.isEmpty())
......@@ -1824,7 +1828,9 @@ void DebuggerEngine::showStoppedBySignalMessageBox(QString meaning, QString name
"<table><tr><td>Signal name : </td><td>%1</td></tr>"
"<tr><td>Signal meaning : </td><td>%2</td></tr></table>")
.arg(name, meaning);
AsynchronousMessageBox::information(tr("Signal Received"), msg);
d->m_alertBox = AsynchronousMessageBox::information(tr("Signal Received"), msg);
return true;
}
void DebuggerEngine::showStoppedByExceptionMessageBox(const QString &description)
......
......@@ -415,7 +415,7 @@ protected:
static QString msgStoppedByException(const QString &description,
const QString &threadId);
static QString msgInterrupted();
void showStoppedBySignalMessageBox(const QString meaning, QString name);
bool showStoppedBySignalMessageBox(const QString meaning, QString name);
void showStoppedByExceptionMessageBox(const QString &description);
bool isStateDebugging() const;
......
......@@ -1629,7 +1629,10 @@ void GdbEngine::handleStop2(const GdbMi &data)
} else {
showMessage("HANDLING SIGNAL " + name);
if (boolSetting(UseMessageBoxForSignals) && !isStopperThread)
showStoppedBySignalMessageBox(meaning, name);
if (!showStoppedBySignalMessageBox(meaning, name)) {
showMessage("SIGNAL RECEIVED WHILE SHOWING SIGNAL MESSAGE");
return;
}
if (!name.isEmpty() && !meaning.isEmpty())
reasontr = msgStoppedBySignal(meaning, name);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment