diff options
author | Jarek Kobus <[email protected]> | 2024-10-14 15:04:53 +0200 |
---|---|---|
committer | Jarek Kobus <[email protected]> | 2024-10-24 12:41:18 +0000 |
commit | b1f1d563b1c1f9ca51aecc06c6c9f373ee85192f (patch) | |
tree | dafc5ff013cdf077be72e8c1508a4ae166ae7f9a /src/plugins/android/androidsdkmanager.cpp | |
parent | 53ffb8f76dd9e4a2241f726fd251cb02b9fd8da6 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/plugins/android/androidsdkmanager.cpp')
-rw-r--r-- | src/plugins/android/androidsdkmanager.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/plugins/android/androidsdkmanager.cpp b/src/plugins/android/androidsdkmanager.cpp index 1cba998f1aa..ebf28506c17 100644 --- a/src/plugins/android/androidsdkmanager.cpp +++ b/src/plugins/android/androidsdkmanager.cpp @@ -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 { - licensesRecipe, - Sync([dialogStorage] { dialogStorage->m_dialog->setQuestionVisible(false); }), - continuationRecipe + If (!Group { + licensesRecipe, + Sync([dialogStorage] { dialogStorage->m_dialog->setQuestionVisible(false); }), + continuationRecipe + }) >> Then { + Sync(onError).withAccept(onAcceptSetup) + } }.withCancel(onCancelSetup) }; m_taskTreeRunner.start(root, {}, [this](DoneWith) { |