mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-11 14:41:57 +00:00
Added progress bars for most major blocking operations
This commit is contained in:
@@ -2,12 +2,16 @@
|
||||
#include "ui_CProjectSettingsDialog.h"
|
||||
#include "CEditorApplication.h"
|
||||
#include "CExportGameDialog.h"
|
||||
#include "CProgressDialog.h"
|
||||
#include "UICommon.h"
|
||||
#include "Editor/ResourceBrowser/CResourceBrowser.h"
|
||||
#include <Common/AssertMacro.h>
|
||||
#include <Core/GameProject/CGameExporter.h>
|
||||
#include <QFileDialog>
|
||||
#include <QFuture>
|
||||
#include <QFutureWatcher>
|
||||
#include <QMessageBox>
|
||||
#include <QtConcurrent/QtConcurrentRun>
|
||||
|
||||
CProjectSettingsDialog::CProjectSettingsDialog(QWidget *pParent)
|
||||
: QDialog(pParent)
|
||||
@@ -22,6 +26,7 @@ CProjectSettingsDialog::CProjectSettingsDialog(QWidget *pParent)
|
||||
|
||||
connect(gpEdApp, SIGNAL(ActiveProjectChanged(CGameProject*)), this, SLOT(ActiveProjectChanged(CGameProject*)));
|
||||
connect(gpEdApp, SIGNAL(AssetsModified()), this, SLOT(SetupPackagesList()));
|
||||
connect(gpEdApp, SIGNAL(PackagesCooked()), this, SLOT(SetupPackagesList()));
|
||||
|
||||
// Set build ISO button color
|
||||
QPalette Palette = mpUI->BuildIsoButton->palette();
|
||||
@@ -91,15 +96,13 @@ void CProjectSettingsDialog::CookPackage()
|
||||
if (PackageIdx != -1)
|
||||
{
|
||||
CPackage *pPackage = mpProject->PackageByIndex(PackageIdx);
|
||||
pPackage->Cook();
|
||||
SetupPackagesList();
|
||||
gpEdApp->CookPackage(pPackage);
|
||||
}
|
||||
}
|
||||
|
||||
void CProjectSettingsDialog::CookAllDirtyPackages()
|
||||
{
|
||||
gpEdApp->CookAllDirtyPackages();
|
||||
SetupPackagesList();
|
||||
}
|
||||
|
||||
void CProjectSettingsDialog::BuildISO()
|
||||
@@ -107,12 +110,17 @@ void CProjectSettingsDialog::BuildISO()
|
||||
CGameProject *pProj = gpEdApp->ActiveProject();
|
||||
ASSERT(pProj && !pProj->IsWiiBuild());
|
||||
|
||||
QString DefaultPath = TO_QSTRING(pProj->ProjectRoot() + pProj->Name()) + ".gcm";
|
||||
QString DefaultPath = TO_QSTRING( pProj->ProjectRoot() + FileUtil::SanitizeName(pProj->Name(), false) + ".gcm" );
|
||||
QString IsoPath = UICommon::SaveFileDialog(this, "Choose output ISO path", "*.gcm", DefaultPath);
|
||||
|
||||
if (!IsoPath.isEmpty())
|
||||
{
|
||||
if (!pProj->BuildISO( TO_TSTRING(IsoPath) ))
|
||||
UICommon::ErrorMsg(this, "Failed to build ISO! Check the log for details.");
|
||||
if (gpEdApp->CookAllDirtyPackages())
|
||||
{
|
||||
CProgressDialog Dialog("Building ISO", true, this);
|
||||
Dialog.DisallowCanceling();
|
||||
QFuture<void> Future = QtConcurrent::run(pProj, &CGameProject::BuildISO, TO_TSTRING(IsoPath), &Dialog);
|
||||
Dialog.WaitForResults(Future);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user