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