forked from qt-creator/qt-creator
Debugger: Do configuration error checking early on.
Add a configuration checking method to the Debugger manager, depending on toolchain, wire it to the engines. Check that in the debugger run controls. Add a convenience method to ICore that shows a warning message with a "Settings" button, pointing the user to a configuration error on a settings page. Remove leftovers of the dumper parser. Acked-by: con <qtc-committer@nokia.com>
This commit is contained in:
@@ -69,6 +69,17 @@ bool CoreImpl::showOptionsDialog(const QString &group, const QString &page, QWid
|
||||
return m_mainwindow->showOptionsDialog(group, page, parent);
|
||||
}
|
||||
|
||||
bool CoreImpl::showWarningWithOptions(const QString &title, const QString &text,
|
||||
const QString &details,
|
||||
const QString &settingsCategory,
|
||||
const QString &settingsId,
|
||||
QWidget *parent)
|
||||
{
|
||||
return m_mainwindow->showWarningWithOptions(title, text,
|
||||
details, settingsCategory,
|
||||
settingsId, parent);
|
||||
}
|
||||
|
||||
ActionManager *CoreImpl::actionManager() const
|
||||
{
|
||||
return m_mainwindow->actionManager();
|
||||
|
||||
@@ -50,6 +50,11 @@ public:
|
||||
bool showOptionsDialog(const QString &group = QString(),
|
||||
const QString &page = QString(),
|
||||
QWidget *parent = 0);
|
||||
bool showWarningWithOptions(const QString &title, const QString &text,
|
||||
const QString &details = QString(),
|
||||
const QString &settingsCategory = QString(),
|
||||
const QString &settingsId = QString(),
|
||||
QWidget *parent = 0);
|
||||
|
||||
ActionManager *actionManager() const;
|
||||
FileManager *fileManager() const ;
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void ICore::showOptionsDialog(const QString &group = QString(),
|
||||
\fn bool ICore::showOptionsDialog(const QString &group = QString(),
|
||||
const QString &page = QString())
|
||||
\brief Opens the application options/preferences dialog with preselected
|
||||
\a page in a specified \a group.
|
||||
@@ -76,6 +76,20 @@
|
||||
The arguments refer to the string IDs of the corresponding IOptionsPage.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool ICore::showWarningWithOptions(const QString &title, const QString &text,
|
||||
const QString &details = QString(),
|
||||
const QString &settingsCategory = QString(),
|
||||
const QString &settingsId = QString(),
|
||||
QWidget *parent = 0);
|
||||
|
||||
\brief Show a warning message with a button that opens a settings page.
|
||||
|
||||
Should be used to display configuration errors and point users to the setting.
|
||||
Returns true if the settings dialog was accepted.
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\fn ActionManager *ICore::actionManager() const
|
||||
\brief Returns the application's action manager.
|
||||
|
||||
@@ -75,6 +75,12 @@ public:
|
||||
const QString &page = QString(),
|
||||
QWidget *parent = 0) = 0;
|
||||
|
||||
virtual bool showWarningWithOptions(const QString &title, const QString &text,
|
||||
const QString &details = QString(),
|
||||
const QString &settingsCategory = QString(),
|
||||
const QString &settingsId = QString(),
|
||||
QWidget *parent = 0) = 0;
|
||||
|
||||
virtual ActionManager *actionManager() const = 0;
|
||||
virtual FileManager *fileManager() const = 0;
|
||||
virtual UniqueIDManager *uniqueIDManager() const = 0;
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
#include <QtGui/QWizard>
|
||||
#include <QtGui/QPrinter>
|
||||
#include <QtGui/QToolButton>
|
||||
#include <QtGui/QMessageBox>
|
||||
|
||||
/*
|
||||
#ifdef Q_OS_UNIX
|
||||
@@ -1262,3 +1263,28 @@ void MainWindow::setFullScreen(bool on)
|
||||
}
|
||||
}
|
||||
|
||||
// Display a warning with an additional button to open
|
||||
// the debugger settings dialog if settingsId is nonempty.
|
||||
|
||||
bool MainWindow::showWarningWithOptions(const QString &title,
|
||||
const QString &text,
|
||||
const QString &details,
|
||||
const QString &settingsCategory,
|
||||
const QString &settingsId,
|
||||
QWidget *parent)
|
||||
{
|
||||
if (parent == 0)
|
||||
parent = this;
|
||||
QMessageBox msgBox(QMessageBox::Warning, title, text,
|
||||
QMessageBox::Ok, parent);
|
||||
if (details.isEmpty())
|
||||
msgBox.setDetailedText(details);
|
||||
QAbstractButton *settingsButton = 0;
|
||||
if (!settingsId.isEmpty() || !settingsCategory.isEmpty())
|
||||
settingsButton = msgBox.addButton(tr("Settings..."), QMessageBox::AcceptRole);
|
||||
msgBox.exec();
|
||||
if (settingsButton && msgBox.clickedButton() == settingsButton) {
|
||||
return showOptionsDialog(settingsCategory, settingsId);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -138,6 +138,12 @@ public slots:
|
||||
const QString &page = QString(),
|
||||
QWidget *parent = 0);
|
||||
|
||||
bool showWarningWithOptions(const QString &title, const QString &text,
|
||||
const QString &details = QString(),
|
||||
const QString &settingsCategory = QString(),
|
||||
const QString &settingsId = QString(),
|
||||
QWidget *parent = 0);
|
||||
|
||||
protected:
|
||||
virtual void changeEvent(QEvent *e);
|
||||
virtual void closeEvent(QCloseEvent *event);
|
||||
|
||||
Reference in New Issue
Block a user