From 9c180ffded29ed148c6107d4376fe61f086ad1a6 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 19 Mar 2014 09:32:06 +0100 Subject: [PATCH] Improve translated messages in Android device dialog. Reduce duplication, remove some HTML formatting. Change-Id: Ia419a5c9a5bbeefca2863acd5d893f13acb34866 Reviewed-by: Christian Stenger Reviewed-by: Daniel Teske --- src/plugins/android/androiddevicedialog.cpp | 30 ++++++++++++--------- src/plugins/android/androiddevicedialog.ui | 2 +- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/plugins/android/androiddevicedialog.cpp b/src/plugins/android/androiddevicedialog.cpp index ff6b422757e..fef86bf4093 100644 --- a/src/plugins/android/androiddevicedialog.cpp +++ b/src/plugins/android/androiddevicedialog.cpp @@ -370,6 +370,19 @@ QModelIndex AndroidDeviceModel::indexFor(const QString &serial) ///////////////// // AndroidDeviceDialog ///////////////// + +static inline QString msgConnect() +{ + return AndroidDeviceDialog::tr("

Connect an Android device via USB and activate developer mode on it. " + "Some devices require the installation of a USB driver.

"); + +} + +static inline QString msgAdbListDevices() +{ + return AndroidDeviceDialog::tr("

The adb tool in the Android SDK lists all connected devices if run via "adb devices".

"); +} + 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("

" - "No Device Found

" - "
" - "

Connect an Android device via USB and activate developer mode on it. " - "Some devices require the installation of a USB driver.

" - "
" - "

The adb tool in the Android SDK lists all connected devices if run via "adb devices".

" - )); + m_ui->noDeviceFoundLabel->setText(QLatin1String("

") + + tr("No Device Found") + QLatin1String("


") + + msgConnect() + QLatin1String("
") + + 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("

Connect an Android device via USB and activate developer mode on it. " - "Some devices require the installation of a USB driver.

" - "

The adb tool in the Android SDK lists all connected devices if run via "adb devices".

"), - this); + QToolTip::showText(pos, msgConnect() + msgAdbListDevices(), this); } diff --git a/src/plugins/android/androiddevicedialog.ui b/src/plugins/android/androiddevicedialog.ui index ef02aa43917..f480a9d54ee 100644 --- a/src/plugins/android/androiddevicedialog.ui +++ b/src/plugins/android/androiddevicedialog.ui @@ -79,7 +79,7 @@ - <html><head/><body><p><br/></p></body></html> + <html><head/><body><p><br/></p></body></html> Qt::RichText