citra_qt: support multiple game directories
This commit is contained in:
parent
88ebd844e5
commit
1a57f9488f
26 changed files with 561 additions and 132 deletions
|
@ -8,13 +8,17 @@
|
|||
#include <QString>
|
||||
#include <QWidget>
|
||||
#include "common/common_types.h"
|
||||
#include "ui_settings.h"
|
||||
|
||||
class GameListWorker;
|
||||
class GameListDir;
|
||||
class GMainWindow;
|
||||
class QFileSystemWatcher;
|
||||
class QHBoxLayout;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
template <typename>
|
||||
class QList;
|
||||
class QModelIndex;
|
||||
class QStandardItem;
|
||||
class QStandardItemModel;
|
||||
|
@ -39,12 +43,14 @@ public:
|
|||
|
||||
class SearchField : public QWidget {
|
||||
public:
|
||||
int visible;
|
||||
int total;
|
||||
explicit SearchField(GameList* parent = nullptr);
|
||||
|
||||
void setFilterResult(int visible, int total);
|
||||
void clear();
|
||||
void setFocus();
|
||||
explicit SearchField(GameList* parent = nullptr);
|
||||
|
||||
int visible;
|
||||
int total;
|
||||
|
||||
private:
|
||||
class KeyReleaseEater : public QObject {
|
||||
|
@ -73,9 +79,10 @@ public:
|
|||
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();
|
||||
|
@ -91,20 +98,30 @@ signals:
|
|||
void NavigateToGamedbEntryRequested(
|
||||
u64 program_id,
|
||||
std::unordered_map<std::string, std::pair<QString, QString>>& compatibility_list);
|
||||
void OpenDirectory(QString directory);
|
||||
void AddDirectory();
|
||||
void ShowList(bool show);
|
||||
|
||||
private slots:
|
||||
void onItemExpanded(const QModelIndex& item);
|
||||
void onTextChanged(const QString& newText);
|
||||
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();
|
||||
bool containsAllWords(QString haystack, QString userinput);
|
||||
|
||||
void PopupContextMenu(const QPoint& menu_location);
|
||||
void AddGamePopup(QMenu& context_menu, u64 program_id);
|
||||
void AddCustomDirPopup(QMenu& context_menu, QModelIndex selected);
|
||||
void AddPermDirPopup(QMenu& context_menu, QModelIndex selected);
|
||||
|
||||
SearchField* search_field;
|
||||
GMainWindow* main_window = nullptr;
|
||||
QVBoxLayout* layout = nullptr;
|
||||
|
@ -116,3 +133,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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue