Android: Require manual close after installation is complete

When there were some issues during installation, marked with
red lines, it could happen that the user haven't got a chance to
read them, as the dialog was automatically closed after
the installation was done.

To fix it, hide Cancel button on installation finish, show
Close button instead and prolong the visibility of the dialog until
the Close button is pressed.

Task-number: QTCREATORBUG-31812
Change-Id: I63287150b293d3ea1a696a7925bfaa1983e00ae0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
Jarek Kobus
2024-10-14 15:04:53 +02:00
parent 53ffb8f76d
commit b1f1d563b1

View File

@@ -8,6 +8,7 @@
#include <coreplugin/icore.h>
#include <solutions/tasking/conditional.h>
#include <solutions/tasking/tasktreerunner.h>
#include <utils/algorithm.h>
@@ -77,6 +78,7 @@ public:
emit answerClicked(true);
});
connect(m_dialogButtonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
connect(m_dialogButtonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
// GUI tuning
setModal(true);
@@ -100,6 +102,10 @@ public:
m_outputTextEdit->ensureCursorVisible();
}
void setProgress(int value) { m_progressBar->setValue(value); }
void setDone()
{
m_dialogButtonBox->setStandardButtons(QDialogButtonBox::Close);
}
signals:
void answerClicked(bool accepted);
@@ -546,12 +552,20 @@ void AndroidSdkManagerPrivate::runDialogRecipe(const Storage<DialogStorage> &dia
const auto onCancelSetup = [dialogStorage] {
return std::make_pair(dialogStorage->m_dialog.get(), &QDialog::rejected);
};
const auto onAcceptSetup = [dialogStorage] {
return std::make_pair(dialogStorage->m_dialog.get(), &QDialog::accepted);
};
const auto onError = [dialogStorage] { dialogStorage->m_dialog->setDone(); };
const Group root {
dialogStorage,
Group {
If (!Group {
licensesRecipe,
Sync([dialogStorage] { dialogStorage->m_dialog->setQuestionVisible(false); }),
continuationRecipe
}) >> Then {
Sync(onError).withAccept(onAcceptSetup)
}
}.withCancel(onCancelSetup)
};
m_taskTreeRunner.start(root, {}, [this](DoneWith) {