mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-19 17:02:15 -07:00
add new method to replay tree widget
This commit is contained in:
parent
4ca1fc083d
commit
f335fae900
2 changed files with 10 additions and 1 deletions
|
|
@ -309,6 +309,15 @@ RemoteReplayList_TreeWidget::RemoteReplayList_TreeWidget(AbstractClient *_client
|
||||||
setSelectionMode(QAbstractItemView::ExtendedSelection);
|
setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the replay at the given index
|
||||||
|
* @return The replay. Returns nullptr if there is no replay at the index.
|
||||||
|
*/
|
||||||
|
ServerInfo_Replay const *RemoteReplayList_TreeWidget::getReplay(const QModelIndex &ind) const
|
||||||
|
{
|
||||||
|
return treeModel->getReplay(proxyModel->mapToSource(ind));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets all currently selected replays.
|
* Gets all currently selected replays.
|
||||||
* Any selection that isn't a replay file (e.g. a folder) will appear as a nullptr in the list.
|
* Any selection that isn't a replay file (e.g. a folder) will appear as a nullptr in the list.
|
||||||
|
|
|
||||||
|
|
@ -107,10 +107,10 @@ class RemoteReplayList_TreeWidget : public QTreeView
|
||||||
private:
|
private:
|
||||||
RemoteReplayList_TreeModel *treeModel;
|
RemoteReplayList_TreeModel *treeModel;
|
||||||
QSortFilterProxyModel *proxyModel;
|
QSortFilterProxyModel *proxyModel;
|
||||||
ServerInfo_Replay const *getNode(const QModelIndex &ind) const;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RemoteReplayList_TreeWidget(AbstractClient *_client, QWidget *parent = nullptr);
|
RemoteReplayList_TreeWidget(AbstractClient *_client, QWidget *parent = nullptr);
|
||||||
|
ServerInfo_Replay const *getReplay(const QModelIndex &ind) const;
|
||||||
QList<ServerInfo_Replay const *> getSelectedReplays() const;
|
QList<ServerInfo_Replay const *> getSelectedReplays() const;
|
||||||
QSet<ServerInfo_ReplayMatch const *> getSelectedReplayMatches() const;
|
QSet<ServerInfo_ReplayMatch const *> getSelectedReplayMatches() const;
|
||||||
void refreshTree();
|
void refreshTree();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue