rpcs3/rpcs3/rpcs3qt/progress_dialog.h

27 lines
737 B
C
Raw Normal View History

2020-12-05 12:08:24 +00:00
#pragma once
2017-11-25 13:01:35 +00:00
#include <QProgressDialog>
#ifdef _WIN32
#include <QWinTaskbarProgress>
#include <QWinTaskbarButton>
#endif
class progress_dialog : public QProgressDialog
{
public:
2021-09-29 19:28:51 +00:00
progress_dialog(const QString& windowTitle, const QString& labelText, const QString& cancelButtonText, int minimum, int maximum, bool delete_on_close, QWidget* parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
2017-11-25 13:01:35 +00:00
~progress_dialog();
2021-09-29 19:28:51 +00:00
void SetRange(int min, int max);
2017-11-25 13:01:35 +00:00
void SetValue(int progress);
2021-04-07 21:05:18 +00:00
void SignalFailure() const;
2017-11-25 13:01:35 +00:00
private:
#ifdef _WIN32
std::unique_ptr<QWinTaskbarButton> m_tb_button = nullptr;
QWinTaskbarProgress* m_tb_progress = nullptr;
#elif HAVE_QTDBUS
void UpdateProgress(int progress, bool progress_visible);
2017-11-25 13:01:35 +00:00
#endif
};