mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-25 21:38:59 +02:00
avoid to select incorrect files on mobile platforms
This commit is contained in:
parent
c148f929ae
commit
3952b661a0
@ -305,6 +305,11 @@ void FirstLaunchView::extractGogData()
|
||||
QString fileExe = QFileDialog::getOpenFileName(this, tr("Select a GOG installer (exe) file..."), QDir::homePath(), filterExe);
|
||||
if(fileExe.isEmpty())
|
||||
return;
|
||||
if(!fileExe.endsWith(".exe", Qt::CaseInsensitive)
|
||||
{
|
||||
QMessageBox::critical(this, tr("Invalid file selected"), tr("You have to select a GOG installer (exe) file!"));
|
||||
return;
|
||||
}
|
||||
|
||||
#if defined(VCMI_MOBILE)
|
||||
QString filterBin = tr("GOG bin file") + " (*.*)";
|
||||
@ -315,6 +320,11 @@ void FirstLaunchView::extractGogData()
|
||||
QString fileBin = QFileDialog::getOpenFileName(this, tr("Select a GOG data (bin) file..."), QFileInfo(fileExe).absolutePath(), filterBin);
|
||||
if(fileBin.isEmpty())
|
||||
return;
|
||||
if(!fileBin.endsWith(".bin", Qt::CaseInsensitive)
|
||||
{
|
||||
QMessageBox::critical(this, tr("Invalid file selected"), tr("You have to select a GOG data (bin) file!"));
|
||||
return;
|
||||
}
|
||||
|
||||
ui->pushButtonGogInstall->setText(tr("Installing... Please wait!"));
|
||||
QPalette pal = ui->pushButtonGogInstall->palette();
|
||||
|
Loading…
x
Reference in New Issue
Block a user