2022-01-13 23:58:16 +00:00
|
|
|
#pragma once
|
|
|
|
|
2022-01-14 00:22:22 +00:00
|
|
|
#include <thread>
|
2022-01-16 14:54:21 +00:00
|
|
|
#include <QWidget>
|
2022-01-16 15:06:39 +00:00
|
|
|
#include <QCloseEvent>
|
2022-01-13 23:58:16 +00:00
|
|
|
#include <QStorageInfo>
|
|
|
|
#include "BootableModel.h"
|
2022-01-16 15:06:39 +00:00
|
|
|
#include "BootableModelProxy.h"
|
|
|
|
#include "ContinuationChecker.h"
|
|
|
|
#include "ElidedLabel.h"
|
2022-01-13 23:58:16 +00:00
|
|
|
#include "ui_shared/BootablesDbClient.h"
|
|
|
|
|
2022-01-16 14:54:21 +00:00
|
|
|
namespace Ui
|
|
|
|
{
|
|
|
|
class QBootablesView;
|
|
|
|
}
|
|
|
|
|
|
|
|
class QBootablesView : public QWidget
|
2022-01-13 23:58:16 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2022-01-14 23:05:02 +00:00
|
|
|
explicit QBootablesView(QWidget* parent = 0);
|
2022-01-13 23:58:16 +00:00
|
|
|
|
2024-10-22 14:47:27 +01:00
|
|
|
using BootCallback = std::function<void(const BootablesDb::Bootable&)>;
|
2022-01-13 23:58:16 +00:00
|
|
|
|
2022-01-15 01:23:44 +00:00
|
|
|
void SetupActions(BootCallback);
|
2022-01-16 15:06:39 +00:00
|
|
|
void AddMsgLabel(ElidedLabel*);
|
2022-01-16 15:33:49 +00:00
|
|
|
bool IsProcessing();
|
2022-01-13 23:58:16 +00:00
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void AsyncResetModel(bool);
|
|
|
|
void AsyncUpdateCoverDisplay();
|
2022-01-16 15:06:39 +00:00
|
|
|
void AsyncUpdateStatus(std::string);
|
2022-01-13 23:58:16 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void resizeEvent(QResizeEvent*) Q_DECL_OVERRIDE;
|
|
|
|
|
2022-01-16 15:06:39 +00:00
|
|
|
private slots:
|
|
|
|
void on_add_games_button_clicked();
|
|
|
|
void on_listView_doubleClicked(const QModelIndex& index);
|
|
|
|
void on_refresh_button_clicked();
|
|
|
|
void on_comboBox_currentIndexChanged(int index);
|
|
|
|
void on_reset_filter_button_clicked();
|
|
|
|
void on_awsS3Button_clicked();
|
|
|
|
|
|
|
|
void UpdateStatus(std::string);
|
|
|
|
void resetModel(bool = true);
|
|
|
|
|
2022-01-13 23:58:16 +00:00
|
|
|
private:
|
|
|
|
void AsyncPopulateCache();
|
2022-01-16 14:54:21 +00:00
|
|
|
|
2022-01-16 15:06:39 +00:00
|
|
|
void SelectionChange(const QModelIndex&);
|
|
|
|
void DisplayWarningMessage();
|
|
|
|
void BootBootables(const QModelIndex&);
|
2022-01-18 17:37:08 +00:00
|
|
|
void UpdateCoverDisplay();
|
2022-01-24 21:50:07 +00:00
|
|
|
void ToggleInterface(bool);
|
2022-01-16 15:06:39 +00:00
|
|
|
|
2022-01-16 14:54:21 +00:00
|
|
|
Ui::QBootablesView* ui;
|
2022-01-13 23:58:16 +00:00
|
|
|
std::vector<BootablesDb::Bootable> m_bootables;
|
|
|
|
|
2022-01-16 15:06:39 +00:00
|
|
|
ElidedLabel* m_msgLabel = nullptr;
|
|
|
|
int m_sortingMethod = 2;
|
2022-01-24 21:50:07 +00:00
|
|
|
std::atomic<bool> m_isProcessing = false;
|
2022-01-16 15:06:39 +00:00
|
|
|
BootableModelProxy* m_proxyModel = nullptr;
|
|
|
|
CContinuationChecker* m_continuationChecker = nullptr;
|
|
|
|
|
2022-01-20 23:13:15 +00:00
|
|
|
std::atomic<bool> m_coverProcessing = false;
|
2022-01-15 01:23:44 +00:00
|
|
|
BootCallback m_bootCallback;
|
2022-01-13 23:58:16 +00:00
|
|
|
};
|