Merge branch 'master' of https://github.com/djipi/Virtual-Jaguar-Rx
[clinton/Virtual-Jaguar-Rx.git] / src / debugger / debuggertab.cpp
CommitLineData
024bfc46
JPM
1//\r
2// debuggertab.cpp: "Debugger" tab on the settings dialog\r
3//\r
4// by Jean-Paul Mari\r
5//\r
6// JPM = Jean-Paul Mari <djipi.mari@gmail.com>\r
7//\r
8// WHO WHEN WHAT\r
9// --- ---------- ------------------------------------------------------------\r
10// JPM 06/19/2016 Created this file\r
11// JPM 06/19/2016 Soft debugger support\r
12\r
13#include "debuggertab.h"\r
14#include "settings.h"\r
15\r
16\r
17DebuggerTab::DebuggerTab(QWidget * parent/*= 0*/): QWidget(parent)\r
18{\r
19 QLabel * label3 = new QLabel("Disassembly lines:");\r
20 edit3 = new QLineEdit("");\r
21 edit3->setPlaceholderText("Number of disassembly lines");\r
22 QVBoxLayout * layout1 = new QVBoxLayout;\r
23 layout1->addWidget(label3);\r
24\r
25 QVBoxLayout * layout2 = new QVBoxLayout;\r
26 layout2->addWidget(edit3);\r
27\r
28 QHBoxLayout * layout3 = new QHBoxLayout;\r
29 layout3->addLayout(layout1);\r
30 layout3->addLayout(layout2);\r
31\r
32 QVBoxLayout * layout4 = new QVBoxLayout;\r
33 layout4->addLayout(layout3);\r
34\r
35 // Checkboxes...\r
36 displayHWlabels = new QCheckBox(tr("Display HW labels"));\r
37 disasmopcodes = new QCheckBox(tr("Display M68000 opcodes"));\r
38 displayFullSourceFilename = new QCheckBox(tr("Display source filename"));\r
39 disasmopcodes->setDisabled(false);\r
40 displayHWlabels->setDisabled(false);\r
41 displayFullSourceFilename->setDisabled(false);\r
42\r
43 layout4->addWidget(disasmopcodes);\r
44 layout4->addWidget(displayHWlabels);\r
45 layout4->addWidget(displayFullSourceFilename);\r
46\r
47 setLayout(layout4);\r
48}\r
49\r
50\r
51DebuggerTab::~DebuggerTab()\r
52{\r
53}\r
54\r
55\r
2d0121d4
JPM
56// Save / Update the settings from the tabs dialog\r
57void DebuggerTab::SetSettings(void)\r
58{\r
59 bool ok;\r
60\r
61 //strcpy(vjs.debuggerROMPath, debuggerTab->edit1->text().toUtf8().data());\r
d9989fae 62 strcpy(vjs.debuggerROMPath, vjs.alpineROMPath);\r
2d0121d4
JPM
63 //strcpy(vjs.absROMPath, debuggerTab->edit2->text().toUtf8().data());\r
64 vjs.nbrdisasmlines = edit3->text().toUInt(&ok, 10);\r
65 //vjs.allowWritesToROM = debuggerTab->writeROM->isChecked();\r
66 vjs.displayHWlabels = displayHWlabels->isChecked();\r
67 vjs.disasmopcodes = disasmopcodes->isChecked();\r
68 vjs.displayFullSourceFilename = displayFullSourceFilename->isChecked();\r
69}\r
70\r
71\r
72// Load / Update the tabs dialog from the settings\r
73void DebuggerTab::GetSettings(void)\r
74{\r
75 QVariant v(vjs.nbrdisasmlines);\r
76 //debuggerTab->edit1->setText(vjs.debuggerROMPath);\r
77 //debuggerTab->edit2->setText(vjs.absROMPath);\r
78 edit3->setText(v.toString());\r
79 //debuggerTab->writeROM->setChecked(vjs.allowWritesToROM\r
80 displayHWlabels->setChecked(vjs.displayHWlabels);\r
81 disasmopcodes->setChecked(vjs.disasmopcodes);\r
82 displayFullSourceFilename->setChecked(vjs.displayFullSourceFilename);\r
83}\r
84\r