浏览代码

Merge pull request #4115 from kambala-decapitator/ios-launcher-fix-dialogs

[launcher] call button handlers that show dialogs asynchronously
Ivan Savenko 1 年之前
父节点
当前提交
e39bde362a
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      launcher/firstLaunch/firstlaunch_moc.cpp

+ 6 - 3
launcher/firstLaunch/firstlaunch_moc.cpp

@@ -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);