diff --git a/src/plugins/android/androiddevicedialog.cpp b/src/plugins/android/androiddevicedialog.cpp index ff243188f6d..ff6b422757e 100644 --- a/src/plugins/android/androiddevicedialog.cpp +++ b/src/plugins/android/androiddevicedialog.cpp @@ -33,6 +33,7 @@ #include #include +#include using namespace Android; using namespace Android::Internal; @@ -386,6 +387,17 @@ 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".

" + )); + connect(m_ui->missingLabel, SIGNAL(linkActivated(QString)), + this, SLOT(showHelp())); + connect(m_ui->refreshDevicesButton, SIGNAL(clicked()), this, SLOT(refreshDeviceList())); @@ -445,6 +457,8 @@ void AndroidDeviceDialog::refreshDeviceList() newIndex = m_model->indexFor(devices.first().serialNumber); m_ui->deviceView->setCurrentIndex(newIndex); + + m_ui->stackedWidget->setCurrentIndex(devices.isEmpty() ? 1 : 0); } void AndroidDeviceDialog::createAvd() @@ -470,3 +484,13 @@ void AndroidDeviceDialog::clickedOnView(const QModelIndex &idx) } } } + +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); +} diff --git a/src/plugins/android/androiddevicedialog.h b/src/plugins/android/androiddevicedialog.h index 0c5c5ed9646..6cb4202ab7e 100644 --- a/src/plugins/android/androiddevicedialog.h +++ b/src/plugins/android/androiddevicedialog.h @@ -62,6 +62,7 @@ private slots: void refreshDeviceList(); void createAvd(); void clickedOnView(const QModelIndex &idx); + void showHelp(); private: AndroidDeviceModel *m_model; Ui::AndroidDeviceDialog *m_ui; diff --git a/src/plugins/android/androiddevicedialog.ui b/src/plugins/android/androiddevicedialog.ui index c64465e143f..ef02aa43917 100644 --- a/src/plugins/android/androiddevicedialog.ui +++ b/src/plugins/android/androiddevicedialog.ui @@ -6,36 +6,29 @@ 0 0 - 618 - 400 + 636 + 438 Select Android Device - - - - Refresh Device List - - - - - - - Create Android Virtual Device - - - - + Always use this device for architecture %1 - + + + + Create Android Virtual Device + + + + Qt::Horizontal @@ -45,16 +38,64 @@ - - - - - 600 - 300 - + + + + Refresh Device List + + + + 0 + + + + + + + + 600 + 300 + + + + + + + + <html><head/><body><p><a href="aaa"><span style=" text-decoration: underline; color:#0057ae;">My device is missing</span></a></p></body></html> + + + Qt::RichText + + + + + + + + + + + <html><head/><body><p><br/></p></body></html> + + + Qt::RichText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + + + + +