1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-19 21:10:12 +02:00
vcmi/mapeditor/generatorprogress.cpp
George King 6c72aa4cbe
Improved "Create new map" dialog for map editor (#5187)
* Improve  "Create new map" dialog

* Tweaks

* Tweaks

* Final tweaking

Optimized UI to look more consistent. Removed help button.

* Add files via upload

* Reworked dialog

* Formatting fix

* Add files via upload

* Add files via upload

* Add files via upload

* Fix seed condition

* Remove help button

* Remove help button

* Fixed labels

* Fix for Humans vs Computers combo

* Removed not needed connections + better radio names

* Update mapeditor/windownewmap.cpp

Co-authored-by: Andrey Filipenkov <kambaladecapitator@gmail.com>

* Improve map size selection grabbing

* Remove QRegularExpression

* Reformat mapSizes

---------

Co-authored-by: Andrey Filipenkov <kambaladecapitator@gmail.com>
2025-01-06 14:39:14 +02:00

48 lines
919 B
C++

/*
* generatorprogress.cpp, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#include "StdInc.h"
#include "generatorprogress.h"
#include "ui_generatorprogress.h"
#include <thread>
#include <chrono>
GeneratorProgress::GeneratorProgress(Load::Progress & source, QWidget *parent) :
QDialog(parent),
ui(new Ui::GeneratorProgress),
source(source)
{
ui->setupUi(this);
setWindowFlags(Qt::Dialog | Qt::WindowTitleHint | Qt::CustomizeWindowHint);
setAttribute(Qt::WA_DeleteOnClose);
show();
}
GeneratorProgress::~GeneratorProgress()
{
delete ui;
}
void GeneratorProgress::update()
{
while(!source.finished())
{
int status = float(source.get()) / 2.55f;
ui->progressBar->setValue(status);
qApp->processEvents();
}
//delete source;
close();
}