1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-23 21:29:13 +02:00

seperate button update from extraction process

This commit is contained in:
Laserlicht 2024-04-27 22:54:32 +02:00 committed by GitHub
parent 90fa1718a5
commit e52dbf028c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -306,19 +306,19 @@ void FirstLaunchView::extractGogData()
if(fileBin.isEmpty())
return;
ui->pushButtonGogInstall->setText(tr("Installing... Please wait!"));
QPalette pal = ui->pushButtonGogInstall->palette();
pal.setColor(QPalette::Button, QColor(Qt::yellow));
ui->pushButtonGogInstall->setAutoFillBackground(true);
ui->pushButtonGogInstall->setPalette(pal);
ui->pushButtonGogInstall->update();
ui->pushButtonGogInstall->repaint();
QTimer::singleShot(100, this, [this, fileExe, fileBin](){ // background to make sure FileDialog is closed...
QTemporaryDir dir;
if(dir.isValid()) {
QDir tempDir{dir.path()};
ui->pushButtonGogInstall->setText(tr("Installing... Please wait!"));
QPalette pal = ui->pushButtonGogInstall->palette();
pal.setColor(QPalette::Button, QColor(Qt::yellow));
ui->pushButtonGogInstall->setAutoFillBackground(true);
ui->pushButtonGogInstall->setPalette(pal);
ui->pushButtonGogInstall->update();
ui->pushButtonGogInstall->repaint();
QString tmpFileExe = dir.filePath("h3_gog.exe");
QFile(fileExe).copy(tmpFileExe);
QFile(fileBin).copy(dir.filePath("h3_gog-1.bin"));