Qt: Fix game list settings headings not being translatable
This commit is contained in:
41
src/duckstation-qt/gamelistsearchdirectoriesmodel.h
Normal file
41
src/duckstation-qt/gamelistsearchdirectoriesmodel.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
#include <QtCore/QAbstractTableModel>
|
||||
#include <QtCore/QString>
|
||||
#include <vector>
|
||||
|
||||
class QtHostInterface;
|
||||
|
||||
class GameListSearchDirectoriesModel : public QAbstractTableModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GameListSearchDirectoriesModel(QtHostInterface* host_interface);
|
||||
~GameListSearchDirectoriesModel();
|
||||
|
||||
int columnCount(const QModelIndex& parent) const override;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
||||
int rowCount(const QModelIndex& parent) const override;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
||||
bool setData(const QModelIndex& index, const QVariant& value, int role) override;
|
||||
|
||||
void addEntry(const QString& path, bool recursive);
|
||||
void removeEntry(int row);
|
||||
|
||||
bool isEntryRecursive(int row) const;
|
||||
void setEntryRecursive(int row, bool recursive);
|
||||
|
||||
void openEntryInExplorer(QWidget* parent, int row) const;
|
||||
void loadFromSettings();
|
||||
void saveToSettings();
|
||||
|
||||
private:
|
||||
struct Entry
|
||||
{
|
||||
QString path;
|
||||
bool recursive;
|
||||
};
|
||||
|
||||
QtHostInterface* m_host_interface;
|
||||
std::vector<Entry> m_entries;
|
||||
};
|
||||
Reference in New Issue
Block a user