1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

[launcher] call button handlers that show dialogs asynchronously

fixes freeze on iOS: https://bugreports.qt.io/browse/QTBUG-98651
This commit is contained in:
Andrey Filipenkov 2024-06-08 22:30:54 +03:00
parent a33a37b1a4
commit 65d30a444e

View File

@ -112,13 +112,17 @@ void FirstLaunchView::on_pushButtonDataCopy_clicked()
thiz = this;
QtAndroid::androidActivity().callMethod<void>("copyHeroesData");
#else
copyHeroesData();
// iOS can't display modal dialogs when called directly on button press
// https://bugreports.qt.io/browse/QTBUG-98651
QTimer::singleShot(0, this, [this]{ copyHeroesData(); });
#endif
}
void FirstLaunchView::on_pushButtonGogInstall_clicked()
{
extractGogData();
// iOS can't display modal dialogs when called directly on button press
// https://bugreports.qt.io/browse/QTBUG-98651
QTimer::singleShot(0, this, &FirstLaunchView::extractGogData);
}
void FirstLaunchView::on_comboBoxLanguage_currentIndexChanged(int index)
@ -314,7 +318,6 @@ QString FirstLaunchView::getHeroesInstallDir()
void FirstLaunchView::extractGogData()
{
#ifdef ENABLE_INNOEXTRACT
auto fileSelection = [this](QString type, QString filter, QString startPath = {}) {
QString titleSel = tr("Select %1 file...", "param is file extension").arg(filter);
QString titleErr = tr("You have to select %1 file!", "param is file extension").arg(filter);