-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
GameList.h
90 lines (71 loc) · 2.04 KB
/
GameList.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// Copyright 2015 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <memory>
#include <QStackedWidget>
class GameListModel;
class QLabel;
class QListView;
class QSortFilterProxyModel;
class QTableView;
namespace UICommon
{
class GameFile;
}
class GameList final : public QStackedWidget
{
Q_OBJECT
public:
explicit GameList(QWidget* parent = nullptr);
~GameList();
std::shared_ptr<const UICommon::GameFile> GetSelectedGame() const;
QList<std::shared_ptr<const UICommon::GameFile>> GetSelectedGames() const;
bool HasMultipleSelected() const;
void SetListView() { SetPreferredView(true); }
void SetGridView() { SetPreferredView(false); }
void SetViewColumn(int col, bool view);
void SetSearchTerm(const QString& term);
void OnColumnVisibilityToggled(const QString& row, bool visible);
void OnGameListVisibilityChanged();
void resizeEvent(QResizeEvent* event) override;
signals:
void GameSelected();
void NetPlayHost(const QString& game_id);
void SelectionChanged(std::shared_ptr<const UICommon::GameFile> game_file);
void OpenGeneralSettings();
private:
void ShowContextMenu(const QPoint&);
void OpenContainingFolder();
void OpenProperties();
void OpenSaveFolder();
void OpenWiki();
void SetDefaultISO();
void DeleteFile();
void InstallWAD();
void UninstallWAD();
void ExportWiiSave();
void CompressISO(bool decompress);
void ChangeDisc();
void UpdateColumnVisibility();
void ZoomIn();
void ZoomOut();
void OnHeaderViewChanged();
void OnSectionResized(int index, int, int);
void MakeListView();
void MakeGridView();
void MakeEmptyView();
// We only have two views, just use a bool to distinguish.
void SetPreferredView(bool list);
void ConsiderViewChange();
void UpdateFont();
GameListModel* m_model;
QSortFilterProxyModel* m_list_proxy;
QSortFilterProxyModel* m_grid_proxy;
QListView* m_grid;
QTableView* m_list;
QLabel* m_empty;
bool m_prefer_list;
protected:
void keyReleaseEvent(QKeyEvent* event) override;
};