From c97fac811699b754174eedb49b7aed517afd4266 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Sun, 23 Jun 2013 21:16:51 +0200 Subject: [PATCH] use QMessageBox to show errors --- apps/launcher/graphicspage.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index 333dff121..f6550f2a1 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -157,7 +157,12 @@ bool GraphicsPage::setupSDL() if (displays < 0) { - qDebug() << "SDL_GetNumVideoDisplays failed: " << QString::fromStdString(SDL_GetError()); + QMessageBox msgBox; + msgBox.setWindowTitle(tr("Error receiving number of screens")); + msgBox.setIcon(QMessageBox::Critical); + msgBox.setStandardButtons(QMessageBox::Ok); + msgBox.setText(tr("
SDL_GetNumDisplayModes failed:

") + QString::fromStdString(SDL_GetError()) + "
"); + msgBox.exec(); return false; } @@ -281,7 +286,12 @@ QStringList GraphicsPage::getAvailableResolutions(int screen) if (modes < 0) { - qDebug() << "SDL_GetNumDisplayModes failed: " << QString::fromStdString(SDL_GetError()); + QMessageBox msgBox; + msgBox.setWindowTitle(tr("Error receiving resolutions")); + msgBox.setIcon(QMessageBox::Critical); + msgBox.setStandardButtons(QMessageBox::Ok); + msgBox.setText(tr("
SDL_GetNumDisplayModes failed:

") + QString::fromStdString(SDL_GetError()) + "
"); + msgBox.exec(); return result; } @@ -289,7 +299,12 @@ QStringList GraphicsPage::getAvailableResolutions(int screen) { if (SDL_GetDisplayMode(screen, modeIndex, &mode) < 0) { - qDebug() << "SDL_GetDisplayMode failed: " << QString::fromStdString(SDL_GetError()); + QMessageBox msgBox; + msgBox.setWindowTitle(tr("Error receiving resolutions")); + msgBox.setIcon(QMessageBox::Critical); + msgBox.setStandardButtons(QMessageBox::Ok); + msgBox.setText(tr("
SDL_GetDisplayMode failed:

") + QString::fromStdString(SDL_GetError()) + "
"); + msgBox.exec(); return result; }