mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Qt: Show shader generation window
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user