Qt: Show shader generation window

This commit is contained in:
spycrab
2018-03-24 02:13:56 +01:00
parent 41787261b5
commit cb71b06afc
4 changed files with 42 additions and 5 deletions

View File

@ -93,6 +93,7 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters) : QMainW
CreateComponents();
ConnectGameList();
ConnectHost();
ConnectToolBar();
ConnectRenderWidget();
ConnectStack();
@ -375,6 +376,12 @@ void MainWindow::ConnectRenderWidget()
connect(m_render_widget, &RenderWidget::Closed, this, &MainWindow::ForceStop);
}
void MainWindow::ConnectHost()
{
connect(Host::GetInstance(), &Host::UpdateProgressDialog, this,
&MainWindow::OnUpdateProgressDialog);
}
void MainWindow::ConnectStack()
{
auto* widget = new QWidget;
@ -1194,3 +1201,24 @@ void MainWindow::ShowMemcardManager()
manager.exec();
}
void MainWindow::OnUpdateProgressDialog(QString title, int progress, int total)
{
if (!m_progress_dialog)
{
m_progress_dialog = new QProgressDialog(m_render_widget);
m_progress_dialog->show();
}
m_progress_dialog->setValue(progress);
m_progress_dialog->setLabelText(title);
m_progress_dialog->setWindowTitle(title);
m_progress_dialog->setMaximum(total);
if (total < 0 || progress >= total)
{
m_progress_dialog->hide();
m_progress_dialog->deleteLater();
m_progress_dialog = nullptr;
}
}