Added a few context menu accelerators to debugger, hex editor, ppu viewer, and name table viewer Qt windows.

This commit is contained in:
mjbudd77 2021-02-19 00:15:23 -05:00
parent 350f7fa468
commit 67fb5263cc
4 changed files with 38 additions and 38 deletions

View File

@ -3781,28 +3781,28 @@ void QAsmView::contextMenuEvent(QContextMenuEvent *event)
if ( enableRunToCursor ) if ( enableRunToCursor )
{ {
act = new QAction(tr("Run To Cursor"), &menu); act = new QAction(tr("Run To &Cursor"), &menu);
menu.addAction(act); menu.addAction(act);
//act->setShortcut( QKeySequence(tr("Ctrl+F10"))); //act->setShortcut( QKeySequence(tr("Ctrl+F10")));
connect( act, SIGNAL(triggered(void)), parent, SLOT(asmViewCtxMenuRunToCursor(void)) ); connect( act, SIGNAL(triggered(void)), parent, SLOT(asmViewCtxMenuRunToCursor(void)) );
} }
act = new QAction(tr("Add Breakpoint"), &menu); act = new QAction(tr("Add &Breakpoint"), &menu);
menu.addAction(act); menu.addAction(act);
act->setShortcut( QKeySequence(tr("B"))); act->setShortcut( QKeySequence(tr("B")));
connect( act, SIGNAL(triggered(void)), parent, SLOT(asmViewCtxMenuAddBP(void)) ); connect( act, SIGNAL(triggered(void)), parent, SLOT(asmViewCtxMenuAddBP(void)) );
act = new QAction(tr("Add Symbolic Debug Marker"), &menu); act = new QAction(tr("Add &Symbolic Debug Marker"), &menu);
menu.addAction(act); menu.addAction(act);
act->setShortcut( QKeySequence(tr("S"))); act->setShortcut( QKeySequence(tr("S")));
connect( act, SIGNAL(triggered(void)), parent, SLOT(asmViewCtxMenuAddSym(void)) ); connect( act, SIGNAL(triggered(void)), parent, SLOT(asmViewCtxMenuAddSym(void)) );
act = new QAction(tr("Add Bookmark"), &menu); act = new QAction(tr("Add Book&mark"), &menu);
menu.addAction(act); menu.addAction(act);
act->setShortcut( QKeySequence(tr("M"))); act->setShortcut( QKeySequence(tr("M")));
connect( act, SIGNAL(triggered(void)), parent, SLOT(asmViewCtxMenuAddBM(void)) ); connect( act, SIGNAL(triggered(void)), parent, SLOT(asmViewCtxMenuAddBM(void)) );
act = new QAction(tr("Open Hex Editor"), &menu); act = new QAction(tr("Open &Hex Editor"), &menu);
menu.addAction(act); menu.addAction(act);
act->setShortcut( QKeySequence(tr("H"))); act->setShortcut( QKeySequence(tr("H")));
connect( act, SIGNAL(triggered(void)), parent, SLOT(asmViewCtxMenuOpenHexEdit(void)) ); connect( act, SIGNAL(triggered(void)), parent, SLOT(asmViewCtxMenuOpenHexEdit(void)) );

View File

@ -2552,42 +2552,42 @@ void QHexEdit::contextMenuEvent(QContextMenuEvent *event)
{ {
QMenu *subMenu; QMenu *subMenu;
act = new QAction(tr("Add Symbolic Debug Name"), &menu); act = new QAction(tr("Add &Symbolic Debug Name"), &menu);
menu.addAction(act); menu.addAction(act);
connect( act, SIGNAL(triggered(void)), this, SLOT(addDebugSym(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(addDebugSym(void)) );
subMenu = menu.addMenu(tr("Freeze/Unfreeze Address")); subMenu = menu.addMenu(tr("&Freeze/Unfreeze Address"));
act = new QAction(tr("Toggle State"), &menu); act = new QAction(tr("&Toggle State"), &menu);
act->setShortcut( QKeySequence(tr("Shift+F"))); act->setShortcut( QKeySequence(tr("Shift+F")));
subMenu->addAction(act); subMenu->addAction(act);
connect( act, SIGNAL(triggered(void)), this, SLOT(frzRamToggle(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(frzRamToggle(void)) );
act = new QAction(tr("Freeze"), &menu); act = new QAction(tr("&Freeze"), &menu);
subMenu->addAction(act); subMenu->addAction(act);
connect( act, SIGNAL(triggered(void)), this, SLOT(frzRamSet(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(frzRamSet(void)) );
act = new QAction(tr("Unfreeze"), &menu); act = new QAction(tr("&Unfreeze"), &menu);
subMenu->addAction(act); subMenu->addAction(act);
connect( act, SIGNAL(triggered(void)), this, SLOT(frzRamUnset(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(frzRamUnset(void)) );
subMenu->addSeparator(); subMenu->addSeparator();
act = new QAction(tr("Unfreeze All"), &menu); act = new QAction(tr("Unfreeze &All"), &menu);
subMenu->addAction(act); subMenu->addAction(act);
connect( act, SIGNAL(triggered(void)), this, SLOT(frzRamUnsetAll(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(frzRamUnsetAll(void)) );
sprintf( stmp, "Add Read Breakpoint for Address $%04X", addr ); sprintf( stmp, "Add &Read Breakpoint for Address $%04X", addr );
act = new QAction(tr(stmp), &menu); act = new QAction(tr(stmp), &menu);
menu.addAction(act); menu.addAction(act);
connect( act, SIGNAL(triggered(void)), this, SLOT(addRamReadBP(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(addRamReadBP(void)) );
sprintf( stmp, "Add Write Breakpoint for Address $%04X", addr ); sprintf( stmp, "Add &Write Breakpoint for Address $%04X", addr );
act = new QAction(tr(stmp), &menu); act = new QAction(tr(stmp), &menu);
menu.addAction(act); menu.addAction(act);
connect( act, SIGNAL(triggered(void)), this, SLOT(addRamWriteBP(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(addRamWriteBP(void)) );
sprintf( stmp, "Add Execute Breakpoint for Address $%04X", addr ); sprintf( stmp, "Add &Execute Breakpoint for Address $%04X", addr );
act = new QAction(tr(stmp), &menu); act = new QAction(tr(stmp), &menu);
menu.addAction(act); menu.addAction(act);
connect( act, SIGNAL(triggered(void)), this, SLOT(addRamExecuteBP(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(addRamExecuteBP(void)) );
@ -2599,46 +2599,46 @@ void QHexEdit::contextMenuEvent(QContextMenuEvent *event)
if ( romAddr >= 0 ) if ( romAddr >= 0 )
{ {
jumpToRomValue = romAddr; jumpToRomValue = romAddr;
sprintf( stmp, "Go Here in ROM File: (%08X)", romAddr ); sprintf( stmp, "&Go Here in ROM File: (%08X)", romAddr );
act = new QAction(tr(stmp), &menu); act = new QAction(tr(stmp), &menu);
menu.addAction(act); menu.addAction(act);
connect( act, SIGNAL(triggered(void)), this, SLOT(jumpToROM(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(jumpToROM(void)) );
} }
} }
act = new QAction(tr("Add Bookmark"), &menu); act = new QAction(tr("Add Book&mark"), &menu);
menu.addAction(act); menu.addAction(act);
connect( act, SIGNAL(triggered(void)), this, SLOT(addBookMarkCB(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(addBookMarkCB(void)) );
} }
break; break;
case MODE_NES_PPU: case MODE_NES_PPU:
{ {
sprintf( stmp, "Add Read Breakpoint for Address $%04X", addr ); sprintf( stmp, "Add &Read Breakpoint for Address $%04X", addr );
act = new QAction(tr(stmp), &menu); act = new QAction(tr(stmp), &menu);
menu.addAction(act); menu.addAction(act);
connect( act, SIGNAL(triggered(void)), this, SLOT(addPpuReadBP(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(addPpuReadBP(void)) );
sprintf( stmp, "Add Write Breakpoint for Address $%04X", addr ); sprintf( stmp, "Add &Write Breakpoint for Address $%04X", addr );
act = new QAction(tr(stmp), &menu); act = new QAction(tr(stmp), &menu);
menu.addAction(act); menu.addAction(act);
connect( act, SIGNAL(triggered(void)), this, SLOT(addPpuWriteBP(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(addPpuWriteBP(void)) );
act = new QAction(tr("Add Bookmark"), &menu); act = new QAction(tr("Add Book&mark"), &menu);
menu.addAction(act); menu.addAction(act);
connect( act, SIGNAL(triggered(void)), this, SLOT(addBookMarkCB(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(addBookMarkCB(void)) );
} }
break; break;
case MODE_NES_OAM: case MODE_NES_OAM:
{ {
act = new QAction(tr("Add Bookmark"), &menu); act = new QAction(tr("Add Book&mark"), &menu);
menu.addAction(act); menu.addAction(act);
connect( act, SIGNAL(triggered(void)), this, SLOT(addBookMarkCB(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(addBookMarkCB(void)) );
} }
break; break;
case MODE_NES_ROM: case MODE_NES_ROM:
{ {
act = new QAction(tr("Add Bookmark"), &menu); act = new QAction(tr("Add Book&mark"), &menu);
menu.addAction(act); menu.addAction(act);
connect( act, SIGNAL(triggered(void)), this, SLOT(addBookMarkCB(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(addBookMarkCB(void)) );
} }
break; break;

View File

@ -1256,25 +1256,25 @@ void ppuNameTableView_t::contextMenuEvent(QContextMenuEvent *event)
redrawtables = true; redrawtables = true;
sprintf( stmp, "Open Tile $%04X in PPU Viewer", tileAddr ); sprintf( stmp, "Open Tile $%04X in PPU &Viewer", tileAddr );
act = new QAction(tr(stmp), &menu); act = new QAction(tr(stmp), &menu);
//act->setShortcut( QKeySequence(tr("V"))); //act->setShortcut( QKeySequence(tr("V")));
connect( act, SIGNAL(triggered(void)), this, SLOT(openTilePpuViewer(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(openTilePpuViewer(void)) );
menu.addAction( act ); menu.addAction( act );
sprintf( stmp, "Open Tile Addr $%04X in Hex Editor", tileAddr ); sprintf( stmp, "Open &Tile Addr $%04X in Hex Editor", tileAddr );
act = new QAction(tr(stmp), &menu); act = new QAction(tr(stmp), &menu);
//act->setShortcut( QKeySequence(tr("H"))); //act->setShortcut( QKeySequence(tr("H")));
connect( act, SIGNAL(triggered(void)), this, SLOT(openTileAddrHexEdit(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(openTileAddrHexEdit(void)) );
menu.addAction( act ); menu.addAction( act );
sprintf( stmp, "Open Attr Addr $%04X in Hex Editor", atrbAddr ); sprintf( stmp, "Open &Attr Addr $%04X in Hex Editor", atrbAddr );
act = new QAction(tr(stmp), &menu); act = new QAction(tr(stmp), &menu);
//act->setShortcut( QKeySequence(tr("H"))); //act->setShortcut( QKeySequence(tr("H")));
connect( act, SIGNAL(triggered(void)), this, SLOT(openAtrbAddrHexEdit(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(openAtrbAddrHexEdit(void)) );
menu.addAction( act ); menu.addAction( act );
sprintf( stmp, "Open PPU Addr $%04X in Hex Editor", ppuAddr ); sprintf( stmp, "Open &PPU Addr $%04X in Hex Editor", ppuAddr );
act = new QAction(tr(stmp), &menu); act = new QAction(tr(stmp), &menu);
//act->setShortcut( QKeySequence(tr("H"))); //act->setShortcut( QKeySequence(tr("H")));
connect( act, SIGNAL(triggered(void)), this, SLOT(openPpuAddrHexEdit(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(openPpuAddrHexEdit(void)) );

View File

@ -802,14 +802,14 @@ void ppuPatternView_t::contextMenuEvent(QContextMenuEvent *event)
QAction *paletteAct[9]; QAction *paletteAct[9];
char stmp[64]; char stmp[64];
act = new QAction(tr("Open Tile Editor"), &menu); act = new QAction(tr("Open Tile &Editor"), &menu);
act->setShortcut( QKeySequence(tr("E"))); act->setShortcut( QKeySequence(tr("E")));
connect( act, SIGNAL(triggered(void)), this, SLOT(openTileEditor(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(openTileEditor(void)) );
menu.addAction( act ); menu.addAction( act );
if ( mode ) if ( mode )
{ {
sprintf( stmp, "Exit Tile View: %X%X", selTile.y(), selTile.x() ); sprintf( stmp, "Exit Tile &View: %X%X", selTile.y(), selTile.x() );
act = new QAction(tr(stmp), &menu); act = new QAction(tr(stmp), &menu);
act->setShortcut( QKeySequence(tr("Z"))); act->setShortcut( QKeySequence(tr("Z")));
@ -818,7 +818,7 @@ void ppuPatternView_t::contextMenuEvent(QContextMenuEvent *event)
} }
else else
{ {
sprintf( stmp, "View Tile: %X%X", selTile.y(), selTile.x() ); sprintf( stmp, "&View Tile: %X%X", selTile.y(), selTile.x() );
act = new QAction(tr(stmp), &menu); act = new QAction(tr(stmp), &menu);
act->setShortcut( QKeySequence(tr("Z"))); act->setShortcut( QKeySequence(tr("Z")));
@ -826,19 +826,19 @@ void ppuPatternView_t::contextMenuEvent(QContextMenuEvent *event)
menu.addAction( act ); menu.addAction( act );
} }
act = new QAction(tr("Draw Tile Grid Lines"), &menu); act = new QAction(tr("Draw Tile &Grid Lines"), &menu);
act->setCheckable(true); act->setCheckable(true);
act->setChecked(drawTileGrid); act->setChecked(drawTileGrid);
act->setShortcut( QKeySequence(tr("G"))); act->setShortcut( QKeySequence(tr("G")));
connect( act, SIGNAL(triggered(void)), this, SLOT(toggleTileGridLines(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(toggleTileGridLines(void)) );
menu.addAction( act ); menu.addAction( act );
act = new QAction(tr("Next Palette"), &menu); act = new QAction(tr("Next &Palette"), &menu);
act->setShortcut( QKeySequence(tr("P"))); act->setShortcut( QKeySequence(tr("P")));
connect( act, SIGNAL(triggered(void)), this, SLOT(cycleNextPalette(void)) ); connect( act, SIGNAL(triggered(void)), this, SLOT(cycleNextPalette(void)) );
menu.addAction( act ); menu.addAction( act );
subMenu = menu.addMenu(tr("Palette Select")); subMenu = menu.addMenu(tr("Palette &Select"));
group = new QActionGroup(&menu); group = new QActionGroup(&menu);
group->setExclusive(true); group->setExclusive(true);
@ -847,7 +847,7 @@ void ppuPatternView_t::contextMenuEvent(QContextMenuEvent *event)
{ {
char stmp[8]; char stmp[8];
sprintf( stmp, "%i", i+1 ); sprintf( stmp, "&%i", i+1 );
paletteAct[i] = new QAction(tr(stmp), &menu); paletteAct[i] = new QAction(tr(stmp), &menu);
paletteAct[i]->setCheckable(true); paletteAct[i]->setCheckable(true);