Play-/Source/ui_qt/QBootablesView.h

71 lines
1.6 KiB
C
Raw Permalink Normal View History

2022-01-13 23:58:16 +00:00
#pragma once
2022-01-14 00:22:22 +00:00
#include <thread>
#include <QWidget>
#include <QCloseEvent>
2022-01-13 23:58:16 +00:00
#include <QStorageInfo>
#include "BootableModel.h"
#include "BootableModelProxy.h"
#include "ContinuationChecker.h"
#include "ElidedLabel.h"
2022-01-13 23:58:16 +00:00
#include "ui_shared/BootablesDbClient.h"
namespace Ui
{
class QBootablesView;
}
class QBootablesView : public QWidget
2022-01-13 23:58:16 +00:00
{
Q_OBJECT
public:
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);
void AddMsgLabel(ElidedLabel*);
bool IsProcessing();
2022-01-13 23:58:16 +00:00
Q_SIGNALS:
void AsyncResetModel(bool);
void AsyncUpdateCoverDisplay();
void AsyncUpdateStatus(std::string);
2022-01-13 23:58:16 +00:00
protected:
void resizeEvent(QResizeEvent*) Q_DECL_OVERRIDE;
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();
void SelectionChange(const QModelIndex&);
void DisplayWarningMessage();
void BootBootables(const QModelIndex&);
2022-01-18 17:37:08 +00:00
void UpdateCoverDisplay();
void ToggleInterface(bool);
Ui::QBootablesView* ui;
2022-01-13 23:58:16 +00:00
std::vector<BootablesDb::Bootable> m_bootables;
ElidedLabel* m_msgLabel = nullptr;
int m_sortingMethod = 2;
std::atomic<bool> m_isProcessing = false;
BootableModelProxy* m_proxyModel = nullptr;
CContinuationChecker* m_continuationChecker = nullptr;
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
};