Files
o3de/Code/Editor/AssetImporter/UI/ProcessingAssetsDialog.cpp
T
Steve Pham b4a2edec6a Final update copyright headers to reference license files at the repo root (#1693)
* Final update copyright headers to reference license files at the repo root

Signed-off-by: spham <spham@amazon.com>

* Fix copyright validator unit tests to support the stale O3DE header scenario

Signed-off-by: spham <spham@amazon.com>
2021-06-30 19:51:55 -07:00

80 lines
2.5 KiB
C++

/*
* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include "EditorDefs.h"
#include "ProcessingAssetsDialog.h"
// Qt
#include <QPushButton>
#include <QStyle>
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
#include <AssetImporter/UI/ui_ProcessingAssetsDialog.h>
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
ProcessingAssetsDialog::ProcessingAssetsDialog(int numberOfProcessedFiles, QWidget* parent)
: QDialog(parent)
, m_ui(new Ui::ProcessingAssetsDialog)
{
m_ui->setupUi(this);
UpdateTextsAndTitle(numberOfProcessedFiles);
InitializeButtons();
}
ProcessingAssetsDialog::~ProcessingAssetsDialog()
{
}
void ProcessingAssetsDialog::InitializeButtons()
{
QPushButton* viewStatusButton = m_ui->buttonBox->addButton(tr("View status"), QDialogButtonBox::AcceptRole);
QPushButton* closeButton = m_ui->buttonBox->addButton(tr("Close"), QDialogButtonBox::RejectRole);
viewStatusButton->setDefault(true);
viewStatusButton->setProperty("class", "AssetImporterLargerButton");
viewStatusButton->style()->unpolish(viewStatusButton);
viewStatusButton->style()->polish(viewStatusButton);
viewStatusButton->update();
closeButton->setProperty("class", "AssetImporterButton");
closeButton->style()->unpolish(closeButton);
closeButton->style()->polish(closeButton);
closeButton->update();
connect(viewStatusButton, &QPushButton::clicked, this, &ProcessingAssetsDialog::accept);
connect(closeButton, &QPushButton::clicked, this, &ProcessingAssetsDialog::reject);
}
void ProcessingAssetsDialog::accept()
{
Q_EMIT OpenLogDialog();
QDialog::accept();
}
void ProcessingAssetsDialog::reject()
{
Q_EMIT CloseProcessingAssetsDialog();
QDialog::reject();
}
void ProcessingAssetsDialog::UpdateTextsAndTitle(int numberOfProcessedFiles)
{
if (numberOfProcessedFiles > 1)
{
setWindowTitle("Processing assets");
m_ui->label->setText("The Asset Processor will process your assets and when they are finished they will appear in the Asset Browser. You can view the status of your assets in the Asset Processor.");
}
else
{
setWindowTitle("Processing asset");
m_ui->label->setText("The Asset Processor will process your asset and when it is finished it will appear in the Asset Browser. You can view the status of your asset in the Asset Processor.");
}
}
#include <AssetImporter/UI/moc_ProcessingAssetsDialog.cpp>