Commit cfc42829 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

L10n: tr()-fixes.

Use standard checkable message box in analyzer.
parent ed23c77c
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
#include <utils/fancymainwindow.h> #include <utils/fancymainwindow.h>
#include <utils/styledbar.h> #include <utils/styledbar.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/checkablemessagebox.h>
#include <cmakeprojectmanager/cmakeprojectconstants.h> #include <cmakeprojectmanager/cmakeprojectconstants.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h> #include <qt4projectmanager/qt4projectmanagerconstants.h>
...@@ -90,6 +91,7 @@ ...@@ -90,6 +91,7 @@
#include <QtGui/QLabel> #include <QtGui/QLabel>
#include <QtGui/QCheckBox> #include <QtGui/QCheckBox>
#include <QtGui/QDialogButtonBox> #include <QtGui/QDialogButtonBox>
#include <QtGui/QMainWindow>
using namespace Core; using namespace Core;
using namespace Analyzer; using namespace Analyzer;
...@@ -464,38 +466,25 @@ void AnalyzerManager::AnalyzerManagerPrivate::startTool() ...@@ -464,38 +466,25 @@ void AnalyzerManager::AnalyzerManagerPrivate::startTool()
const QString currentMode = buildType == ProjectExplorer::BuildConfiguration::Debug ? tr("Debug") : tr("Release"); const QString currentMode = buildType == ProjectExplorer::BuildConfiguration::Debug ? tr("Debug") : tr("Release");
QSettings *settings = Core::ICore::instance()->settings(); 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; int ret;
if (settings->contains(configKey)) { if (settings->contains(configKey)) {
ret = settings->value(configKey, QDialog::Accepted).toInt(); ret = settings->value(configKey, QDialog::Accepted).toInt();
} else { } else {
QDialog dialog; const QString title = tr("Run %1 in %2 Mode?").arg(toolName).arg(currentMode);
dialog.setWindowTitle(tr("Run %1 in %2 mode?").arg(toolName).arg(currentMode)); const QString message = tr("<html><head/><body><p>You are trying to run the tool '%1' on an application in %2 mode. "
QGridLayout *layout = new QGridLayout; "The tool is designed to be used in %3 mode.</p><p>"
QLabel *iconLabel = new QLabel; "Do you want to continue and run it in %2 mode?</p></body></html>").
iconLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); arg(toolName).arg(currentMode).arg(toolMode);
QIcon icon = dialog.style()->standardIcon(QStyle::SP_MessageBoxInformation); const QString checkBoxText = tr("&Do not ask again");
dialog.setWindowIcon(icon); bool checkBoxSetting = false;
iconLabel->setPixmap(icon.pixmap(QSize(icon.actualSize(QSize(64, 64))))); const QDialogButtonBox::StandardButton button =
layout->addWidget(iconLabel, 0, 0); Utils::CheckableMessageBox::question(Core::ICore::instance()->mainWindow(), title, message, checkBoxText,
QLabel *textLabel = new QLabel; &checkBoxSetting, QDialogButtonBox::Yes|QDialogButtonBox::Cancel,
textLabel->setWordWrap(true); QDialogButtonBox::Cancel);
textLabel->setText(tr("You are trying to run %1 on an application in %2 mode. " ret = button == QDialogButtonBox::Yes ? QDialog::Accepted : QDialog::Rejected;
"%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)); if (checkBoxSetting && ret == QDialog::Accepted)
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)
settings->setValue(configKey, ret); settings->setValue(configKey, ret);
} }
if (ret == QDialog::Rejected) if (ret == QDialog::Rejected)
......
...@@ -570,10 +570,10 @@ void S60DeployStep::handleSymbianInstall(const Coda::CodaCommandResult &result) ...@@ -570,10 +570,10 @@ void S60DeployStep::handleSymbianInstall(const Coda::CodaCommandResult &result)
else else
initFileInstallation(); initFileInstallation();
} else { } else {
reportError(tr("Installation failed: %1, " reportError(tr("Installation failed: %1; "
"Explanation of error codes is available at: %2") "see %2 for descriptions of the error codes")
.arg(result.errorString()) .arg(result.errorString(),
.arg(QLatin1String("http://wiki.forum.nokia.com/index.php/Symbian_OS_Error_Codes"))); QLatin1String("http://wiki.forum.nokia.com/index.php/Symbian_OS_Error_Codes")));
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment