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