summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/debugger/qt/dasmwindow.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2022-09-16 22:09:58 +1000
committer Vas Crabb <vas@vastheman.com>2022-09-16 22:23:34 +1000
commitc76cf754b3cb1a07f8d3ca585bb3a055d78f25be (patch)
tree833fa7b23f8a84a79fd052008a6ad7c3847b46da /src/osd/modules/debugger/qt/dasmwindow.cpp
parent1aae44005b59aa712fb60f639ddbb9e8e5e7a357 (diff)
debugger/win: Added capability to save/restore window arrangement.
* Format is mostly compatible with the Cocoa debugger, besides reversed vertical positioning. * Made Qt debugger more compatible with configuration format used by Win32 and Cocoa debuggers. * emu/config.cpp: Preserve elements with no registered handlers in default and system configuation files.
Diffstat (limited to 'src/osd/modules/debugger/qt/dasmwindow.cpp')
-rw-r--r--src/osd/modules/debugger/qt/dasmwindow.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/osd/modules/debugger/qt/dasmwindow.cpp b/src/osd/modules/debugger/qt/dasmwindow.cpp
index 21e2520d712..d46ceb2d767 100644
--- a/src/osd/modules/debugger/qt/dasmwindow.cpp
+++ b/src/osd/modules/debugger/qt/dasmwindow.cpp
@@ -8,6 +8,8 @@
#include "debug/dvdisasm.h"
#include "debug/points.h"
+#include "util/xmlfile.h"
+
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QVBoxLayout>
#include <QtWidgets/QAction>
@@ -288,11 +290,11 @@ void DasmWindowQtConfig::buildFromQWidget(QWidget *widget)
QActionGroup *rightBarGroup = window->findChild<QActionGroup *>("rightbargroup");
if (rightBarGroup->checkedAction()->text() == "Raw Opcodes")
- m_rightBar = 0;
+ m_rightBar = DASM_RIGHTCOL_RAW;
else if (rightBarGroup->checkedAction()->text() == "Encrypted Opcodes")
- m_rightBar = 1;
+ m_rightBar = DASM_RIGHTCOL_ENCRYPTED;
else if (rightBarGroup->checkedAction()->text() == "Comments")
- m_rightBar = 2;
+ m_rightBar = DASM_RIGHTCOL_COMMENTS;
}
void DasmWindowQtConfig::applyToQWidget(QWidget *widget)
@@ -302,20 +304,23 @@ void DasmWindowQtConfig::applyToQWidget(QWidget *widget)
QComboBox *cpu = window->findChild<QComboBox *>("cpu");
cpu->setCurrentIndex(m_cpu);
- QActionGroup *rightBarGroup = window->findChild<QActionGroup *>("rightbargroup");
- rightBarGroup->actions()[m_rightBar]->trigger();
+ if ((DASM_RIGHTCOL_RAW <= m_rightBar) && (DASM_RIGHTCOL_COMMENTS >= m_rightBar))
+ {
+ QActionGroup *rightBarGroup = window->findChild<QActionGroup *>("rightbargroup");
+ rightBarGroup->actions()[m_rightBar - 1]->trigger();
+ }
}
void DasmWindowQtConfig::addToXmlDataNode(util::xml::data_node &node) const
{
WindowQtConfig::addToXmlDataNode(node);
- node.set_attribute_int("cpu", m_cpu);
- node.set_attribute_int("rightbar", m_rightBar);
+ node.set_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_CPU, m_cpu);
+ node.set_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, m_rightBar);
}
void DasmWindowQtConfig::recoverFromXmlNode(util::xml::data_node const &node)
{
WindowQtConfig::recoverFromXmlNode(node);
- m_cpu = node.get_attribute_int("cpu", m_cpu);
- m_rightBar = node.get_attribute_int("rightbar", m_rightBar);
+ m_cpu = node.get_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_CPU, m_cpu);
+ m_rightBar = node.get_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, m_rightBar);
}