firstlaunch_moc.cpp 18 KB

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