From 63df984860f21f8cc63c711a8d5ce2b174604cd6 Mon Sep 17 00:00:00 2001 From: RickyRister Date: Tue, 24 Dec 2024 20:29:40 -0800 Subject: [PATCH] implement thing --- cockatrice/src/client/tabs/tab_replays.cpp | 14 ++++++++++++++ cockatrice/src/client/tabs/tab_replays.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/cockatrice/src/client/tabs/tab_replays.cpp b/cockatrice/src/client/tabs/tab_replays.cpp index 6512381e3..fb1375f52 100644 --- a/cockatrice/src/client/tabs/tab_replays.cpp +++ b/cockatrice/src/client/tabs/tab_replays.cpp @@ -131,6 +131,13 @@ void TabReplays::retranslateUi() aDeleteRemoteReplay->setText(tr("Delete")); } +void TabReplays::actLocalDoubleClick(const QModelIndex &curLeft) +{ + if (!localDirModel->isDir(curLeft)) { + actOpenLocalReplay(); + } +} + void TabReplays::actOpenLocalReplay() { QModelIndexList curLefts = localDirView->selectionModel()->selectedRows(); @@ -192,6 +199,13 @@ void TabReplays::actDeleteLocalReplay() } } +void TabReplays::actRemoteDoubleClick(const QModelIndex &curRight) +{ + if (serverDirView->getReplay(curRight)) { + actOpenRemoteReplay(); + } +} + void TabReplays::actOpenRemoteReplay() { auto const curRights = serverDirView->getSelectedReplays(); diff --git a/cockatrice/src/client/tabs/tab_replays.h b/cockatrice/src/client/tabs/tab_replays.h index 7e879719f..3f127613b 100644 --- a/cockatrice/src/client/tabs/tab_replays.h +++ b/cockatrice/src/client/tabs/tab_replays.h @@ -28,10 +28,12 @@ private: QAction *aOpenLocalReplay, *aNewLocalFolder, *aDeleteLocalReplay; QAction *aOpenRemoteReplay, *aDownload, *aKeep, *aDeleteRemoteReplay; private slots: + void actLocalDoubleClick(const QModelIndex &curLeft); void actOpenLocalReplay(); void actNewLocalFolder(); void actDeleteLocalReplay(); + void actRemoteDoubleClick(const QModelIndex &curLeft); void actOpenRemoteReplay(); void openRemoteReplayFinished(const Response &r);