yuzu: Add support for multiple game directories

Ported from https://github.com/citra-emu/citra/pull/3617.
This commit is contained in:
fearlessTobi
2019-05-01 23:21:04 +02:00
committed by FearlessTobi
parent 7fc5af3622
commit 2d8eba5baf
12 changed files with 664 additions and 193 deletions

View File

@ -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;
};