Qt: Show shader generation window
This commit is contained in:
parent
41787261b5
commit
cb71b06afc
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#include <QAbstractEventDispatcher>
|
#include <QAbstractEventDispatcher>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
#include <QProgressDialog>
|
||||||
|
|
||||||
#include "Common/Common.h"
|
#include "Common/Common.h"
|
||||||
#include "Core/ConfigManager.h"
|
#include "Core/ConfigManager.h"
|
||||||
|
@ -105,6 +106,7 @@ void Host_UpdateDisasmDialog()
|
||||||
|
|
||||||
void Host_UpdateProgressDialog(const char* caption, int position, int total)
|
void Host_UpdateProgressDialog(const char* caption, int position, int total)
|
||||||
{
|
{
|
||||||
|
emit Host::GetInstance()->UpdateProgressDialog(QString::fromUtf8(caption), position, total);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We ignore these, and their purpose should be questioned individually.
|
// We ignore these, and their purpose should be questioned individually.
|
||||||
|
|
|
@ -32,6 +32,7 @@ signals:
|
||||||
void RequestTitle(const QString& title);
|
void RequestTitle(const QString& title);
|
||||||
void RequestStop();
|
void RequestStop();
|
||||||
void RequestRenderSize(int w, int h);
|
void RequestRenderSize(int w, int h);
|
||||||
|
void UpdateProgressDialog(QString label, int position, int maximum);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Host();
|
Host();
|
||||||
|
|
|
@ -93,6 +93,7 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters) : QMainW
|
||||||
CreateComponents();
|
CreateComponents();
|
||||||
|
|
||||||
ConnectGameList();
|
ConnectGameList();
|
||||||
|
ConnectHost();
|
||||||
ConnectToolBar();
|
ConnectToolBar();
|
||||||
ConnectRenderWidget();
|
ConnectRenderWidget();
|
||||||
ConnectStack();
|
ConnectStack();
|
||||||
|
@ -375,6 +376,12 @@ void MainWindow::ConnectRenderWidget()
|
||||||
connect(m_render_widget, &RenderWidget::Closed, this, &MainWindow::ForceStop);
|
connect(m_render_widget, &RenderWidget::Closed, this, &MainWindow::ForceStop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::ConnectHost()
|
||||||
|
{
|
||||||
|
connect(Host::GetInstance(), &Host::UpdateProgressDialog, this,
|
||||||
|
&MainWindow::OnUpdateProgressDialog);
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::ConnectStack()
|
void MainWindow::ConnectStack()
|
||||||
{
|
{
|
||||||
auto* widget = new QWidget;
|
auto* widget = new QWidget;
|
||||||
|
@ -1194,3 +1201,24 @@ void MainWindow::ShowMemcardManager()
|
||||||
|
|
||||||
manager.exec();
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -18,10 +18,16 @@
|
||||||
#include "DolphinQt2/RenderWidget.h"
|
#include "DolphinQt2/RenderWidget.h"
|
||||||
#include "DolphinQt2/ToolBar.h"
|
#include "DolphinQt2/ToolBar.h"
|
||||||
|
|
||||||
|
class QProgressDialog;
|
||||||
|
|
||||||
class BreakpointWidget;
|
class BreakpointWidget;
|
||||||
struct BootParameters;
|
struct BootParameters;
|
||||||
class CodeWidget;
|
class CodeWidget;
|
||||||
|
class ControllersWindow;
|
||||||
|
class DragEnterEvent;
|
||||||
class FIFOPlayerWindow;
|
class FIFOPlayerWindow;
|
||||||
|
class GCTASInputWindow;
|
||||||
|
class GraphicsWindow;
|
||||||
class HotkeyScheduler;
|
class HotkeyScheduler;
|
||||||
class LogConfigWidget;
|
class LogConfigWidget;
|
||||||
class LogWidget;
|
class LogWidget;
|
||||||
|
@ -30,14 +36,10 @@ class NetPlayClient;
|
||||||
class NetPlayDialog;
|
class NetPlayDialog;
|
||||||
class NetPlayServer;
|
class NetPlayServer;
|
||||||
class NetPlaySetupDialog;
|
class NetPlaySetupDialog;
|
||||||
|
class RegisterWidget;
|
||||||
class SearchBar;
|
class SearchBar;
|
||||||
class SettingsWindow;
|
class SettingsWindow;
|
||||||
class ControllersWindow;
|
|
||||||
class DragEnterEvent;
|
|
||||||
class GraphicsWindow;
|
|
||||||
class RegisterWidget;
|
|
||||||
class WatchWidget;
|
class WatchWidget;
|
||||||
class GCTASInputWindow;
|
|
||||||
class WiiTASInputWindow;
|
class WiiTASInputWindow;
|
||||||
|
|
||||||
class MainWindow final : public QMainWindow
|
class MainWindow final : public QMainWindow
|
||||||
|
@ -85,6 +87,7 @@ private:
|
||||||
void CreateComponents();
|
void CreateComponents();
|
||||||
|
|
||||||
void ConnectGameList();
|
void ConnectGameList();
|
||||||
|
void ConnectHost();
|
||||||
void ConnectHotkeys();
|
void ConnectHotkeys();
|
||||||
void ConnectMenuBar();
|
void ConnectMenuBar();
|
||||||
void ConnectRenderWidget();
|
void ConnectRenderWidget();
|
||||||
|
@ -122,6 +125,8 @@ private:
|
||||||
void OnImportNANDBackup();
|
void OnImportNANDBackup();
|
||||||
void OnConnectWiiRemote(int id);
|
void OnConnectWiiRemote(int id);
|
||||||
|
|
||||||
|
void OnUpdateProgressDialog(QString label, int progress, int total);
|
||||||
|
|
||||||
void OnPlayRecording();
|
void OnPlayRecording();
|
||||||
void OnStartRecording();
|
void OnStartRecording();
|
||||||
void OnStopRecording();
|
void OnStopRecording();
|
||||||
|
@ -135,6 +140,7 @@ private:
|
||||||
void dropEvent(QDropEvent* event) override;
|
void dropEvent(QDropEvent* event) override;
|
||||||
QSize sizeHint() const override;
|
QSize sizeHint() const override;
|
||||||
|
|
||||||
|
QProgressDialog* m_progress_dialog = nullptr;
|
||||||
QStackedWidget* m_stack;
|
QStackedWidget* m_stack;
|
||||||
ToolBar* m_tool_bar;
|
ToolBar* m_tool_bar;
|
||||||
MenuBar* m_menu_bar;
|
MenuBar* m_menu_bar;
|
||||||
|
|
Loading…
Reference in New Issue