summaryrefslogtreecommitdiff
path: root/src/yuzu/game_list.h
diff options
context:
space:
mode:
authorfearlessTobi <thm.frey@gmail.com>2019-05-01 23:21:04 +0200
committerFearlessTobi <thm.frey@gmail.com>2019-09-04 16:47:32 +0200
commit2d8eba5bafd7fe9da00c8a57c605a503c3ece478 (patch)
treec3bc64c33ab43f6bd0d7bb6f4ec63b11490a41e8 /src/yuzu/game_list.h
parent7fc5af36226676d2ebc07a7a3d3cd82c536f206a (diff)
yuzu: Add support for multiple game directories
Ported from https://github.com/citra-emu/citra/pull/3617.
Diffstat (limited to 'src/yuzu/game_list.h')
-rw-r--r--src/yuzu/game_list.h44
1 files changed, 41 insertions, 3 deletions
diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h
index f8f8bd6c5..a2b58aba5 100644
--- a/src/yuzu/game_list.h
+++ b/src/yuzu/game_list.h
@@ -19,10 +19,14 @@
#include <QWidget>
#include "common/common_types.h"
+#include "ui_settings.h"
#include "yuzu/compatibility_list.h"
class GameListWorker;
class GameListSearchField;
+template <typename>
+class QList;
+class GameListDir;
class GMainWindow;
namespace FileSys {
@@ -52,12 +56,14 @@ public:
FileSys::ManualContentProvider* provider, GMainWindow* parent = nullptr);
~GameList() override;
+ QString getLastFilterResultItem();
void clearFilter();
void setFilterFocus();
void setFilterVisible(bool visibility);
+ bool isEmpty();
void LoadCompatibilityList();
- void PopulateAsync(const QString& dir_path, bool deep_scan);
+ void PopulateAsync(QList<UISettings::GameDir>& game_dirs);
void SaveInterfaceLayout();
void LoadInterfaceLayout();
@@ -74,19 +80,29 @@ signals:
void NavigateToGamedbEntryRequested(u64 program_id,
const CompatibilityList& compatibility_list);
void OpenPerGameGeneralRequested(const std::string& file);
+ void OpenDirectory(QString directory);
+ void AddDirectory();
+ void ShowList(bool show);
private slots:
+ void onItemExpanded(const QModelIndex& item);
void onTextChanged(const QString& new_text);
void onFilterCloseClicked();
+ void onUpdateThemedIcons();
private:
- void AddEntry(const QList<QStandardItem*>& entry_items);
+ void AddDirEntry(GameListDir* entry_items);
+ void AddEntry(const QList<QStandardItem*>& entry_items, GameListDir* parent);
void ValidateEntry(const QModelIndex& item);
void DonePopulating(QStringList watch_list);
- void PopupContextMenu(const QPoint& menu_location);
void RefreshGameDirectory();
+ void PopupContextMenu(const QPoint& menu_location);
+ void AddGamePopup(QMenu& context_menu, u64 program_id, std::string path);
+ void AddCustomDirPopup(QMenu& context_menu, QModelIndex selected);
+ void AddPermDirPopup(QMenu& context_menu, QModelIndex selected);
+
std::shared_ptr<FileSys::VfsFilesystem> vfs;
FileSys::ManualContentProvider* provider;
GameListSearchField* search_field;
@@ -102,3 +118,25 @@ private:
};
Q_DECLARE_METATYPE(GameListOpenTarget);
+
+class GameListPlaceholder : public QWidget {
+ Q_OBJECT
+public:
+ explicit GameListPlaceholder(GMainWindow* parent = nullptr);
+ ~GameListPlaceholder();
+
+signals:
+ void AddDirectory();
+
+private slots:
+ void onUpdateThemedIcons();
+
+protected:
+ void mouseDoubleClickEvent(QMouseEvent* event) override;
+
+private:
+ GMainWindow* main_window = nullptr;
+ QVBoxLayout* layout = nullptr;
+ QLabel* image = nullptr;
+ QLabel* text = nullptr;
+};