trunk/src/osd/sdl/debugqtwindow.c
r21969 | r21970 | |
12 | 12 | bool WindowQt::s_hideAll = false; |
13 | 13 | |
14 | 14 | |
| 15 | // Since all debug windows are intended to be top-level, this inherited |
| 16 | // constructor is always called with a NULL parent. The passed-in parent widget, |
| 17 | // however, is often used to place each child window & the code to do this can |
| 18 | // be found in most of the inherited classes. |
| 19 | |
15 | 20 | WindowQt::WindowQt(running_machine* machine, QWidget* parent) : |
16 | 21 | QMainWindow(parent), |
17 | 22 | m_machine(machine) |
18 | 23 | { |
19 | | //setAttribute(Qt::WA_DeleteOnClose, true); |
| 24 | setAttribute(Qt::WA_DeleteOnClose, true); |
20 | 25 | |
21 | 26 | // The Debug menu bar |
22 | 27 | QAction* debugActOpenMemory = new QAction("New &Memory Window", this); |
trunk/src/osd/sdl/debugqtmemorywindow.c
r21969 | r21970 | |
6 | 6 | |
7 | 7 | |
8 | 8 | MemoryWindow::MemoryWindow(running_machine* machine, QWidget* parent) : |
9 | | WindowQt(machine, parent) |
| 9 | WindowQt(machine, NULL) |
10 | 10 | { |
11 | 11 | setWindowTitle("Debug: Memory View"); |
12 | 12 | |
r21969 | r21970 | |
41 | 41 | // Populate the combo box |
42 | 42 | populateComboBox(); |
43 | 43 | |
| 44 | // Set to the current CPU's memory view |
| 45 | setToCurrentCpu(); |
44 | 46 | |
45 | 47 | // Layout |
46 | 48 | QHBoxLayout* subLayout = new QHBoxLayout(topSubFrame); |
r21969 | r21970 | |
212 | 214 | { |
213 | 215 | m_memoryComboBox->addItem(source->name()); |
214 | 216 | } |
| 217 | } |
215 | 218 | |
216 | | // TODO: Set to the proper memory view |
217 | | //const debug_view_source *source = mem->views[0]->view->source_list().match_device(curcpu); |
218 | | //gtk_combo_box_set_active(zone_w, mem->views[0]->view->source_list().index(*source)); |
219 | | //mem->views[0]->view->set_source(*source); |
| 219 | |
| 220 | void MemoryWindow::setToCurrentCpu() |
| 221 | { |
| 222 | device_t* curCpu = debug_cpu_get_visible_cpu(*m_machine); |
| 223 | const debug_view_source *source = m_memTable->view()->source_list().match_device(curCpu); |
| 224 | const int listIndex = m_memTable->view()->source_list().index(*source); |
| 225 | m_memoryComboBox->setCurrentIndex(listIndex); |
220 | 226 | } |