forked from qt-creator/qt-creator
Android: handle more potential fails for when cloning
Fixes: QTCREATORBUG-24200 Change-Id: I3f54f0610a70654c3711e7dc3bfd5f22863b2cd2 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
committed by
Alessandro Portale
parent
cb5b0cffb3
commit
998c07dcbe
@@ -809,22 +809,42 @@ void AndroidSettingsWidget::downloadOpenSslRepo(const bool silent)
|
||||
|
||||
connect(openSslProgressDialog, &QProgressDialog::canceled, gitCloner, &QtcProcess::kill);
|
||||
|
||||
gitCloner->start();
|
||||
openSslProgressDialog->show();
|
||||
auto failDialog = [=](const QString &msgSuffix = {}) {
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(tr("OpenSSL prebuilt libraries cloning failed. ") + msgSuffix
|
||||
+ tr("Opening OpenSSL URL for manual download."));
|
||||
msgBox.addButton(tr("OK"), QMessageBox::YesRole);
|
||||
QAbstractButton *openButton = msgBox.addButton(tr("Open download URL"), QMessageBox::ActionRole);
|
||||
msgBox.exec();
|
||||
|
||||
connect(gitCloner, QOverload<int, QtcProcess::ExitStatus>::of(&QtcProcess::finished),
|
||||
if (msgBox.clickedButton() == openButton)
|
||||
QDesktopServices::openUrl(QUrl::fromUserInput(openSslRepo));
|
||||
openButton->deleteLater();
|
||||
};
|
||||
|
||||
connect(gitCloner,
|
||||
QOverload<int, QtcProcess::ExitStatus>::of(&QtcProcess::finished),
|
||||
[=](int exitCode, QProcess::ExitStatus exitStatus) {
|
||||
openSslProgressDialog->close();
|
||||
validateOpenSsl();
|
||||
|
||||
if (!openSslProgressDialog->wasCanceled() ||
|
||||
(exitStatus == QtcProcess::NormalExit && exitCode != 0)) {
|
||||
QMessageBox::information(this, openSslCloneTitle,
|
||||
tr("OpenSSL prebuilt libraries cloning failed. "
|
||||
"Opening OpenSSL URL for manual download."));
|
||||
QDesktopServices::openUrl(QUrl::fromUserInput(openSslRepo));
|
||||
if (!openSslProgressDialog->wasCanceled()
|
||||
|| (exitStatus == QtcProcess::NormalExit && exitCode != 0)) {
|
||||
failDialog();
|
||||
}
|
||||
});
|
||||
|
||||
connect(gitCloner, &QtcProcess::errorOccurred, this, [=](QProcess::ProcessError error) {
|
||||
openSslProgressDialog->close();
|
||||
if (error == QProcess::FailedToStart) {
|
||||
failDialog(tr("The git tool might not be installed properly on your system. "));
|
||||
} else {
|
||||
failDialog();
|
||||
}
|
||||
});
|
||||
|
||||
openSslProgressDialog->show();
|
||||
gitCloner->start();
|
||||
}
|
||||
|
||||
void AndroidSettingsWidget::addAVD()
|
||||
|
Reference in New Issue
Block a user