mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-14 19:18:55 -07:00
open decks on double-click in deck storage tab (#5322)
This commit is contained in:
parent
4ca1fc083d
commit
2b9d7538bf
2 changed files with 20 additions and 0 deletions
|
|
@ -45,6 +45,8 @@ TabDeckStorage::TabDeckStorage(TabSupervisor *_tabSupervisor, AbstractClient *_c
|
||||||
localDirView->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
localDirView->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||||
localDirView->header()->setSortIndicator(0, Qt::AscendingOrder);
|
localDirView->header()->setSortIndicator(0, Qt::AscendingOrder);
|
||||||
|
|
||||||
|
connect(localDirView, &QTreeView::doubleClicked, this, &TabDeckStorage::actLocalDoubleClick);
|
||||||
|
|
||||||
leftToolBar = new QToolBar;
|
leftToolBar = new QToolBar;
|
||||||
leftToolBar->setOrientation(Qt::Horizontal);
|
leftToolBar->setOrientation(Qt::Horizontal);
|
||||||
leftToolBar->setIconSize(QSize(32, 32));
|
leftToolBar->setIconSize(QSize(32, 32));
|
||||||
|
|
@ -69,6 +71,8 @@ TabDeckStorage::TabDeckStorage(TabSupervisor *_tabSupervisor, AbstractClient *_c
|
||||||
|
|
||||||
serverDirView = new RemoteDeckList_TreeWidget(client);
|
serverDirView = new RemoteDeckList_TreeWidget(client);
|
||||||
|
|
||||||
|
connect(serverDirView, &QTreeView::doubleClicked, this, &TabDeckStorage::actRemoteDoubleClick);
|
||||||
|
|
||||||
QVBoxLayout *rightVbox = new QVBoxLayout;
|
QVBoxLayout *rightVbox = new QVBoxLayout;
|
||||||
rightVbox->addWidget(serverDirView);
|
rightVbox->addWidget(serverDirView);
|
||||||
rightVbox->addLayout(rightToolBarLayout);
|
rightVbox->addLayout(rightToolBarLayout);
|
||||||
|
|
@ -154,6 +158,13 @@ QString TabDeckStorage::getTargetPath() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TabDeckStorage::actLocalDoubleClick(const QModelIndex &curLeft)
|
||||||
|
{
|
||||||
|
if (!localDirModel->isDir(curLeft)) {
|
||||||
|
actOpenLocalDeck();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TabDeckStorage::actOpenLocalDeck()
|
void TabDeckStorage::actOpenLocalDeck()
|
||||||
{
|
{
|
||||||
QModelIndexList curLefts = localDirView->selectionModel()->selectedRows();
|
QModelIndexList curLefts = localDirView->selectionModel()->selectedRows();
|
||||||
|
|
@ -289,6 +300,13 @@ void TabDeckStorage::actDeleteLocalDeck()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TabDeckStorage::actRemoteDoubleClick(const QModelIndex &curRight)
|
||||||
|
{
|
||||||
|
if (dynamic_cast<RemoteDeckList_TreeModel::FileNode *>(serverDirView->getNode(curRight))) {
|
||||||
|
actOpenRemoteDeck();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TabDeckStorage::actOpenRemoteDeck()
|
void TabDeckStorage::actOpenRemoteDeck()
|
||||||
{
|
{
|
||||||
for (const auto &curRight : serverDirView->getCurrentSelection()) {
|
for (const auto &curRight : serverDirView->getCurrentSelection()) {
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ private:
|
||||||
void deleteRemoteDeck(const RemoteDeckList_TreeModel::Node *node);
|
void deleteRemoteDeck(const RemoteDeckList_TreeModel::Node *node);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void actLocalDoubleClick(const QModelIndex &curLeft);
|
||||||
void actOpenLocalDeck();
|
void actOpenLocalDeck();
|
||||||
|
|
||||||
void actUpload();
|
void actUpload();
|
||||||
|
|
@ -42,6 +43,7 @@ private slots:
|
||||||
void actNewLocalFolder();
|
void actNewLocalFolder();
|
||||||
void actDeleteLocalDeck();
|
void actDeleteLocalDeck();
|
||||||
|
|
||||||
|
void actRemoteDoubleClick(const QModelIndex &curRight);
|
||||||
void actOpenRemoteDeck();
|
void actOpenRemoteDeck();
|
||||||
void openRemoteDeckFinished(const Response &r, const CommandContainer &commandContainer);
|
void openRemoteDeckFinished(const Response &r, const CommandContainer &commandContainer);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue