MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / resetLayoutClicked

Method resetLayoutClicked

pcsx2-qt/Debugger/Docking/DockManager.cpp:639–670  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

637}
638
639void DockManager::resetLayoutClicked(DockLayout::Index layout_index)
640{
641 if (layout_index >= m_layouts.size())
642 return;
643
644 DockLayout& layout = m_layouts[layout_index];
645 if (!layout.canReset())
646 return;
647
648 const QString title = tr("Confirmation");
649 const QString text = tr("Are you sure you want to reset layout '%1'?").arg(layout.name());
650
651 AsyncDialogs::question(g_debugger_window, title, text, [this, layout_index]() {
652 if (layout_index >= m_layouts.size())
653 return;
654
655 DockLayout& layout = m_layouts[layout_index];
656 if (!layout.canReset())
657 return;
658
659 bool current_layout = layout_index == m_current_layout;
660
661 if (current_layout)
662 switchToLayout(DockLayout::INVALID_INDEX);
663
664 layout.reset();
665 layout.save(layout_index);
666
667 if (current_layout)
668 switchToLayout(layout_index);
669 });
670}
671
672void DockManager::deleteLayoutClicked(DockLayout::Index layout_index)
673{

Callers

nothing calls this directly

Calls 6

canResetMethod · 0.80
argMethod · 0.80
sizeMethod · 0.45
nameMethod · 0.45
resetMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected