forked from qt-creator/qt-creator
Maemo: Link to OpenGL settings page on Qemu crash.
This commit is contained in:
@@ -30,8 +30,9 @@
|
|||||||
#include "maemoqemumanager.h"
|
#include "maemoqemumanager.h"
|
||||||
|
|
||||||
#include "maemoglobal.h"
|
#include "maemoglobal.h"
|
||||||
|
#include "maemomanager.h"
|
||||||
#include "maemoqemuruntimeparser.h"
|
#include "maemoqemuruntimeparser.h"
|
||||||
#include "maemoqemusettings.h"
|
#include "maemosettingspages.h"
|
||||||
#include "maemorunconfiguration.h"
|
#include "maemorunconfiguration.h"
|
||||||
#include "maemotoolchain.h"
|
#include "maemotoolchain.h"
|
||||||
#include "qtversionmanager.h"
|
#include "qtversionmanager.h"
|
||||||
@@ -406,45 +407,27 @@ void MaemoQemuManager::qemuProcessError(QProcess::ProcessError error)
|
|||||||
|
|
||||||
void MaemoQemuManager::qemuStatusChanged(QemuStatus status, const QString &error)
|
void MaemoQemuManager::qemuStatusChanged(QemuStatus status, const QString &error)
|
||||||
{
|
{
|
||||||
QString message;
|
|
||||||
bool running = false;
|
bool running = false;
|
||||||
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case QemuStarting:
|
case QemuStarting:
|
||||||
running = true;
|
running = true;
|
||||||
break;
|
break;
|
||||||
case QemuFailedToStart:
|
case QemuFailedToStart:
|
||||||
message = tr("Qemu failed to start: %1").arg(error);
|
QMessageBox::warning(0, tr("Qemu error"),
|
||||||
|
tr("Qemu failed to start: %1"));
|
||||||
break;
|
break;
|
||||||
case QemuCrashed: {
|
case QemuCrashed:
|
||||||
const MaemoQemuSettings::OpenGlMode openGlMode
|
MaemoManager::instance().qemuSettingsPage()->showQemuCrashDialog();
|
||||||
= MaemoQemuSettings::openGlMode();
|
|
||||||
message = tr("Qemu crashed.");
|
|
||||||
|
|
||||||
// TODO: Provide a link to the settings page (how?).
|
|
||||||
if (openGlMode == MaemoQemuSettings::HardwareAcceleration) {
|
|
||||||
message += tr("\nYou have configured Qemu to use OpenGL "
|
|
||||||
"hardware acceleration, which might not be supported by "
|
|
||||||
"your system. You could try using software rendering instead.");
|
|
||||||
} else if (openGlMode == MaemoQemuSettings::AutoDetect) {
|
|
||||||
message += tr("\nQemu is currently configured to auto-detect the "
|
|
||||||
"OpenGl mode, which is known to not work in some cases."
|
|
||||||
"You might want to use software rendering instead");
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case QemuFinished:
|
case QemuFinished:
|
||||||
message = error;
|
|
||||||
break;
|
|
||||||
case QemuUserReason:
|
case QemuUserReason:
|
||||||
message = error;
|
if (!error.isEmpty())
|
||||||
|
QMessageBox::warning(0, tr("Qemu error"), error);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Q_ASSERT(!"Missing handling of Qemu status");
|
Q_ASSERT(!"Missing handling of Qemu status");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!message.isEmpty())
|
|
||||||
QMessageBox::warning(0, tr("Qemu error"), message);
|
|
||||||
updateStarterIcon(running);
|
updateStarterIcon(running);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,9 +43,17 @@
|
|||||||
|
|
||||||
#include "maemoconstants.h"
|
#include "maemoconstants.h"
|
||||||
#include "maemodeviceconfigurationssettingswidget.h"
|
#include "maemodeviceconfigurationssettingswidget.h"
|
||||||
|
#include "maemoqemusettings.h"
|
||||||
#include "maemoqemusettingswidget.h"
|
#include "maemoqemusettingswidget.h"
|
||||||
|
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
#include <QtCore/QCoreApplication>
|
#include <QtCore/QCoreApplication>
|
||||||
|
#include <QtGui/QDialog>
|
||||||
|
#include <QtGui/QDialogButtonBox>
|
||||||
|
#include <QtGui/QFrame>
|
||||||
|
#include <QtGui/QLabel>
|
||||||
|
#include <QtGui/QVBoxLayout>
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -163,5 +171,68 @@ void MaemoQemuSettingsPage::finish()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class MaemoQemuCrashDialog : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
MaemoQemuCrashDialog(MaemoQemuSettingsPage *settingsPage)
|
||||||
|
: m_settingsPage(settingsPage)
|
||||||
|
{
|
||||||
|
setWindowTitle(tr("Qemu error"));
|
||||||
|
QString message = tr("Qemu crashed.");
|
||||||
|
const MaemoQemuSettings::OpenGlMode openGlMode
|
||||||
|
= MaemoQemuSettings::openGlMode();
|
||||||
|
const QString linkString = QLatin1String("<p><a href=\"dummy\">")
|
||||||
|
+ tr("Click here to change the OpenGL mode.")
|
||||||
|
+ QLatin1String("</a>");
|
||||||
|
if (openGlMode == MaemoQemuSettings::HardwareAcceleration) {
|
||||||
|
message += tr("<p>You have configured Qemu to use OpenGL "
|
||||||
|
"hardware acceleration, which might not be supported by "
|
||||||
|
"your system. You could try using software rendering instead.");
|
||||||
|
message += linkString;
|
||||||
|
} else if (openGlMode == MaemoQemuSettings::AutoDetect) {
|
||||||
|
message += tr("<p>Qemu is currently configured to auto-detect the "
|
||||||
|
"OpenGL mode, which is known to not work in some cases."
|
||||||
|
"You might want to use software rendering instead.");
|
||||||
|
message += linkString;
|
||||||
|
}
|
||||||
|
QLabel * const messageLabel = new QLabel(message, this);
|
||||||
|
messageLabel->setWordWrap(true);
|
||||||
|
messageLabel->setTextFormat(Qt::RichText);
|
||||||
|
connect(messageLabel, SIGNAL(linkActivated(QString)),
|
||||||
|
SLOT(showSettingsPage()));
|
||||||
|
QVBoxLayout *mainLayout = new QVBoxLayout(this);
|
||||||
|
mainLayout->addWidget(messageLabel);
|
||||||
|
QFrame * const separator = new QFrame;
|
||||||
|
separator->setFrameShape(QFrame::HLine);
|
||||||
|
separator->setFrameShadow(QFrame::Sunken);
|
||||||
|
mainLayout->addWidget(separator);
|
||||||
|
QDialogButtonBox * const buttonBox = new QDialogButtonBox;
|
||||||
|
buttonBox->addButton(QDialogButtonBox::Ok);
|
||||||
|
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||||
|
mainLayout->addWidget(buttonBox);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
Q_SLOT void showSettingsPage()
|
||||||
|
{
|
||||||
|
Core::ICore::instance()->showOptionsDialog(m_settingsPage->category(),
|
||||||
|
m_settingsPage->id());
|
||||||
|
accept();
|
||||||
|
}
|
||||||
|
|
||||||
|
MaemoQemuSettingsPage * const m_settingsPage;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void MaemoQemuSettingsPage::showQemuCrashDialog()
|
||||||
|
{
|
||||||
|
MaemoQemuCrashDialog dlg(this);
|
||||||
|
dlg.exec();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|
||||||
|
#include "maemosettingspages.moc"
|
||||||
|
|||||||
@@ -89,6 +89,8 @@ public:
|
|||||||
virtual void apply();
|
virtual void apply();
|
||||||
virtual void finish();
|
virtual void finish();
|
||||||
|
|
||||||
|
void showQemuCrashDialog();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_keywords;
|
QString m_keywords;
|
||||||
MaemoQemuSettingsWidget *m_widget;
|
MaemoQemuSettingsWidget *m_widget;
|
||||||
|
|||||||
Reference in New Issue
Block a user