Improve translated messages in Android device dialog.

Reduce duplication, remove some HTML formatting.

Change-Id: Ia419a5c9a5bbeefca2863acd5d893f13acb34866
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Friedemann Kleint
2014-03-19 09:32:06 +01:00
parent bf593e3f04
commit 9c180ffded
2 changed files with 19 additions and 13 deletions

View File

@@ -370,6 +370,19 @@ QModelIndex AndroidDeviceModel::indexFor(const QString &serial)
/////////////////
// AndroidDeviceDialog
/////////////////
static inline QString msgConnect()
{
return AndroidDeviceDialog::tr("<p>Connect an Android device via USB and activate developer mode on it. "
"Some devices require the installation of a USB driver.</p>");
}
static inline QString msgAdbListDevices()
{
return AndroidDeviceDialog::tr("<p>The adb tool in the Android SDK lists all connected devices if run via &quot;adb devices&quot;.</p>");
}
AndroidDeviceDialog::AndroidDeviceDialog(int apiLevel, const QString &abi, QWidget *parent) :
QDialog(parent),
m_model(new AndroidDeviceModel(apiLevel, abi)),
@@ -387,14 +400,10 @@ AndroidDeviceDialog::AndroidDeviceDialog(int apiLevel, const QString &abi, QWidg
m_ui->defaultDeviceCheckBox->setText(tr("Always use this device for architecture %1").arg(abi));
m_ui->noDeviceFoundLabel->setText(tr("<p align=\"center\"><span style=\" font-size:16pt;\">"
"No Device Found</span></p>"
"<br/>"
"<p>Connect an Android device via USB and activate developer mode on it. "
"Some devices require the installation of a USB driver.</p>"
"<br/>"
"<p>The adb tool in the Android SDK lists all connected devices if run via &quot;adb devices&quot;.</p>"
));
m_ui->noDeviceFoundLabel->setText(QLatin1String("<p align=\"center\"><span style=\" font-size:16pt;\">")
+ tr("No Device Found") + QLatin1String("</span></p><br/>")
+ msgConnect() + QLatin1String("<br/>")
+ msgAdbListDevices());
connect(m_ui->missingLabel, SIGNAL(linkActivated(QString)),
this, SLOT(showHelp()));
@@ -489,8 +498,5 @@ void AndroidDeviceDialog::showHelp()
{
QPoint pos = m_ui->missingLabel->pos();
pos = m_ui->missingLabel->parentWidget()->mapToGlobal(pos);
QToolTip::showText(pos, tr("<p>Connect an Android device via USB and activate developer mode on it. "
"Some devices require the installation of a USB driver.</p>"
"<p>The adb tool in the Android SDK lists all connected devices if run via &quot;adb devices&quot;.</p>"),
this);
QToolTip::showText(pos, msgConnect() + msgAdbListDevices(), this);
}

View File

@@ -79,7 +79,7 @@
<item row="0" column="0">
<widget class="QLabel" name="noDeviceFoundLabel">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string notr="true">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>