From b2ac7afbcb9ad98efee1031e08c7cd9d911354cc Mon Sep 17 00:00:00 2001 From: KamFretoZ <14798312+kamfretoz@users.noreply.github.com> Date: Fri, 19 Jul 2024 22:42:42 +0700 Subject: [PATCH] Qt: Add Video Capture button to toolbar --- pcsx2-qt/MainWindow.cpp | 24 +++++++++---------- pcsx2-qt/MainWindow.h | 2 +- pcsx2-qt/MainWindow.ui | 10 ++++++-- .../icons/black/svg/camera-video.svg | 7 ++++++ .../icons/white/svg/camera-video.svg | 7 ++++++ pcsx2-qt/resources/resources.qrc | 6 +++-- 6 files changed, 39 insertions(+), 17 deletions(-) create mode 100644 pcsx2-qt/resources/icons/black/svg/camera-video.svg create mode 100644 pcsx2-qt/resources/icons/white/svg/camera-video.svg diff --git a/pcsx2-qt/MainWindow.cpp b/pcsx2-qt/MainWindow.cpp index 3e5d9b4d4f..4e2c2c3f35 100644 --- a/pcsx2-qt/MainWindow.cpp +++ b/pcsx2-qt/MainWindow.cpp @@ -396,7 +396,7 @@ void MainWindow::connectSignals() connect(m_ui.actionSaveBlockDump, &QAction::toggled, this, &MainWindow::onBlockDumpActionToggled); connect(m_ui.actionShowAdvancedSettings, &QAction::toggled, this, &MainWindow::onShowAdvancedSettingsToggled); connect(m_ui.actionSaveGSDump, &QAction::triggered, this, &MainWindow::onSaveGSDumpActionTriggered); - connect(m_ui.actionToolsVideoCapture, &QAction::toggled, this, &MainWindow::onToolsVideoCaptureToggled); + connect(m_ui.actionVideoCapture, &QAction::toggled, this, &MainWindow::onVideoCaptureToggled); connect(m_ui.actionEditPatches, &QAction::triggered, this, [this]() { onToolsEditCheatsPatchesTriggered(false); }); connect(m_ui.actionEditCheats, &QAction::triggered, this, [this]() { onToolsEditCheatsPatchesTriggered(true); }); @@ -712,14 +712,14 @@ void MainWindow::updateAdvancedSettingsVisibility() m_ui.actionEnableVerboseLogging->setVisible(enabled); } -void MainWindow::onToolsVideoCaptureToggled(bool checked) +void MainWindow::onVideoCaptureToggled(bool checked) { if (!s_vm_valid) return; // Reset the checked state, we'll get updated by the GS thread. - QSignalBlocker sb(m_ui.actionToolsVideoCapture); - m_ui.actionToolsVideoCapture->setChecked(!checked); + QSignalBlocker sb(m_ui.actionVideoCapture); + m_ui.actionVideoCapture->setChecked(!checked); if (!checked) { @@ -744,8 +744,8 @@ void MainWindow::onCaptureStarted(const QString& filename) if (!s_vm_valid) return; - QSignalBlocker sb(m_ui.actionToolsVideoCapture); - m_ui.actionToolsVideoCapture->setChecked(true); + QSignalBlocker sb(m_ui.actionVideoCapture); + m_ui.actionVideoCapture->setChecked(true); } void MainWindow::onCaptureStopped() @@ -753,8 +753,8 @@ void MainWindow::onCaptureStopped() if (!s_vm_valid) return; - QSignalBlocker sb(m_ui.actionToolsVideoCapture); - m_ui.actionToolsVideoCapture->setChecked(false); + QSignalBlocker sb(m_ui.actionVideoCapture); + m_ui.actionVideoCapture->setChecked(false); } void MainWindow::onAchievementsLoginRequested(Achievements::LoginRequestReason reason) @@ -880,11 +880,11 @@ void MainWindow::updateEmulationActions(bool starting, bool running, bool stoppi m_ui.actionViewGameProperties->setEnabled(running); - m_ui.actionToolsVideoCapture->setEnabled(running); - if (!running && m_ui.actionToolsVideoCapture->isChecked()) + m_ui.actionVideoCapture->setEnabled(running); + if (!running && m_ui.actionVideoCapture->isChecked()) { - QSignalBlocker sb(m_ui.actionToolsVideoCapture); - m_ui.actionToolsVideoCapture->setChecked(false); + QSignalBlocker sb(m_ui.actionVideoCapture); + m_ui.actionVideoCapture->setChecked(false); } m_game_list_widget->setDisabled(starting && !running); diff --git a/pcsx2-qt/MainWindow.h b/pcsx2-qt/MainWindow.h index 9baf1382a6..07654c2c60 100644 --- a/pcsx2-qt/MainWindow.h +++ b/pcsx2-qt/MainWindow.h @@ -171,7 +171,7 @@ private Q_SLOTS: void onSaveGSDumpActionTriggered(); void onBlockDumpActionToggled(bool checked); void onShowAdvancedSettingsToggled(bool checked); - void onToolsVideoCaptureToggled(bool checked); + void onVideoCaptureToggled(bool checked); void onSettingsTriggeredFromToolbar(); // Input Recording diff --git a/pcsx2-qt/MainWindow.ui b/pcsx2-qt/MainWindow.ui index 82043e4ff4..850aa437bb 100644 --- a/pcsx2-qt/MainWindow.ui +++ b/pcsx2-qt/MainWindow.ui @@ -210,7 +210,7 @@ - + @@ -260,7 +260,9 @@ + + @@ -1080,13 +1082,17 @@ Recording Viewer - + true Video Capture + + + .. + diff --git a/pcsx2-qt/resources/icons/black/svg/camera-video.svg b/pcsx2-qt/resources/icons/black/svg/camera-video.svg new file mode 100644 index 0000000000..a942cff734 --- /dev/null +++ b/pcsx2-qt/resources/icons/black/svg/camera-video.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/pcsx2-qt/resources/icons/white/svg/camera-video.svg b/pcsx2-qt/resources/icons/white/svg/camera-video.svg new file mode 100644 index 0000000000..98f30ec33c --- /dev/null +++ b/pcsx2-qt/resources/icons/white/svg/camera-video.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/pcsx2-qt/resources/resources.qrc b/pcsx2-qt/resources/resources.qrc index b0721870af..d94bd0004c 100644 --- a/pcsx2-qt/resources/resources.qrc +++ b/pcsx2-qt/resources/resources.qrc @@ -9,16 +9,17 @@ icons/black/svg/band-aid-line.svg icons/black/svg/brush-line.svg icons/black/svg/buzz-controller-line.svg + icons/black/svg/camera-video.svg icons/black/svg/cheats-line.svg icons/black/svg/checkbox-multiple-blank-line.svg icons/black/svg/chip-line.svg icons/black/svg/close-line.svg icons/black/svg/controller-line.svg icons/black/svg/controller-strike-line.svg + icons/black/svg/debugger-line.svg icons/black/svg/debug-step-into-line.svg icons/black/svg/debug-step-out-line.svg icons/black/svg/debug-step-over-line.svg - icons/black/svg/debugger-line.svg icons/black/svg/delete-back-2-line.svg icons/black/svg/disc-2-line.svg icons/black/svg/disc-eject-line.svg @@ -105,16 +106,17 @@ icons/white/svg/band-aid-line.svg icons/white/svg/brush-line.svg icons/white/svg/buzz-controller-line.svg + icons/white/svg/camera-video.svg icons/white/svg/cheats-line.svg icons/white/svg/checkbox-multiple-blank-line.svg icons/white/svg/chip-line.svg icons/white/svg/close-line.svg icons/white/svg/controller-line.svg icons/white/svg/controller-strike-line.svg + icons/white/svg/debugger-line.svg icons/white/svg/debug-step-into-line.svg icons/white/svg/debug-step-out-line.svg icons/white/svg/debug-step-over-line.svg - icons/white/svg/debugger-line.svg icons/white/svg/delete-back-2-line.svg icons/white/svg/disc-2-line.svg icons/white/svg/disc-eject-line.svg