debugger: show a message box when the script engine does not find its primary file

This commit is contained in:
hjk
2010-07-22 17:21:02 +02:00
parent 631748c37b
commit 688da996f8

View File

@@ -55,6 +55,7 @@
#include <QtCore/QTimer>
#include <QtGui/QApplication>
#include <QtGui/QMessageBox>
#include <QtGui/QToolTip>
#include <QtScript/QScriptContext>
@@ -263,9 +264,10 @@ void ScriptEngine::setupInferior()
showMessage(_("SCRIPT FILE: ") + m_scriptFileName);
QFile scriptFile(m_scriptFileName);
if (!scriptFile.open(QIODevice::ReadOnly|QIODevice::Text)) {
showMessage(_("Cannot open %1: %2").
arg(m_scriptFileName, scriptFile.errorString()), LogError);
notifyEngineSetupFailed();
showMessageBox(QMessageBox::Critical, tr("Error:"),
_("Cannot open script file %1:\n%2").
arg(m_scriptFileName, scriptFile.errorString()));
notifyInferiorSetupFailed();
return;
}
QTextStream stream(&scriptFile);