Android Settings: Download buttons for Android Toolkit parts

Show little toolButtons next to the path input fields for SDK,
NDK, Ant and OpenJDK. The latter two only for Windows. These
buttons open the system Web browser with the according download
page.

We hope this saves the user a bit of time understanding what to
download where when setting up an Android development environ-
ment.

The download icon was drawn by me.

Change-Id: I0079059deca8d0f07d53b914900cb34b8f0489e0
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Alessandro Portale
2014-02-18 20:20:32 +01:00
parent a85f64a7c6
commit 8606345a66
5 changed files with 109 additions and 18 deletions

View File

@@ -47,9 +47,11 @@
#include <QTextStream>
#include <QProcess>
#include <QDesktopServices>
#include <QFileDialog>
#include <QMessageBox>
#include <QModelIndex>
#include <QtCore/QUrl>
namespace Android {
namespace Internal {
@@ -131,6 +133,8 @@ AndroidSettingsWidget::AndroidSettingsWidget(QWidget *parent)
m_ui->AVDTableView->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
m_ui->AVDTableView->horizontalHeader()->setResizeMode(1, QHeaderView::ResizeToContents);
m_ui->downloadAntToolButton->setVisible(Utils::HostOsInfo::isWindowsHost());
m_ui->downloadOpenJDKToolButton->setVisible(Utils::HostOsInfo::isWindowsHost());
check(All);
applyToUi(All);
@@ -421,6 +425,26 @@ void AndroidSettingsWidget::browseOpenJDKLocation()
openJDKLocationEditingFinished();
}
void AndroidSettingsWidget::openSDKDownloadUrl()
{
QDesktopServices::openUrl(QUrl::fromUserInput(QLatin1String("http://developer.android.com/sdk")));
}
void AndroidSettingsWidget::openNDKDownloadUrl()
{
QDesktopServices::openUrl(QUrl::fromUserInput(QLatin1String("http://developer.android.com/tools/sdk/ndk/index.html#Downloads")));
}
void AndroidSettingsWidget::openAntDownloadUrl()
{
QDesktopServices::openUrl(QUrl::fromUserInput(QLatin1String("http://ant.apache.org/bindownload.cgi")));
}
void AndroidSettingsWidget::openOpenJDKDownloadUrl()
{
QDesktopServices::openUrl(QUrl::fromUserInput(QLatin1String("http://www.oracle.com/technetwork/java/javase/downloads")));
}
void AndroidSettingsWidget::addAVD()
{
m_androidConfig.createAVD(this);