/** * @brief Compras::accionesBarra * @return */ QList< QActionGroup * > Compras::accionesBarra() { QList<QActionGroup *> lista; QActionGroup *compras = new QActionGroup( this ); compras->setObjectName( "compras" ); compras->setProperty( "icono", ":/imagenes/compras.png" ); compras->setProperty( "titulo", "Compras y Gastos" ); compras->addAction( ActAgregarCompra ); lista.append( compras ); return lista; }
/*! \fn presupuesto::accionesBarra() Devuelve la lista de acciones que deben ir en cada una de las barras laterales en sus repectivos grupos @return QList<QActionGroup *> Lista */ QList<QActionGroup *> presupuesto::accionesBarra() { QList<QActionGroup *> lista; QActionGroup *presupuestos = new QActionGroup( this ); presupuestos->setObjectName( "presupuestos" ); presupuestos->setProperty( "titulo", "Presupuestos" ); presupuestos->setProperty( "icono", ":/imagenes/presupuesto.png" ); presupuestos->addAction( ActNuevoPresu ); presupuestos->addAction( ActPresuAnteriores ); lista.append( presupuestos ); return lista; }
/*! \fn productos::accionesBarra() */ QList<QActionGroup *> productos::accionesBarra() { QList<QActionGroup *> lista; QActionGroup *ventas = new QActionGroup( this ); ventas->setObjectName( "ventas" ); ventas->setProperty( "icono", ":/imagenes/ventas.jpg" ); ventas->setProperty( "titulo", "Ventas" ); ventas->addAction( ActProductos ); if( preferencias::getInstancia()->value( "Preferencias/Productos/categorias" ).toBool() ) { ventas->addAction( ActCategorias ); } lista.append( ventas ); return lista; }
/*! \fn Ventas::accionesBarra() */ QList<QActionGroup *> Ventas::accionesBarra() { QList<QActionGroup *> lista; ///////////////////////////////////////////////////////////// // Ventas QActionGroup *ventas = new QActionGroup( this ); ventas->setObjectName( "ventas" ); ventas->setProperty( "icono", ":/imagenes/ventas.jpg" ); ventas->setProperty( "titulo", "Ventas" ); ventas->addAction( ActAgregarVentas ); lista.append( ventas ); return lista; }
BreakpointsWindow::BreakpointsWindow(running_machine* machine, QWidget* parent) : WindowQt(machine, nullptr) { setWindowTitle("Debug: All Breakpoints"); if (parent != nullptr) { QPoint parentPos = parent->pos(); setGeometry(parentPos.x()+100, parentPos.y()+100, 800, 400); } // // The main frame and its input and breakpoints widgets // QFrame* mainWindowFrame = new QFrame(this); // The main breakpoints view m_breakpointsView = new DebuggerView(DVT_BREAK_POINTS, m_machine, this); // Layout QVBoxLayout* vLayout = new QVBoxLayout(mainWindowFrame); vLayout->setObjectName("vlayout"); vLayout->setSpacing(3); vLayout->setContentsMargins(2,2,2,2); vLayout->addWidget(m_breakpointsView); setCentralWidget(mainWindowFrame); // // Menu bars // QActionGroup* typeGroup = new QActionGroup(this); typeGroup->setObjectName("typegroup"); QAction* typeBreak = new QAction("Breakpoints", this); typeBreak->setObjectName("typebreak"); QAction* typeWatch = new QAction("Watchpoints", this); typeWatch->setObjectName("typewatch"); typeBreak->setCheckable(true); typeWatch->setCheckable(true); typeBreak->setActionGroup(typeGroup); typeWatch->setActionGroup(typeGroup); typeBreak->setShortcut(QKeySequence("Ctrl+1")); typeWatch->setShortcut(QKeySequence("Ctrl+2")); typeBreak->setChecked(true); connect(typeGroup, &QActionGroup::triggered, this, &BreakpointsWindow::typeChanged); // Assemble the options menu QMenu* optionsMenu = menuBar()->addMenu("&Options"); optionsMenu->addActions(typeGroup->actions()); }
MemoryWindow::MemoryWindow(running_machine* machine, QWidget* parent) : WindowQt(machine, nullptr) { setWindowTitle("Debug: Memory View"); if (parent != nullptr) { QPoint parentPos = parent->pos(); setGeometry(parentPos.x()+100, parentPos.y()+100, 800, 400); } // // The main frame and its input and log widgets // QFrame* mainWindowFrame = new QFrame(this); // The top frame & groupbox that contains the input widgets QFrame* topSubFrame = new QFrame(mainWindowFrame); // The input edit m_inputEdit = new QLineEdit(topSubFrame); connect(m_inputEdit, &QLineEdit::returnPressed, this, &MemoryWindow::expressionSubmitted); // The memory space combo box m_memoryComboBox = new QComboBox(topSubFrame); m_memoryComboBox->setObjectName("memoryregion"); m_memoryComboBox->setMinimumWidth(300); connect(m_memoryComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &MemoryWindow::memoryRegionChanged); // The main memory window m_memTable = new DebuggerMemView(DVT_MEMORY, m_machine, this); // Layout QHBoxLayout* subLayout = new QHBoxLayout(topSubFrame); subLayout->addWidget(m_inputEdit); subLayout->addWidget(m_memoryComboBox); subLayout->setSpacing(3); subLayout->setContentsMargins(2,2,2,2); QVBoxLayout* vLayout = new QVBoxLayout(mainWindowFrame); vLayout->setSpacing(3); vLayout->setContentsMargins(2,2,2,2); vLayout->addWidget(topSubFrame); vLayout->addWidget(m_memTable); setCentralWidget(mainWindowFrame); // // Menu bars // // Create a data format group QActionGroup* dataFormat = new QActionGroup(this); dataFormat->setObjectName("dataformat"); QAction* formatActOne = new QAction("1-byte chunks", this); QAction* formatActTwo = new QAction("2-byte chunks", this); QAction* formatActFour = new QAction("4-byte chunks", this); QAction* formatActEight = new QAction("8-byte chunks", this); QAction* formatAct32bitFloat = new QAction("32 bit floating point", this); QAction* formatAct64bitFloat = new QAction("64 bit floating point", this); QAction* formatAct80bitFloat = new QAction("80 bit floating point", this); formatActOne->setObjectName("formatActOne"); formatActTwo->setObjectName("formatActTwo"); formatActFour->setObjectName("formatActFour"); formatActEight->setObjectName("formatActEight"); formatAct32bitFloat->setObjectName("formatAct32bitFloat"); formatAct64bitFloat->setObjectName("formatAct64bitFloat"); formatAct80bitFloat->setObjectName("formatAct80bitFloat"); formatActOne->setCheckable(true); formatActTwo->setCheckable(true); formatActFour->setCheckable(true); formatActEight->setCheckable(true); formatAct32bitFloat->setCheckable(true); formatAct64bitFloat->setCheckable(true); formatAct80bitFloat->setCheckable(true); formatActOne->setActionGroup(dataFormat); formatActTwo->setActionGroup(dataFormat); formatActFour->setActionGroup(dataFormat); formatActEight->setActionGroup(dataFormat); formatAct32bitFloat->setActionGroup(dataFormat); formatAct64bitFloat->setActionGroup(dataFormat); formatAct80bitFloat->setActionGroup(dataFormat); formatActOne->setShortcut(QKeySequence("Ctrl+1")); formatActTwo->setShortcut(QKeySequence("Ctrl+2")); formatActFour->setShortcut(QKeySequence("Ctrl+4")); formatActEight->setShortcut(QKeySequence("Ctrl+8")); formatAct32bitFloat->setShortcut(QKeySequence("Ctrl+9")); formatActOne->setChecked(true); connect(dataFormat, &QActionGroup::triggered, this, &MemoryWindow::formatChanged); // Create a address display group QActionGroup* addressGroup = new QActionGroup(this); addressGroup->setObjectName("addressgroup"); QAction* addressActLogical = new QAction("Logical Addresses", this); QAction* addressActPhysical = new QAction("Physical Addresses", this); addressActLogical->setCheckable(true); addressActPhysical->setCheckable(true); addressActLogical->setActionGroup(addressGroup); addressActPhysical->setActionGroup(addressGroup); addressActLogical->setShortcut(QKeySequence("Ctrl+G")); addressActPhysical->setShortcut(QKeySequence("Ctrl+Y")); addressActLogical->setChecked(true); connect(addressGroup, &QActionGroup::triggered, this, &MemoryWindow::addressChanged); // Create a reverse view radio QAction* reverseAct = new QAction("Reverse View", this); reverseAct->setObjectName("reverse"); reverseAct->setCheckable(true); reverseAct->setShortcut(QKeySequence("Ctrl+R")); connect(reverseAct, &QAction::toggled, this, &MemoryWindow::reverseChanged); // Create increase and decrease bytes-per-line actions QAction* increaseBplAct = new QAction("Increase Bytes Per Line", this); QAction* decreaseBplAct = new QAction("Decrease Bytes Per Line", this); increaseBplAct->setShortcut(QKeySequence("Ctrl+P")); decreaseBplAct->setShortcut(QKeySequence("Ctrl+O")); connect(increaseBplAct, &QAction::triggered, this, &MemoryWindow::increaseBytesPerLine); connect(decreaseBplAct, &QAction::triggered, this, &MemoryWindow::decreaseBytesPerLine); // Assemble the options menu QMenu* optionsMenu = menuBar()->addMenu("&Options"); optionsMenu->addActions(dataFormat->actions()); optionsMenu->addSeparator(); optionsMenu->addActions(addressGroup->actions()); optionsMenu->addSeparator(); optionsMenu->addAction(reverseAct); optionsMenu->addSeparator(); optionsMenu->addAction(increaseBplAct); optionsMenu->addAction(decreaseBplAct); // // Initialize // populateComboBox(); // Set to the current CPU's memory view setToCurrentCpu(); }
MemoryWindow::MemoryWindow(running_machine* machine, QWidget* parent) : WindowQt(machine, NULL) { setWindowTitle("Debug: Memory View"); if (parent != NULL) { QPoint parentPos = parent->pos(); setGeometry(parentPos.x()+100, parentPos.y()+100, 800, 400); } // // The main frame and its input and log widgets // QFrame* mainWindowFrame = new QFrame(this); // The top frame & groupbox that contains the input widgets QFrame* topSubFrame = new QFrame(mainWindowFrame); // The input edit m_inputEdit = new QLineEdit(topSubFrame); connect(m_inputEdit, SIGNAL(returnPressed()), this, SLOT(expressionSubmitted())); // The memory space combo box m_memoryComboBox = new QComboBox(topSubFrame); m_memoryComboBox->setObjectName("memoryregion"); m_memoryComboBox->setMinimumWidth(300); connect(m_memoryComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(memoryRegionChanged(int))); // The main memory window m_memTable = new DebuggerMemView(DVT_MEMORY, m_machine, this); // Layout QHBoxLayout* subLayout = new QHBoxLayout(topSubFrame); subLayout->addWidget(m_inputEdit); subLayout->addWidget(m_memoryComboBox); subLayout->setSpacing(3); subLayout->setContentsMargins(2,2,2,2); QVBoxLayout* vLayout = new QVBoxLayout(mainWindowFrame); vLayout->setSpacing(3); vLayout->setContentsMargins(2,2,2,2); vLayout->addWidget(topSubFrame); vLayout->addWidget(m_memTable); setCentralWidget(mainWindowFrame); // // Menu bars // // Create a byte-chunk group QActionGroup* chunkGroup = new QActionGroup(this); chunkGroup->setObjectName("chunkgroup"); QAction* chunkActOne = new QAction("1-byte chunks", this); chunkActOne->setObjectName("chunkActOne"); QAction* chunkActTwo = new QAction("2-byte chunks", this); chunkActTwo->setObjectName("chunkActTwo"); QAction* chunkActFour = new QAction("4-byte chunks", this); chunkActFour->setObjectName("chunkActFour"); chunkActOne->setCheckable(true); chunkActTwo->setCheckable(true); chunkActFour->setCheckable(true); chunkActOne->setActionGroup(chunkGroup); chunkActTwo->setActionGroup(chunkGroup); chunkActFour->setActionGroup(chunkGroup); chunkActOne->setShortcut(QKeySequence("Ctrl+1")); chunkActTwo->setShortcut(QKeySequence("Ctrl+2")); chunkActFour->setShortcut(QKeySequence("Ctrl+4")); chunkActOne->setChecked(true); connect(chunkGroup, SIGNAL(triggered(QAction*)), this, SLOT(chunkChanged(QAction*))); // Create a address display group QActionGroup* addressGroup = new QActionGroup(this); addressGroup->setObjectName("addressgroup"); QAction* addressActLogical = new QAction("Logical Addresses", this); QAction* addressActPhysical = new QAction("Physical Addresses", this); addressActLogical->setCheckable(true); addressActPhysical->setCheckable(true); addressActLogical->setActionGroup(addressGroup); addressActPhysical->setActionGroup(addressGroup); addressActLogical->setShortcut(QKeySequence("Ctrl+G")); addressActPhysical->setShortcut(QKeySequence("Ctrl+Y")); addressActLogical->setChecked(true); connect(addressGroup, SIGNAL(triggered(QAction*)), this, SLOT(addressChanged(QAction*))); // Create a reverse view radio QAction* reverseAct = new QAction("Reverse View", this); reverseAct->setObjectName("reverse"); reverseAct->setCheckable(true); reverseAct->setShortcut(QKeySequence("Ctrl+R")); connect(reverseAct, SIGNAL(toggled(bool)), this, SLOT(reverseChanged(bool))); // Create increase and decrease bytes-per-line actions QAction* increaseBplAct = new QAction("Increase Bytes Per Line", this); QAction* decreaseBplAct = new QAction("Decrease Bytes Per Line", this); increaseBplAct->setShortcut(QKeySequence("Ctrl+P")); decreaseBplAct->setShortcut(QKeySequence("Ctrl+O")); connect(increaseBplAct, SIGNAL(triggered(bool)), this, SLOT(increaseBytesPerLine(bool))); connect(decreaseBplAct, SIGNAL(triggered(bool)), this, SLOT(decreaseBytesPerLine(bool))); // Assemble the options menu QMenu* optionsMenu = menuBar()->addMenu("&Options"); optionsMenu->addActions(chunkGroup->actions()); optionsMenu->addSeparator(); optionsMenu->addActions(addressGroup->actions()); optionsMenu->addSeparator(); optionsMenu->addAction(reverseAct); optionsMenu->addSeparator(); optionsMenu->addAction(increaseBplAct); optionsMenu->addAction(decreaseBplAct); // // Initialize // populateComboBox(); // Set to the current CPU's memory view setToCurrentCpu(); }
MainWindow::MainWindow(running_machine* machine, QWidget* parent) : WindowQt(machine, nullptr), m_historyIndex(0), m_inputHistory() { setGeometry(300, 300, 1000, 600); // // The main frame and its input and log widgets // QFrame* mainWindowFrame = new QFrame(this); // The input line m_inputEdit = new QLineEdit(mainWindowFrame); connect(m_inputEdit, &QLineEdit::returnPressed, this, &MainWindow::executeCommandSlot); m_inputEdit->installEventFilter(this); // The log view m_consoleView = new DebuggerView(DVT_CONSOLE, m_machine, mainWindowFrame); m_consoleView->setFocusPolicy(Qt::NoFocus); m_consoleView->setPreferBottom(true); QVBoxLayout* vLayout = new QVBoxLayout(mainWindowFrame); vLayout->addWidget(m_consoleView); vLayout->addWidget(m_inputEdit); vLayout->setSpacing(3); vLayout->setContentsMargins(4,0,4,2); setCentralWidget(mainWindowFrame); // // Options Menu // // Create three commands m_breakpointToggleAct = new QAction("Toggle Breakpoint at Cursor", this); m_breakpointEnableAct = new QAction("Disable Breakpoint at Cursor", this); m_runToCursorAct = new QAction("Run to Cursor", this); m_breakpointToggleAct->setShortcut(Qt::Key_F9); m_breakpointEnableAct->setShortcut(Qt::SHIFT + Qt::Key_F9); m_runToCursorAct->setShortcut(Qt::Key_F4); connect(m_breakpointToggleAct, &QAction::triggered, this, &MainWindow::toggleBreakpointAtCursor); connect(m_breakpointEnableAct, &QAction::triggered, this, &MainWindow::enableBreakpointAtCursor); connect(m_runToCursorAct, &QAction::triggered, this, &MainWindow::runToCursor); // Right bar options QActionGroup* rightBarGroup = new QActionGroup(this); rightBarGroup->setObjectName("rightbargroup"); QAction* rightActRaw = new QAction("Raw Opcodes", this); QAction* rightActEncrypted = new QAction("Encrypted Opcodes", this); QAction* rightActComments = new QAction("Comments", this); rightActRaw->setCheckable(true); rightActEncrypted->setCheckable(true); rightActComments->setCheckable(true); rightActRaw->setActionGroup(rightBarGroup); rightActEncrypted->setActionGroup(rightBarGroup); rightActComments->setActionGroup(rightBarGroup); rightActRaw->setShortcut(QKeySequence("Ctrl+R")); rightActEncrypted->setShortcut(QKeySequence("Ctrl+E")); rightActComments->setShortcut(QKeySequence("Ctrl+N")); rightActRaw->setChecked(true); connect(rightBarGroup, &QActionGroup::triggered, this, &MainWindow::rightBarChanged); // Assemble the options menu QMenu* optionsMenu = menuBar()->addMenu("&Options"); optionsMenu->addAction(m_breakpointToggleAct); optionsMenu->addAction(m_breakpointEnableAct); optionsMenu->addAction(m_runToCursorAct); optionsMenu->addSeparator(); optionsMenu->addActions(rightBarGroup->actions()); // // Images menu // image_interface_iterator imageIterTest(m_machine->root_device()); if (imageIterTest.first() != nullptr) { createImagesMenu(); } // // Dock window menu // QMenu* dockMenu = menuBar()->addMenu("Doc&ks"); setCorner(Qt::TopRightCorner, Qt::TopDockWidgetArea); setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea); // The processor dock QDockWidget* cpuDock = new QDockWidget("processor", this); cpuDock->setObjectName("cpudock"); cpuDock->setAllowedAreas(Qt::LeftDockWidgetArea); m_procFrame = new ProcessorDockWidget(m_machine, cpuDock); cpuDock->setWidget(dynamic_cast<QWidget*>(m_procFrame)); addDockWidget(Qt::LeftDockWidgetArea, cpuDock); dockMenu->addAction(cpuDock->toggleViewAction()); // The disassembly dock QDockWidget* dasmDock = new QDockWidget("dasm", this); dasmDock->setObjectName("dasmdock"); dasmDock->setAllowedAreas(Qt::TopDockWidgetArea); m_dasmFrame = new DasmDockWidget(m_machine, dasmDock); dasmDock->setWidget(m_dasmFrame); connect(m_dasmFrame->view(), &DebuggerView::updated, this, &MainWindow::dasmViewUpdated); addDockWidget(Qt::TopDockWidgetArea, dasmDock); dockMenu->addAction(dasmDock->toggleViewAction()); }
DasmWindow::DasmWindow(running_machine* machine, QWidget* parent) : WindowQt(machine, nullptr) { setWindowTitle("Debug: Disassembly View"); if (parent != nullptr) { QPoint parentPos = parent->pos(); setGeometry(parentPos.x()+100, parentPos.y()+100, 800, 400); } // // The main frame and its input and log widgets // QFrame* mainWindowFrame = new QFrame(this); // The top frame & groupbox that contains the input widgets QFrame* topSubFrame = new QFrame(mainWindowFrame); // The input edit m_inputEdit = new QLineEdit(topSubFrame); connect(m_inputEdit, &QLineEdit::returnPressed, this, &DasmWindow::expressionSubmitted); // The cpu combo box m_cpuComboBox = new QComboBox(topSubFrame); m_cpuComboBox->setObjectName("cpu"); m_cpuComboBox->setMinimumWidth(300); connect(m_cpuComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &DasmWindow::cpuChanged); // The main disasm window m_dasmView = new DebuggerView(DVT_DISASSEMBLY, m_machine, this); connect(m_dasmView, &DebuggerView::updated, this, &DasmWindow::dasmViewUpdated); // Force a recompute of the disassembly region downcast<debug_view_disasm*>(m_dasmView->view())->set_expression("curpc"); // Populate the combo box & set the proper cpu populateComboBox(); //const debug_view_source *source = mem->views[0]->view->source_for_device(curcpu); //gtk_combo_box_set_active(zone_w, mem->views[0]->view->source_list().indexof(*source)); //mem->views[0]->view->set_source(*source); // Layout QHBoxLayout* subLayout = new QHBoxLayout(topSubFrame); subLayout->addWidget(m_inputEdit); subLayout->addWidget(m_cpuComboBox); subLayout->setSpacing(3); subLayout->setContentsMargins(2,2,2,2); QVBoxLayout* vLayout = new QVBoxLayout(mainWindowFrame); vLayout->setSpacing(3); vLayout->setContentsMargins(2,2,2,2); vLayout->addWidget(topSubFrame); vLayout->addWidget(m_dasmView); setCentralWidget(mainWindowFrame); // // Menu bars // // Create three commands m_breakpointToggleAct = new QAction("Toggle Breakpoint at Cursor", this); m_breakpointEnableAct = new QAction("Disable Breakpoint at Cursor", this); m_runToCursorAct = new QAction("Run to Cursor", this); m_breakpointToggleAct->setShortcut(Qt::Key_F9); m_breakpointEnableAct->setShortcut(Qt::SHIFT + Qt::Key_F9); m_runToCursorAct->setShortcut(Qt::Key_F4); connect(m_breakpointToggleAct, &QAction::triggered, this, &DasmWindow::toggleBreakpointAtCursor); connect(m_breakpointEnableAct, &QAction::triggered, this, &DasmWindow::enableBreakpointAtCursor); connect(m_runToCursorAct, &QAction::triggered, this, &DasmWindow::runToCursor); // Right bar options QActionGroup* rightBarGroup = new QActionGroup(this); rightBarGroup->setObjectName("rightbargroup"); QAction* rightActRaw = new QAction("Raw Opcodes", this); QAction* rightActEncrypted = new QAction("Encrypted Opcodes", this); QAction* rightActComments = new QAction("Comments", this); rightActRaw->setCheckable(true); rightActEncrypted->setCheckable(true); rightActComments->setCheckable(true); rightActRaw->setActionGroup(rightBarGroup); rightActEncrypted->setActionGroup(rightBarGroup); rightActComments->setActionGroup(rightBarGroup); rightActRaw->setShortcut(QKeySequence("Ctrl+R")); rightActEncrypted->setShortcut(QKeySequence("Ctrl+E")); rightActComments->setShortcut(QKeySequence("Ctrl+N")); rightActRaw->setChecked(true); connect(rightBarGroup, &QActionGroup::triggered, this, &DasmWindow::rightBarChanged); // Assemble the options menu QMenu* optionsMenu = menuBar()->addMenu("&Options"); optionsMenu->addAction(m_breakpointToggleAct); optionsMenu->addAction(m_breakpointEnableAct); optionsMenu->addAction(m_runToCursorAct); optionsMenu->addSeparator(); optionsMenu->addActions(rightBarGroup->actions()); }