mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-06 05:23:56 -07:00
interface & client tab for replay transfer
This commit is contained in:
parent
faf6b2c5cb
commit
c6c6a970c6
36 changed files with 702 additions and 52 deletions
49
cockatrice/src/remotereplaylist_treewidget.h
Normal file
49
cockatrice/src/remotereplaylist_treewidget.h
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
#ifndef REMOTEREPLAYLIST_TREEWIDGET_H
|
||||
#define REMOTEREPLAYLIST_TREEWIDGET_H
|
||||
|
||||
#include <QAbstractItemModel>
|
||||
#include <QDateTime>
|
||||
#include <QTreeView>
|
||||
#include "pb/serverinfo_replay.pb.h"
|
||||
|
||||
class Response;
|
||||
class AbstractClient;
|
||||
class QSortFilterProxyModel;
|
||||
|
||||
class RemoteReplayList_TreeModel : public QAbstractItemModel {
|
||||
Q_OBJECT
|
||||
private:
|
||||
AbstractClient *client;
|
||||
QList<ServerInfo_Replay> replays;
|
||||
|
||||
QIcon fileIcon;
|
||||
signals:
|
||||
void treeRefreshed();
|
||||
private slots:
|
||||
void replayListFinished(const Response &r);
|
||||
public:
|
||||
RemoteReplayList_TreeModel(AbstractClient *_client, QObject *parent = 0);
|
||||
~RemoteReplayList_TreeModel();
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex &/*parent*/ = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
|
||||
QModelIndex parent(const QModelIndex &index) const;
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
void refreshTree();
|
||||
ServerInfo_Replay const *getNode(const QModelIndex &index) const;
|
||||
};
|
||||
|
||||
class RemoteReplayList_TreeWidget : public QTreeView {
|
||||
private:
|
||||
RemoteReplayList_TreeModel *treeModel;
|
||||
QSortFilterProxyModel *proxyModel;
|
||||
ServerInfo_Replay const *getNode(const QModelIndex &ind) const;
|
||||
public:
|
||||
RemoteReplayList_TreeWidget(AbstractClient *_client, QWidget *parent = 0);
|
||||
ServerInfo_Replay const *getCurrentItem() const;
|
||||
void refreshTree();
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue