| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <map> |
| 7 |
#include <span> |
| 8 |
|
| 9 |
#include <QDialog> |
| 10 |
|
| 11 |
#include "Common/CommonTypes.h" |
| 12 |
|
| 13 |
class QDialogButtonBox; |
| 14 |
class QGroupBox; |
| 15 |
class QLabel; |
| 16 |
class QProgressBar; |
| 17 |
class QVBoxLayout; |
| 18 |
class QWidget; |
| 19 |
|
| 20 |
class ChunkedProgressDialog : public QDialog |
| 21 |
{ |
| 22 |
Q_OBJECT |
| 23 |
public: |
| 24 |
explicit ChunkedProgressDialog(QWidget* parent); |
| 25 |
|
| 26 |
void show(const QString& title, u64 data_size, std::span<const int> players); |
| 27 |
void SetProgress(int pid, u64 progress); |
| 28 |
|
| 29 |
void reject() override; |
| 30 |
|
| 31 |
private: |
| 32 |
void CreateWidgets(); |
| 33 |
void ConnectWidgets(); |
| 34 |
|
| 35 |
std::map<int, QProgressBar*> m_progress_bars; |
| 36 |
std::map<int, QLabel*> m_status_labels; |
| 37 |
u64 m_data_size = 0; |
| 38 |
|
| 39 |
QGroupBox* m_progress_box; |
| 40 |
QVBoxLayout* m_progress_layout; |
| 41 |
QVBoxLayout* m_main_layout; |
| 42 |
QDialogButtonBox* m_button_box; |
| 43 |
}; |