game_list.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright 2015 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <QModelIndex>
  6. #include <QSettings>
  7. #include <QStandardItem>
  8. #include <QStandardItemModel>
  9. #include <QString>
  10. #include <QTreeView>
  11. #include <QWidget>
  12. class GameListWorker;
  13. class GameList : public QWidget {
  14. Q_OBJECT
  15. public:
  16. enum {
  17. COLUMN_NAME,
  18. COLUMN_FILE_TYPE,
  19. COLUMN_SIZE,
  20. COLUMN_COUNT, // Number of columns
  21. };
  22. GameList(QWidget* parent = nullptr);
  23. ~GameList() override;
  24. void PopulateAsync(const QString& dir_path, bool deep_scan);
  25. void SaveInterfaceLayout();
  26. void LoadInterfaceLayout();
  27. public slots:
  28. void AddEntry(QList<QStandardItem*> entry_items);
  29. private slots:
  30. void ValidateEntry(const QModelIndex& item);
  31. void DonePopulating();
  32. signals:
  33. void GameChosen(QString game_path);
  34. void ShouldCancelWorker();
  35. private:
  36. QTreeView* tree_view = nullptr;
  37. QStandardItemModel* item_model = nullptr;
  38. GameListWorker* current_worker = nullptr;
  39. };