mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
Add search logic to find android tools automagically, which we ship
* We search first in specified folders by the user (they can browse to the android SDK and java JDK). * If the tools we want aren't found there, we look relative to the UI as we now distribute the required tools with windows builds. * If we still don't find them, we prefer to look in PATH since the user has 'opted in' to any tools found in there. If the tool isn't in PATH either then we look relative to known environment variables.
This commit is contained in:
@@ -84,7 +84,8 @@ SettingsDialog::SettingsDialog(ICaptureContext &ctx, QWidget *parent)
|
||||
ui->externalDisassemblerArgs->setText(m_Ctx.Config().SPIRVDisassemblers[0].args);
|
||||
ui->externalDisassemblePath->setText(m_Ctx.Config().SPIRVDisassemblers[0].executable);
|
||||
}
|
||||
ui->Android_AdbExecutablePath->setText(m_Ctx.Config().Android_AdbExecutablePath);
|
||||
ui->Android_SDKPath->setText(m_Ctx.Config().Android_SDKPath);
|
||||
ui->Android_JDKPath->setText(m_Ctx.Config().Android_JDKPath);
|
||||
ui->Android_MaxConnectTimeout->setValue(m_Ctx.Config().Android_MaxConnectTimeout);
|
||||
ui->Android_AutoPushLayerToApp->setChecked(m_Ctx.Config().Android_AutoPushLayerToApp);
|
||||
|
||||
@@ -388,21 +389,52 @@ void SettingsDialog::on_browseTempCaptureDirectory_clicked()
|
||||
m_Ctx.Config().Save();
|
||||
}
|
||||
|
||||
void SettingsDialog::on_browseAdbPath_clicked()
|
||||
void SettingsDialog::on_browseAndroidSDKPath_clicked()
|
||||
{
|
||||
QString adb = RDDialog::getExecutableFileName(
|
||||
this, tr("Locate adb executable"),
|
||||
QFileInfo(m_Ctx.Config().Android_AdbExecutablePath).absoluteDir().path());
|
||||
QString adb = RDDialog::getExistingDirectory(
|
||||
this, tr("Locate SDK root folder (containing build-tools, platform-tools)"),
|
||||
QFileInfo(m_Ctx.Config().Android_SDKPath).absoluteDir().path());
|
||||
|
||||
if(!adb.isEmpty())
|
||||
{
|
||||
ui->Android_AdbExecutablePath->setText(adb);
|
||||
m_Ctx.Config().Android_AdbExecutablePath = adb;
|
||||
ui->Android_SDKPath->setText(adb);
|
||||
m_Ctx.Config().Android_SDKPath = adb;
|
||||
}
|
||||
|
||||
m_Ctx.Config().Save();
|
||||
}
|
||||
|
||||
void SettingsDialog::on_Android_SDKPath_textEdited(const QString &adb)
|
||||
{
|
||||
if(QFileInfo::exists(adb) || adb.isEmpty())
|
||||
m_Ctx.Config().Android_SDKPath = adb;
|
||||
|
||||
m_Ctx.Config().Save();
|
||||
}
|
||||
|
||||
void SettingsDialog::on_browseAndroidJDKPath_clicked()
|
||||
{
|
||||
QString adb =
|
||||
RDDialog::getExistingDirectory(this, tr("Locate JDK root folder (containing bin, jre, lib)"),
|
||||
QFileInfo(m_Ctx.Config().Android_JDKPath).absoluteDir().path());
|
||||
|
||||
if(!adb.isEmpty())
|
||||
{
|
||||
ui->Android_JDKPath->setText(adb);
|
||||
m_Ctx.Config().Android_JDKPath = adb;
|
||||
}
|
||||
|
||||
m_Ctx.Config().Save();
|
||||
}
|
||||
|
||||
void SettingsDialog::on_Android_JDKPath_textEdited(const QString &adb)
|
||||
{
|
||||
if(QFileInfo::exists(adb) || adb.isEmpty())
|
||||
m_Ctx.Config().Android_JDKPath = adb;
|
||||
|
||||
m_Ctx.Config().Save();
|
||||
}
|
||||
|
||||
void SettingsDialog::on_Android_MaxConnectTimeout_valueChanged(double timeout)
|
||||
{
|
||||
m_Ctx.Config().Android_MaxConnectTimeout = ui->Android_MaxConnectTimeout->value();
|
||||
@@ -410,14 +442,6 @@ void SettingsDialog::on_Android_MaxConnectTimeout_valueChanged(double timeout)
|
||||
m_Ctx.Config().Save();
|
||||
}
|
||||
|
||||
void SettingsDialog::on_Android_AdbExecutablePath_textEdited(const QString &adb)
|
||||
{
|
||||
if(QFileInfo::exists(adb) || adb.isEmpty())
|
||||
m_Ctx.Config().Android_AdbExecutablePath = adb;
|
||||
|
||||
m_Ctx.Config().Save();
|
||||
}
|
||||
|
||||
void SettingsDialog::on_Android_AutoPushLayerToApp_toggled(bool checked)
|
||||
{
|
||||
m_Ctx.Config().Android_AutoPushLayerToApp = ui->Android_AutoPushLayerToApp->isChecked();
|
||||
|
||||
Reference in New Issue
Block a user