summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/debugger/qt/dasmwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/modules/debugger/qt/dasmwindow.cpp')
-rw-r--r--src/osd/modules/debugger/qt/dasmwindow.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/osd/modules/debugger/qt/dasmwindow.cpp b/src/osd/modules/debugger/qt/dasmwindow.cpp
index 79167169c1b..dd7677516eb 100644
--- a/src/osd/modules/debugger/qt/dasmwindow.cpp
+++ b/src/osd/modules/debugger/qt/dasmwindow.cpp
@@ -17,6 +17,8 @@
#include <QtWidgets/QMenuBar>
+namespace osd::debugger::qt {
+
DasmWindow::DasmWindow(running_machine &machine, QWidget *parent) :
WindowQt(machine, nullptr)
{
@@ -92,6 +94,9 @@ DasmWindow::DasmWindow(running_machine &machine, QWidget *parent) :
QAction *rightActRaw = new QAction("Raw Opcodes", this);
QAction *rightActEncrypted = new QAction("Encrypted Opcodes", this);
QAction *rightActComments = new QAction("Comments", this);
+ rightActRaw->setData(int(DASM_RIGHTCOL_RAW));
+ rightActEncrypted->setData(int(DASM_RIGHTCOL_ENCRYPTED));
+ rightActComments->setData(int(DASM_RIGHTCOL_COMMENTS));
rightActRaw->setCheckable(true);
rightActEncrypted->setCheckable(true);
rightActComments->setCheckable(true);
@@ -123,12 +128,12 @@ void DasmWindow::saveConfigurationToNode(util::xml::data_node &node)
{
WindowQt::saveConfigurationToNode(node);
- node.set_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, osd::debugger::WINDOW_TYPE_DISASSEMBLY_VIEWER);
+ node.set_attribute_int(ATTR_WINDOW_TYPE, WINDOW_TYPE_DISASSEMBLY_VIEWER);
debug_view_disasm &dasmview = *m_dasmView->view<debug_view_disasm>();
- node.set_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_CPU, m_dasmView->sourceIndex());
- node.set_attribute_int(osd::debugger::ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, dasmview.right_column());
- node.add_child(osd::debugger::NODE_WINDOW_EXPRESSION, dasmview.expression());
+ node.set_attribute_int(ATTR_WINDOW_DISASSEMBLY_CPU, m_dasmView->sourceIndex());
+ node.set_attribute_int(ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, dasmview.right_column());
+ node.add_child(NODE_WINDOW_EXPRESSION, dasmview.expression());
}
@@ -217,19 +222,8 @@ void DasmWindow::runToCursor(bool changedTo)
void DasmWindow::rightBarChanged(QAction* changedTo)
{
- debug_view_disasm* dasmView = m_dasmView->view<debug_view_disasm>();
- if (changedTo->text() == "Raw Opcodes")
- {
- dasmView->set_right_column(DASM_RIGHTCOL_RAW);
- }
- else if (changedTo->text() == "Encrypted Opcodes")
- {
- dasmView->set_right_column(DASM_RIGHTCOL_ENCRYPTED);
- }
- else if (changedTo->text() == "Comments")
- {
- dasmView->set_right_column(DASM_RIGHTCOL_COMMENTS);
- }
+ debug_view_disasm *const dasmView = m_dasmView->view<debug_view_disasm>();
+ dasmView->set_right_column(disasm_right_column(changedTo->data().toInt()));
m_dasmView->viewport()->update();
}
@@ -302,16 +296,22 @@ void DasmWindowQtConfig::applyToQWidget(QWidget *widget)
QComboBox *cpu = window->findChild<QComboBox *>("cpu");
cpu->setCurrentIndex(m_cpu);
- if ((DASM_RIGHTCOL_RAW <= m_rightBar) && (DASM_RIGHTCOL_COMMENTS >= m_rightBar))
+ QActionGroup *const rightBarGroup = window->findChild<QActionGroup *>("rightbargroup");
+ for (QAction *action : rightBarGroup->actions())
{
- QActionGroup *rightBarGroup = window->findChild<QActionGroup *>("rightbargroup");
- rightBarGroup->actions()[m_rightBar - 1]->trigger();
+ if (action->data().toInt() == m_rightBar)
+ {
+ action->trigger();
+ break;
+ }
}
}
void DasmWindowQtConfig::recoverFromXmlNode(util::xml::data_node const &node)
{
WindowQtConfig::recoverFromXmlNode(node);
- 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);
+ m_cpu = node.get_attribute_int(ATTR_WINDOW_DISASSEMBLY_CPU, m_cpu);
+ m_rightBar = node.get_attribute_int(ATTR_WINDOW_DISASSEMBLY_RIGHT_COLUMN, m_rightBar);
}
+
+} // namespace osd::debugger::qt