Qt: Fix 'Boot and Debug' menu option

This commit is contained in:
Stenzek 2024-09-06 17:45:59 +10:00
parent 845e97a576
commit bc2e793baa
No known key found for this signature in database
3 changed files with 9 additions and 10 deletions

View File

@ -42,9 +42,9 @@ p, li { white-space: pre-wrap; }
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%3 <a href="https://icons8.com/icon/74847/platforms.undefined.short-title"><span style=" text-decoration: underline; color:#0057ae;">icons8</span></a></p>
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://github.com/stenzek/duckstation/blob/master/LICENSE"><span style=" text-decoration: underline; color:#0057ae;">%4</span></a> | <a href="https://github.com/stenzek/duckstation"><span style=" text-decoration: underline; color:#0057ae;">GitHub</span></a> | <a href="https://www.duckstation.org/discord.html"><span style=" text-decoration: underline; color:#0057ae;">Discord</span></a></p></body></html>
)")
.arg(tr("DuckStation is a free and open-source simulator/emulator of the Sony "
"PlayStation<span style=\"vertical-align:super;\">TM</span> console, focusing on "
"playability, speed, and long-term maintainability."))
.arg(tr("DuckStation is a free simulator/emulator of the Sony PlayStation<span "
"style=\"vertical-align:super;\">TM</span> console, focusing on playability, "
"speed, and long-term maintainability."))
.arg(tr("Authors"))
.arg(tr("Icon by"))
.arg(tr("License")));

View File

@ -1536,7 +1536,7 @@ void MainWindow::onGameListEntryContextMenuRequested(const QPoint& point)
if (m_ui.menuDebug->menuAction()->isVisible() && !Achievements::IsHardcoreModeActive())
{
connect(menu.addAction(tr("Boot and Debug")), &QAction::triggered, [this, entry]() {
m_open_debugger_on_start = true;
openCPUDebugger();
std::shared_ptr<SystemBootParameters> boot_params = getSystemBootParameters(entry->path);
boot_params->override_start_paused = true;
@ -1857,11 +1857,6 @@ void MainWindow::updateEmulationActions(bool starting, bool running, bool cheevo
m_ui.actionViewGameProperties->setEnabled(false);
}
if (m_open_debugger_on_start && running)
openCPUDebugger();
if ((!starting && !running) || running)
m_open_debugger_on_start = false;
m_ui.statusBar->clearMessage();
}
@ -2855,6 +2850,11 @@ void MainWindow::openCPUDebugger()
m_debugger_window->deleteLater();
m_debugger_window = nullptr;
});
// Position the debugger window to the right of the main/display window.
const QWidget* next_to_widget =
m_display_container ? static_cast<const QWidget*>(m_display_container) : static_cast<const QWidget*>(this);
m_debugger_window->move(next_to_widget->pos() + QPoint(next_to_widget->width() + 16, 0));
}
QtUtils::ShowOrRaiseWindow(m_debugger_window);

View File

@ -304,7 +304,6 @@ private:
MemoryScannerWindow* m_memory_scanner_window = nullptr;
bool m_was_paused_by_focus_loss = false;
bool m_open_debugger_on_start = false;
bool m_relative_mouse_mode = false;
bool m_hide_mouse_cursor = false;