Debugger: Improve adapter error handling

Correctly reset state on missing Symbian gdb.
Provide "settings" options.
Reviewed-by: hjk <qtc-committer@nokia.com>
This commit is contained in:
Friedemann Kleint
2009-10-08 11:43:26 +02:00
parent 09e72eaa81
commit 81a8f2f927
10 changed files with 71 additions and 30 deletions

View File

@@ -28,6 +28,7 @@
**************************************************************************/
#include "debuggerdialogs.h"
#include "debuggerconstants.h"
#include "ui_attachcoredialog.h"
#include "ui_attachexternaldialog.h"
@@ -39,6 +40,8 @@
# include "shared/dbgwinutils.h"
#endif
#include <coreplugin/icore.h>
#include <QtCore/QDebug>
#include <QtCore/QDir>
#include <QtCore/QFile>
@@ -49,7 +52,7 @@
#include <QtGui/QPushButton>
#include <QtGui/QProxyModel>
#include <QtGui/QSortFilterProxyModel>
#include <QtGui/QMessageBox>
namespace Debugger {
namespace Internal {
@@ -606,5 +609,28 @@ bool AddressDialog::isValid() const
return ok;
}
int warningWithSettings(const QString &title,
const QString &text,
const QString &details,
const QString &settingsId,
QWidget *parent)
{
QMessageBox msgBox(QMessageBox::Warning, title, text,
QMessageBox::Ok, parent);
if (details.isEmpty())
msgBox.setDetailedText(details);
QAbstractButton *settingsButton = 0;
if (!settingsId.isEmpty())
settingsButton = msgBox.addButton(QCoreApplication::translate("Debugger::MessageBox", "Settings..."),
QMessageBox::AcceptRole);
const int dialogCode = msgBox.exec();
if (settingsButton && msgBox.clickedButton() == settingsButton) {
Core::ICore::instance()->showOptionsDialog(QLatin1String(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY),
settingsId);
return 2;
}
return dialogCode;
}
} // namespace Internal
} // namespace Debugger