diff --git a/src/plugins/analyzerbase/analyzermanager.cpp b/src/plugins/analyzerbase/analyzermanager.cpp index c2e71f1e589..2e72046df8b 100644 --- a/src/plugins/analyzerbase/analyzermanager.cpp +++ b/src/plugins/analyzerbase/analyzermanager.cpp @@ -70,6 +70,7 @@ #include #include #include +#include #include #include @@ -90,6 +91,7 @@ #include #include #include +#include using namespace Core; using namespace Analyzer; @@ -464,38 +466,25 @@ void AnalyzerManager::AnalyzerManagerPrivate::startTool() const QString currentMode = buildType == ProjectExplorer::BuildConfiguration::Debug ? tr("Debug") : tr("Release"); QSettings *settings = Core::ICore::instance()->settings(); - const QString configKey = QString("%1/%2").arg(Constants::MODE_ANALYZE, "AnalyzeCorrectMode"); + const QString configKey = QLatin1String(Constants::MODE_ANALYZE) + QLatin1Char('/') + QLatin1String("AnalyzeCorrectMode"); int ret; if (settings->contains(configKey)) { ret = settings->value(configKey, QDialog::Accepted).toInt(); } else { - QDialog dialog; - dialog.setWindowTitle(tr("Run %1 in %2 mode?").arg(toolName).arg(currentMode)); - QGridLayout *layout = new QGridLayout; - QLabel *iconLabel = new QLabel; - iconLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - QIcon icon = dialog.style()->standardIcon(QStyle::SP_MessageBoxInformation); - dialog.setWindowIcon(icon); - iconLabel->setPixmap(icon.pixmap(QSize(icon.actualSize(QSize(64, 64))))); - layout->addWidget(iconLabel, 0, 0); - QLabel *textLabel = new QLabel; - textLabel->setWordWrap(true); - textLabel->setText(tr("You are trying to run %1 on an application in %2 mode. " - "%1 is designed to be used in %3 mode.\n\n" - "Do you want to continue and run %1 in %2 mode?").arg(toolName).arg(currentMode).arg(toolMode)); - layout->addWidget(textLabel, 0, 1); - QCheckBox *dontAskAgain = new QCheckBox; - dontAskAgain->setText(tr("&Do not ask again")); - layout->addWidget(dontAskAgain, 1, 0, 1, 2); - QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Yes | QDialogButtonBox::Cancel); - connect(buttons, SIGNAL(accepted()), - &dialog, SLOT(accept())); - connect(buttons, SIGNAL(rejected()), - &dialog, SLOT(reject())); - layout->addWidget(buttons, 2, 0, 1, 2); - dialog.setLayout(layout); - ret = dialog.exec(); - if (dontAskAgain->isChecked() && ret == QDialog::Accepted) + const QString title = tr("Run %1 in %2 Mode?").arg(toolName).arg(currentMode); + const QString message = tr("

You are trying to run the tool '%1' on an application in %2 mode. " + "The tool is designed to be used in %3 mode.

" + "Do you want to continue and run it in %2 mode?

"). + arg(toolName).arg(currentMode).arg(toolMode); + const QString checkBoxText = tr("&Do not ask again"); + bool checkBoxSetting = false; + const QDialogButtonBox::StandardButton button = + Utils::CheckableMessageBox::question(Core::ICore::instance()->mainWindow(), title, message, checkBoxText, + &checkBoxSetting, QDialogButtonBox::Yes|QDialogButtonBox::Cancel, + QDialogButtonBox::Cancel); + ret = button == QDialogButtonBox::Yes ? QDialog::Accepted : QDialog::Rejected; + + if (checkBoxSetting && ret == QDialog::Accepted) settings->setValue(configKey, ret); } if (ret == QDialog::Rejected) diff --git a/src/plugins/qt4projectmanager/qt-s60/s60deploystep.cpp b/src/plugins/qt4projectmanager/qt-s60/s60deploystep.cpp index 1b776d7252a..68a1cb689ec 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60deploystep.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60deploystep.cpp @@ -570,10 +570,10 @@ void S60DeployStep::handleSymbianInstall(const Coda::CodaCommandResult &result) else initFileInstallation(); } else { - reportError(tr("Installation failed: %1, " - "Explanation of error codes is available at: %2") - .arg(result.errorString()) - .arg(QLatin1String("http://wiki.forum.nokia.com/index.php/Symbian_OS_Error_Codes"))); + reportError(tr("Installation failed: %1; " + "see %2 for descriptions of the error codes") + .arg(result.errorString(), + QLatin1String("http://wiki.forum.nokia.com/index.php/Symbian_OS_Error_Codes"))); } }