mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-18 06:25:37 +00:00
Qt: Add screenshot button
This commit is contained in:
parent
ffb760c79d
commit
282998d0bb
|
@ -378,6 +378,7 @@ void MainWindow::updateEmulationActions(bool starting, bool running)
|
||||||
m_ui.actionReset->setDisabled(starting || !running);
|
m_ui.actionReset->setDisabled(starting || !running);
|
||||||
m_ui.actionPause->setDisabled(starting || !running);
|
m_ui.actionPause->setDisabled(starting || !running);
|
||||||
m_ui.actionChangeDisc->setDisabled(starting || !running);
|
m_ui.actionChangeDisc->setDisabled(starting || !running);
|
||||||
|
m_ui.actionScreenshot->setDisabled(starting || !running);
|
||||||
m_ui.menuChangeDisc->setDisabled(starting || !running);
|
m_ui.menuChangeDisc->setDisabled(starting || !running);
|
||||||
|
|
||||||
m_ui.actionSaveState->setDisabled(starting || !running);
|
m_ui.actionSaveState->setDisabled(starting || !running);
|
||||||
|
@ -434,6 +435,7 @@ void MainWindow::connectSignals()
|
||||||
connect(m_ui.actionPowerOff, &QAction::triggered, m_host_interface, &QtHostInterface::powerOffSystem);
|
connect(m_ui.actionPowerOff, &QAction::triggered, m_host_interface, &QtHostInterface::powerOffSystem);
|
||||||
connect(m_ui.actionReset, &QAction::triggered, m_host_interface, &QtHostInterface::resetSystem);
|
connect(m_ui.actionReset, &QAction::triggered, m_host_interface, &QtHostInterface::resetSystem);
|
||||||
connect(m_ui.actionPause, &QAction::toggled, m_host_interface, &QtHostInterface::pauseSystem);
|
connect(m_ui.actionPause, &QAction::toggled, m_host_interface, &QtHostInterface::pauseSystem);
|
||||||
|
connect(m_ui.actionScreenshot, &QAction::triggered, m_host_interface, &QtHostInterface::saveScreenshot);
|
||||||
connect(m_ui.actionLoadState, &QAction::triggered, this, [this]() { m_ui.menuLoadState->exec(QCursor::pos()); });
|
connect(m_ui.actionLoadState, &QAction::triggered, this, [this]() { m_ui.menuLoadState->exec(QCursor::pos()); });
|
||||||
connect(m_ui.actionSaveState, &QAction::triggered, this, [this]() { m_ui.menuSaveState->exec(QCursor::pos()); });
|
connect(m_ui.actionSaveState, &QAction::triggered, this, [this]() { m_ui.menuSaveState->exec(QCursor::pos()); });
|
||||||
connect(m_ui.actionExit, &QAction::triggered, this, &MainWindow::close);
|
connect(m_ui.actionExit, &QAction::triggered, this, &MainWindow::close);
|
||||||
|
|
|
@ -163,6 +163,7 @@
|
||||||
<addaction name="actionReset"/>
|
<addaction name="actionReset"/>
|
||||||
<addaction name="actionPause"/>
|
<addaction name="actionPause"/>
|
||||||
<addaction name="actionChangeDisc"/>
|
<addaction name="actionChangeDisc"/>
|
||||||
|
<addaction name="actionScreenshot"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="actionLoadState"/>
|
<addaction name="actionLoadState"/>
|
||||||
<addaction name="actionSaveState"/>
|
<addaction name="actionSaveState"/>
|
||||||
|
@ -444,6 +445,15 @@
|
||||||
<string>Show MDEC State</string>
|
<string>Show MDEC State</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionScreenshot">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="resources/icons.qrc">
|
||||||
|
<normaloff>:/icons/video-display.png</normaloff>:/icons/video-display.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&Screenshot</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="resources/icons.qrc"/>
|
<include location="resources/icons.qrc"/>
|
||||||
|
|
|
@ -588,6 +588,17 @@ void QtHostInterface::stopDumpingAudio()
|
||||||
StopDumpingAudio();
|
StopDumpingAudio();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QtHostInterface::saveScreenshot()
|
||||||
|
{
|
||||||
|
if (!isOnWorkerThread())
|
||||||
|
{
|
||||||
|
QMetaObject::invokeMethod(this, "saveScreenshot");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SaveScreenshot(nullptr, true, true);
|
||||||
|
}
|
||||||
|
|
||||||
void QtHostInterface::enableBackgroundControllerPolling()
|
void QtHostInterface::enableBackgroundControllerPolling()
|
||||||
{
|
{
|
||||||
if (!isOnWorkerThread())
|
if (!isOnWorkerThread())
|
||||||
|
|
|
@ -97,6 +97,7 @@ public Q_SLOTS:
|
||||||
void saveState(bool global, qint32 slot, bool block_until_done = false);
|
void saveState(bool global, qint32 slot, bool block_until_done = false);
|
||||||
void startDumpingAudio();
|
void startDumpingAudio();
|
||||||
void stopDumpingAudio();
|
void stopDumpingAudio();
|
||||||
|
void saveScreenshot();
|
||||||
|
|
||||||
/// Enables controller polling even without a system active. Must be matched by a call to
|
/// Enables controller polling even without a system active. Must be matched by a call to
|
||||||
/// disableBackgroundControllerPolling.
|
/// disableBackgroundControllerPolling.
|
||||||
|
|
Loading…
Reference in a new issue