2a29a4098b09a7a5cb0ead3bb0bb2bede6f988fd
[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 #include "debuggertab.h"
14 #include "settings.h"
15
16
17 DebuggerTab::DebuggerTab(QWidget * parent/*= 0*/): QWidget(parent)
18 {
19 QLabel * label3 = new QLabel("Disassembly lines:");
20 edit3 = new QLineEdit("");
21 edit3->setPlaceholderText("Number of disassembly lines");
22 QVBoxLayout * layout1 = new QVBoxLayout;
23 layout1->addWidget(label3);
24
25 QVBoxLayout * layout2 = new QVBoxLayout;
26 layout2->addWidget(edit3);
27
28 QHBoxLayout * layout3 = new QHBoxLayout;
29 layout3->addLayout(layout1);
30 layout3->addLayout(layout2);
31
32 QVBoxLayout * layout4 = new QVBoxLayout;
33 layout4->addLayout(layout3);
34
35 // Checkboxes...
36 displayHWlabels = new QCheckBox(tr("Display HW labels"));
37 disasmopcodes = new QCheckBox(tr("Display M68000 opcodes"));
38 displayFullSourceFilename = new QCheckBox(tr("Display source filename"));
39 disasmopcodes->setDisabled(false);
40 displayHWlabels->setDisabled(false);
41 displayFullSourceFilename->setDisabled(false);
42
43 layout4->addWidget(disasmopcodes);
44 layout4->addWidget(displayHWlabels);
45 layout4->addWidget(displayFullSourceFilename);
46
47 setLayout(layout4);
48 }
49
50
51 DebuggerTab::~DebuggerTab()
52 {
53 }
54
55
56 // Save / Update the settings from the tabs dialog
57 void DebuggerTab::SetSettings(void)
58 {
59 bool ok;
60
61 //strcpy(vjs.debuggerROMPath, debuggerTab->edit1->text().toUtf8().data());
62 //strcpy(vjs.absROMPath, debuggerTab->edit2->text().toUtf8().data());
63 vjs.nbrdisasmlines = edit3->text().toUInt(&ok, 10);
64 //vjs.allowWritesToROM = debuggerTab->writeROM->isChecked();
65 vjs.displayHWlabels = displayHWlabels->isChecked();
66 vjs.disasmopcodes = disasmopcodes->isChecked();
67 vjs.displayFullSourceFilename = displayFullSourceFilename->isChecked();
68 }
69
70
71 // Load / Update the tabs dialog from the settings
72 void DebuggerTab::GetSettings(void)
73 {
74 QVariant v(vjs.nbrdisasmlines);
75 //debuggerTab->edit1->setText(vjs.debuggerROMPath);
76 //debuggerTab->edit2->setText(vjs.absROMPath);
77 edit3->setText(v.toString());
78 //debuggerTab->writeROM->setChecked(vjs.allowWritesToROM
79 displayHWlabels->setChecked(vjs.displayHWlabels);
80 disasmopcodes->setChecked(vjs.disasmopcodes);
81 displayFullSourceFilename->setChecked(vjs.displayFullSourceFilename);
82 }
83