firstlaunch_moc.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  1. /*
  2. * firstlaunch_moc.cpp, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #include "StdInc.h"
  11. #include "firstlaunch_moc.h"
  12. #include "ui_firstlaunch_moc.h"
  13. #include "mainwindow_moc.h"
  14. #include "modManager/cmodlistview_moc.h"
  15. #include "../../lib/CConfigHandler.h"
  16. #include "../../lib/CGeneralTextHandler.h"
  17. #include "../../lib/Languages.h"
  18. #include "../../lib/VCMIDirs.h"
  19. #include "../../lib/filesystem/Filesystem.h"
  20. #include "../helper.h"
  21. #include "../languages.h"
  22. #ifdef ENABLE_INNOEXTRACT
  23. #include "cli/extract.hpp"
  24. #endif
  25. #ifdef VCMI_IOS
  26. #include "ios/selectdirectory.h"
  27. #elif defined(VCMI_ANDROID)
  28. #include <QAndroidJniObject>
  29. #include <QtAndroid>
  30. static FirstLaunchView * thiz;
  31. extern "C" JNIEXPORT void JNICALL Java_eu_vcmi_vcmi_NativeMethods_heroesDataUpdate(JNIEnv * env, jclass cls)
  32. {
  33. thiz->heroesDataUpdate();
  34. }
  35. #endif
  36. FirstLaunchView::FirstLaunchView(QWidget * parent)
  37. : QWidget(parent)
  38. , ui(new Ui::FirstLaunchView)
  39. {
  40. ui->setupUi(this);
  41. enterSetup();
  42. activateTabLanguage();
  43. ui->lineEditDataSystem->setText(pathToQString(boost::filesystem::absolute(VCMIDirs::get().dataPaths().front())));
  44. ui->lineEditDataUser->setText(pathToQString(boost::filesystem::absolute(VCMIDirs::get().userDataPath())));
  45. Helper::enableScrollBySwiping(ui->listWidgetLanguage);
  46. #ifdef VCMI_MOBILE
  47. // This directory is not accessible to players without rooting of their device
  48. ui->lineEditDataSystem->hide();
  49. #endif
  50. #ifndef ENABLE_INNOEXTRACT
  51. ui->pushButtonGogInstall->hide();
  52. ui->labelDataGogTitle->hide();
  53. ui->labelDataGogDescr->hide();
  54. #endif
  55. }
  56. void FirstLaunchView::on_buttonTabLanguage_clicked()
  57. {
  58. activateTabLanguage();
  59. }
  60. void FirstLaunchView::on_buttonTabHeroesData_clicked()
  61. {
  62. activateTabHeroesData();
  63. }
  64. void FirstLaunchView::on_buttonTabModPreset_clicked()
  65. {
  66. activateTabModPreset();
  67. }
  68. void FirstLaunchView::on_listWidgetLanguage_currentRowChanged(int currentRow)
  69. {
  70. languageSelected(ui->listWidgetLanguage->item(currentRow)->data(Qt::UserRole).toString());
  71. }
  72. void FirstLaunchView::changeEvent(QEvent * event)
  73. {
  74. if(event->type() == QEvent::LanguageChange)
  75. {
  76. ui->retranslateUi(this);
  77. Languages::fillLanguages(ui->listWidgetLanguage, false);
  78. }
  79. QWidget::changeEvent(event);
  80. }
  81. void FirstLaunchView::on_pushButtonLanguageNext_clicked()
  82. {
  83. activateTabHeroesData();
  84. }
  85. void FirstLaunchView::on_pushButtonDataNext_clicked()
  86. {
  87. activateTabModPreset();
  88. }
  89. void FirstLaunchView::on_pushButtonDataBack_clicked()
  90. {
  91. activateTabLanguage();
  92. }
  93. void FirstLaunchView::on_pushButtonDataSearch_clicked()
  94. {
  95. heroesDataUpdate();
  96. }
  97. void FirstLaunchView::on_pushButtonDataCopy_clicked()
  98. {
  99. #ifdef VCMI_ANDROID
  100. thiz = this;
  101. QtAndroid::androidActivity().callMethod<void>("copyHeroesData");
  102. #else
  103. // iOS can't display modal dialogs when called directly on button press
  104. // https://bugreports.qt.io/browse/QTBUG-98651
  105. QTimer::singleShot(0, this, [this]{ copyHeroesData(); });
  106. #endif
  107. }
  108. void FirstLaunchView::on_pushButtonGogInstall_clicked()
  109. {
  110. // iOS can't display modal dialogs when called directly on button press
  111. // https://bugreports.qt.io/browse/QTBUG-98651
  112. QTimer::singleShot(0, this, &FirstLaunchView::extractGogData);
  113. }
  114. void FirstLaunchView::enterSetup()
  115. {
  116. Languages::fillLanguages(ui->listWidgetLanguage, false);
  117. }
  118. void FirstLaunchView::setSetupProgress(int progress)
  119. {
  120. ui->buttonTabLanguage->setDisabled(progress < 1);
  121. ui->buttonTabHeroesData->setDisabled(progress < 2);
  122. ui->buttonTabModPreset->setDisabled(progress < 3);
  123. }
  124. void FirstLaunchView::activateTabLanguage()
  125. {
  126. setSetupProgress(1);
  127. ui->installerTabs->setCurrentIndex(0);
  128. ui->buttonTabLanguage->setChecked(true);
  129. ui->buttonTabHeroesData->setChecked(false);
  130. ui->buttonTabModPreset->setChecked(false);
  131. }
  132. void FirstLaunchView::activateTabHeroesData()
  133. {
  134. setSetupProgress(2);
  135. ui->installerTabs->setCurrentIndex(1);
  136. ui->buttonTabLanguage->setChecked(false);
  137. ui->buttonTabHeroesData->setChecked(true);
  138. ui->buttonTabModPreset->setChecked(false);
  139. if(heroesDataUpdate())
  140. {
  141. activateTabModPreset();
  142. return;
  143. }
  144. QString installPath = getHeroesInstallDir();
  145. if(!installPath.isEmpty())
  146. {
  147. auto reply = QMessageBox::question(this, tr("Heroes III installation found!"), tr("Copy data to VCMI folder?"), QMessageBox::Yes | QMessageBox::No);
  148. if(reply == QMessageBox::Yes)
  149. copyHeroesData(installPath);
  150. }
  151. }
  152. void FirstLaunchView::activateTabModPreset()
  153. {
  154. setSetupProgress(3);
  155. ui->installerTabs->setCurrentIndex(2);
  156. ui->buttonTabLanguage->setChecked(false);
  157. ui->buttonTabHeroesData->setChecked(false);
  158. ui->buttonTabModPreset->setChecked(true);
  159. modPresetUpdate();
  160. }
  161. void FirstLaunchView::exitSetup()
  162. {
  163. if(auto * mainWindow = dynamic_cast<MainWindow *>(QApplication::activeWindow()))
  164. mainWindow->exitSetup();
  165. }
  166. // Tab Language
  167. void FirstLaunchView::languageSelected(const QString & selectedLanguage)
  168. {
  169. Settings node = settings.write["general"]["language"];
  170. node->String() = selectedLanguage.toStdString();
  171. if(auto * mainWindow = dynamic_cast<MainWindow *>(QApplication::activeWindow()))
  172. mainWindow->updateTranslation();
  173. }
  174. bool FirstLaunchView::heroesDataUpdate()
  175. {
  176. bool detected = heroesDataDetect();
  177. if(detected)
  178. heroesDataDetected();
  179. else
  180. heroesDataMissing();
  181. return detected;
  182. }
  183. void FirstLaunchView::heroesDataMissing()
  184. {
  185. QPalette newPalette = palette();
  186. newPalette.setColor(QPalette::Base, QColor(200, 50, 50));
  187. ui->lineEditDataSystem->setPalette(newPalette);
  188. ui->lineEditDataUser->setPalette(newPalette);
  189. ui->labelDataManualTitle->setVisible(true);
  190. ui->labelDataManualDescr->setVisible(true);
  191. ui->pushButtonDataSearch->setVisible(true);
  192. #ifdef VCMI_ANDROID
  193. // selecting directory with ACTION_OPEN_DOCUMENT_TREE is available only since API level 21
  194. bool canUseDataCopy = QtAndroid::androidSdkVersion() >= 21;
  195. #else
  196. bool canUseDataCopy = true;
  197. #endif
  198. ui->labelDataCopyTitle->setVisible(canUseDataCopy);
  199. ui->labelDataCopyDescr->setVisible(canUseDataCopy);
  200. ui->pushButtonDataCopy->setVisible(canUseDataCopy);
  201. #ifdef ENABLE_INNOEXTRACT
  202. ui->pushButtonGogInstall->setVisible(true);
  203. ui->labelDataGogTitle->setVisible(true);
  204. ui->labelDataGogDescr->setVisible(true);
  205. #endif
  206. ui->labelDataFound->setVisible(false);
  207. ui->pushButtonDataNext->setEnabled(false);
  208. }
  209. void FirstLaunchView::heroesDataDetected()
  210. {
  211. QPalette newPalette = palette();
  212. newPalette.setColor(QPalette::Base, QColor(50, 200, 50));
  213. ui->lineEditDataSystem->setPalette(newPalette);
  214. ui->lineEditDataUser->setPalette(newPalette);
  215. ui->pushButtonDataSearch->setVisible(false);
  216. ui->pushButtonDataCopy->setVisible(false);
  217. ui->labelDataManualTitle->setVisible(false);
  218. ui->labelDataManualDescr->setVisible(false);
  219. ui->labelDataCopyTitle->setVisible(false);
  220. ui->labelDataCopyDescr->setVisible(false);
  221. #ifdef ENABLE_INNOEXTRACT
  222. ui->pushButtonGogInstall->setVisible(false);
  223. ui->labelDataGogTitle->setVisible(false);
  224. ui->labelDataGogDescr->setVisible(false);
  225. #endif
  226. ui->labelDataFound->setVisible(true);
  227. ui->pushButtonDataNext->setEnabled(true);
  228. CGeneralTextHandler::detectInstallParameters();
  229. }
  230. // Tab Heroes III Data
  231. bool FirstLaunchView::heroesDataDetect()
  232. {
  233. // user might have copied files to one of our data path.
  234. // perform full reinitialization of virtual filesystem
  235. CResourceHandler::destroy();
  236. CResourceHandler::initialize();
  237. CResourceHandler::load("config/filesystem.json");
  238. // use file from lod archive to check presence of H3 data. Very rough estimate, but will work in majority of cases
  239. bool heroesDataFoundROE = CResourceHandler::get()->existsResource(ResourcePath("DATA/GENRLTXT.TXT"));
  240. bool heroesDataFoundSOD = CResourceHandler::get()->existsResource(ResourcePath("DATA/TENTCOLR.TXT"));
  241. return heroesDataFoundROE && heroesDataFoundSOD;
  242. }
  243. QString FirstLaunchView::getHeroesInstallDir()
  244. {
  245. #ifdef VCMI_WINDOWS
  246. QString gogPath = QSettings("HKEY_LOCAL_MACHINE\\SOFTWARE\\GOG.com\\Games\\1207658787", QSettings::NativeFormat).value("path").toString();
  247. if(!gogPath.isEmpty())
  248. return gogPath;
  249. QString cdPath = QSettings("HKEY_LOCAL_MACHINE\\SOFTWARE\\New World Computing\\Heroes of Might and Magic® III\\1.0", QSettings::NativeFormat).value("AppPath").toString();
  250. if(!cdPath.isEmpty())
  251. return cdPath;
  252. #endif
  253. return QString{};
  254. }
  255. void FirstLaunchView::extractGogData()
  256. {
  257. #ifdef ENABLE_INNOEXTRACT
  258. auto fileSelection = [this](QString type, QString filter, QString startPath = {}) {
  259. QString titleSel = tr("Select %1 file...", "param is file extension").arg(filter);
  260. QString titleErr = tr("You have to select %1 file!", "param is file extension").arg(filter);
  261. #if defined(VCMI_MOBILE)
  262. filter = tr("GOG file (*.*)");
  263. QMessageBox::information(this, tr("File selection"), titleSel);
  264. #endif
  265. QString file = QFileDialog::getOpenFileName(this, titleSel, startPath.isEmpty() ? QDir::homePath() : startPath, filter);
  266. if(file.isEmpty())
  267. return QString{};
  268. else if(!file.endsWith("." + type, Qt::CaseInsensitive))
  269. {
  270. QMessageBox::critical(this, tr("Invalid file selected"), titleErr);
  271. return QString{};
  272. }
  273. return file;
  274. };
  275. QString fileExe = fileSelection("exe", tr("GOG installer") + " (*.exe)");
  276. if(fileExe.isEmpty())
  277. return;
  278. QString fileBin = fileSelection("bin", tr("GOG data") + " (*.bin)", QFileInfo(fileExe).absolutePath());
  279. if(fileBin.isEmpty())
  280. return;
  281. ui->progressBarGog->setVisible(true);
  282. ui->pushButtonGogInstall->setVisible(false);
  283. setEnabled(false);
  284. QTimer::singleShot(100, this, [this, fileExe, fileBin](){ // background to make sure FileDialog is closed...
  285. QDir tempDir(pathToQString(VCMIDirs::get().userDataPath()));
  286. tempDir.mkdir("tmp");
  287. if(!tempDir.cd("tmp"))
  288. return; // should not happen - but avoid deleting wrong folder in any case
  289. QString tmpFileExe = tempDir.filePath("h3_gog.exe");
  290. QFile(fileExe).copy(tmpFileExe);
  291. QFile(fileBin).copy(tempDir.filePath("h3_gog-1.bin"));
  292. ::extract_options o;
  293. o.extract = true;
  294. // standard settings
  295. o.gog_galaxy = true;
  296. o.codepage = 0U;
  297. o.output_dir = tempDir.path().toStdString();
  298. o.extract_temp = true;
  299. o.extract_unknown = true;
  300. o.filenames.set_expand(true);
  301. o.preserve_file_times = true; // also correctly closes file -> without it: on Windows the files are not written completly
  302. process_file(tmpFileExe.toStdString(), o, [this](float progress) {
  303. ui->progressBarGog->setValue(progress * 100);
  304. qApp->processEvents();
  305. });
  306. ui->progressBarGog->setVisible(false);
  307. ui->pushButtonGogInstall->setVisible(true);
  308. setEnabled(true);
  309. QStringList dirData = tempDir.entryList({"data"}, QDir::Filter::Dirs);
  310. if(dirData.empty() || QDir(tempDir.filePath(dirData.front())).entryList({"*.lod"}, QDir::Filter::Files).empty())
  311. {
  312. QMessageBox::critical(this, tr("No Heroes III data!"), tr("Selected files do not contain Heroes III data!"), QMessageBox::Ok, QMessageBox::Ok);
  313. tempDir.removeRecursively();
  314. return;
  315. }
  316. copyHeroesData(tempDir.path(), true);
  317. tempDir.removeRecursively();
  318. });
  319. #endif
  320. }
  321. void FirstLaunchView::copyHeroesData(const QString & path, bool move)
  322. {
  323. QDir sourceRoot{path};
  324. #ifdef VCMI_IOS
  325. // TODO: Qt 6.5 can select directories https://codereview.qt-project.org/c/qt/qtbase/+/446449
  326. SelectDirectory iosDirectorySelector;
  327. if(path.isEmpty())
  328. sourceRoot.setPath(iosDirectorySelector.getExistingDirectory());
  329. #else
  330. if(path.isEmpty())
  331. sourceRoot.setPath(QFileDialog::getExistingDirectory(this, {}, {}, QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks));
  332. #endif
  333. if(!sourceRoot.exists())
  334. return;
  335. if (sourceRoot.dirName().compare("data", Qt::CaseInsensitive) == 0)
  336. {
  337. // We got Data folder. Possibly user selected "Data" folder of Heroes III install. Check whether valid data might exist 1 level above
  338. QStringList dirData = sourceRoot.entryList({"data"}, QDir::Filter::Dirs);
  339. if (dirData.empty())
  340. {
  341. // This is "Data" folder without any "Data" folders inside. Try to check for data 1 level above
  342. sourceRoot.cdUp();
  343. }
  344. }
  345. QStringList dirData = sourceRoot.entryList({"data"}, QDir::Filter::Dirs);
  346. QStringList dirMaps = sourceRoot.entryList({"maps"}, QDir::Filter::Dirs);
  347. QStringList dirMp3 = sourceRoot.entryList({"mp3"}, QDir::Filter::Dirs);
  348. const auto noDataMessage = tr("Failed to detect valid Heroes III data in chosen directory.\nPlease select directory with installed Heroes III data.");
  349. if(dirData.empty())
  350. {
  351. QMessageBox::critical(this, tr("Heroes III data not found!"), noDataMessage);
  352. return;
  353. }
  354. QDir sourceData = sourceRoot.filePath(dirData.front());
  355. QStringList roeFiles = sourceData.entryList({"*.lod"}, QDir::Filter::Files);
  356. QStringList sodFiles = sourceData.entryList({"H3ab*.lod"}, QDir::Filter::Files);
  357. QStringList hdFiles = sourceData.entryList({"*.pak"}, QDir::Filter::Files);
  358. if(sodFiles.empty())
  359. {
  360. if (roeFiles.empty())
  361. {
  362. // Directory structure is correct (Data/Maps/Mp3) but no .lod archives that should be present in any install
  363. QMessageBox::critical(this, tr("Heroes III data not found!"), noDataMessage);
  364. return;
  365. }
  366. if (!hdFiles.empty())
  367. {
  368. // HD Edition contains only RoE data so we can't use even unmodified files from it
  369. QMessageBox::critical(this, tr("Heroes III data not found!"), tr("Heroes III: HD Edition files are not supported by VCMI.\nPlease select directory with Heroes III: Complete Edition or Heroes III: Shadow of Death."));
  370. return;
  371. }
  372. // RoE or some other unsupported edition. Demo version?
  373. QMessageBox::critical(this, tr("Heroes III data not found!"), tr("Unknown or unsupported Heroes III version found.\nPlease select directory with Heroes III: Complete Edition or Heroes III: Shadow of Death."));
  374. return;
  375. }
  376. QStringList copyDirectories;
  377. copyDirectories += dirData.front();
  378. if (!dirMaps.empty())
  379. copyDirectories += dirMaps.front();
  380. if (!dirMp3.empty())
  381. copyDirectories += dirMp3.front();
  382. QDir targetRoot = pathToQString(VCMIDirs::get().userDataPath());
  383. for(const QString & dirName : copyDirectories)
  384. {
  385. QDir sourceDir = sourceRoot.filePath(dirName);
  386. QDir targetDir = targetRoot.filePath(dirName);
  387. if(!targetRoot.exists(dirName))
  388. targetRoot.mkdir(dirName);
  389. for(const QString & filename : sourceDir.entryList(QDir::Filter::Files))
  390. {
  391. QFile sourceFile(sourceDir.filePath(filename));
  392. if(move)
  393. sourceFile.rename(targetDir.filePath(filename));
  394. else
  395. sourceFile.copy(targetDir.filePath(filename));
  396. }
  397. }
  398. heroesDataUpdate();
  399. }
  400. // Tab Mod Preset
  401. void FirstLaunchView::modPresetUpdate()
  402. {
  403. bool translationExists = !findTranslationModName().isEmpty();
  404. ui->labelPresetLanguageDescr->setVisible(translationExists);
  405. ui->buttonPresetLanguage->setVisible(translationExists);
  406. ui->buttonPresetLanguage->setVisible(checkCanInstallTranslation());
  407. ui->buttonPresetExtras->setVisible(checkCanInstallExtras());
  408. ui->buttonPresetHota->setVisible(checkCanInstallHota());
  409. ui->buttonPresetWog->setVisible(checkCanInstallWog());
  410. ui->labelPresetLanguageDescr->setVisible(checkCanInstallTranslation());
  411. ui->labelPresetExtrasDescr->setVisible(checkCanInstallExtras());
  412. ui->labelPresetHotaDescr->setVisible(checkCanInstallHota());
  413. ui->labelPresetWogDescr->setVisible(checkCanInstallWog());
  414. // we can't install anything - either repository checkout is off or all recommended mods are already installed
  415. if (!checkCanInstallTranslation() && !checkCanInstallExtras() && !checkCanInstallHota() && !checkCanInstallWog())
  416. exitSetup();
  417. }
  418. QString FirstLaunchView::findTranslationModName()
  419. {
  420. if (!getModView())
  421. return QString();
  422. QString preferredlanguage = QString::fromStdString(settings["general"]["language"].String());
  423. QString installedlanguage = QString::fromStdString(settings["session"]["language"].String());
  424. if (preferredlanguage == installedlanguage)
  425. return QString();
  426. return getModView()->getTranslationModName(preferredlanguage);
  427. }
  428. bool FirstLaunchView::checkCanInstallTranslation()
  429. {
  430. QString modName = findTranslationModName();
  431. if(modName.isEmpty())
  432. return false;
  433. return checkCanInstallMod(modName);
  434. }
  435. bool FirstLaunchView::checkCanInstallWog()
  436. {
  437. return checkCanInstallMod("wake-of-gods");
  438. }
  439. bool FirstLaunchView::checkCanInstallHota()
  440. {
  441. return checkCanInstallMod("hota");
  442. }
  443. bool FirstLaunchView::checkCanInstallExtras()
  444. {
  445. return checkCanInstallMod("vcmi-extras");
  446. }
  447. CModListView * FirstLaunchView::getModView()
  448. {
  449. auto * mainWindow = dynamic_cast<MainWindow *>(QApplication::activeWindow());
  450. assert(mainWindow);
  451. if (!mainWindow)
  452. return nullptr;
  453. return mainWindow->getModView();
  454. }
  455. bool FirstLaunchView::checkCanInstallMod(const QString & modID)
  456. {
  457. return getModView() && getModView()->isModAvailable(modID);
  458. }
  459. void FirstLaunchView::on_pushButtonPresetBack_clicked()
  460. {
  461. activateTabHeroesData();
  462. }
  463. void FirstLaunchView::on_pushButtonPresetNext_clicked()
  464. {
  465. QStringList modsToInstall;
  466. if (ui->buttonPresetLanguage->isChecked() && checkCanInstallTranslation())
  467. modsToInstall.push_back(findTranslationModName());
  468. if (ui->buttonPresetExtras->isChecked() && checkCanInstallExtras())
  469. modsToInstall.push_back("vcmi-extras");
  470. if (ui->buttonPresetWog->isChecked() && checkCanInstallWog())
  471. modsToInstall.push_back("wake-of-gods");
  472. if (ui->buttonPresetHota->isChecked() && checkCanInstallHota())
  473. modsToInstall.push_back("hota");
  474. exitSetup();
  475. for (auto const & modName : modsToInstall)
  476. getModView()->doInstallMod(modName);
  477. }
  478. void FirstLaunchView::on_pushButtonDiscord_clicked()
  479. {
  480. QDesktopServices::openUrl(QUrl("https://discord.gg/chBT42V"));
  481. }
  482. void FirstLaunchView::on_pushButtonSlack_clicked()
  483. {
  484. QDesktopServices::openUrl(QUrl("https://slack.vcmi.eu/"));
  485. }
  486. void FirstLaunchView::on_pushButtonGithub_clicked()
  487. {
  488. QDesktopServices::openUrl(QUrl("https://github.com/vcmi/vcmi"));
  489. }