Added hot key to close hex editor window by pressing Esc key. Added logic to open ppu viewer from name table editor.

This commit is contained in:
mjbudd77 2021-01-31 14:07:50 -05:00
parent 1958daf6cb
commit 9c70a682b7
3 changed files with 9 additions and 7 deletions

View File

@ -409,7 +409,7 @@ memBlock_t::memBlock_t( void )
{ {
buf = NULL; buf = NULL;
_size = 0; _size = 0;
_maxLines = 0; _maxLines = 0;
memAccessFunc = NULL; memAccessFunc = NULL;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -441,7 +441,7 @@ int memBlock_t::reAlloc( int newSize )
::free( buf ); buf = NULL; ::free( buf ); buf = NULL;
} }
_size = 0; _size = 0;
_maxLines = 0; _maxLines = 0;
buf = (struct memByte_t *)malloc( newSize * sizeof(struct memByte_t) ); buf = (struct memByte_t *)malloc( newSize * sizeof(struct memByte_t) );
@ -918,7 +918,7 @@ HexEditorDialog_t::HexEditorDialog_t(QWidget *parent)
// File -> Close // File -> Close
closeAct = new QAction(tr("Close"), this); closeAct = new QAction(tr("Close"), this);
//closeAct->setShortcuts(QKeySequence::Open); closeAct->setShortcut(QKeySequence(tr("Esc")));
closeAct->setStatusTip(tr("Close Window")); closeAct->setStatusTip(tr("Close Window"));
connect(closeAct, SIGNAL(triggered()), this, SLOT(closeWindow(void)) ); connect(closeAct, SIGNAL(triggered()), this, SLOT(closeWindow(void)) );

View File

@ -1218,9 +1218,9 @@ void ppuNameTableView_t::contextMenuEvent(QContextMenuEvent *event)
{ {
QAction *act; QAction *act;
QMenu menu(this); QMenu menu(this);
QMenu *subMenu; //QMenu *subMenu;
//QActionGroup *group; //QActionGroup *group;
char stmp[64]; char stmp[128];
int tIdx, tx, ty; int tIdx, tx, ty;
convertXY2TableTile( event->pos().x(), event->pos().y(), &tIdx, &tx, &ty ); convertXY2TableTile( event->pos().x(), event->pos().y(), &tIdx, &tx, &ty );
@ -1233,7 +1233,7 @@ void ppuNameTableView_t::contextMenuEvent(QContextMenuEvent *event)
sprintf( stmp, "Open Tile %X%X in PPU Viewer", selTile.x(), selTile.y() ); sprintf( stmp, "Open Tile %X%X in PPU Viewer", selTile.x(), selTile.y() );
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 );

View File

@ -45,6 +45,7 @@
#include "Qt/dface.h" #include "Qt/dface.h"
#include "Qt/input.h" #include "Qt/input.h"
#include "Qt/config.h" #include "Qt/config.h"
#include "Qt/HexEditor.h"
#include "Qt/fceuWrapper.h" #include "Qt/fceuWrapper.h"
#define PATTERNWIDTH 128 #define PATTERNWIDTH 128
@ -362,7 +363,7 @@ void ppuPatternView_t::keyPressEvent(QKeyEvent *event)
} }
else if ( event->key() == Qt::Key_E ) else if ( event->key() == Qt::Key_E )
{ {
openTileEditor(); openTileEditor();
} }
else if ( event->key() == Qt::Key_P ) else if ( event->key() == Qt::Key_P )
{ {
@ -1261,6 +1262,7 @@ void ppuTileEditor_t::setCellValue( int y, int x, int colorIndex )
} }
writeMemPPU( a+8, val ); writeMemPPU( a+8, val );
hexEditorRequestUpdateAll();
} }
//---------------------------------------------------- //----------------------------------------------------
void ppuTileEditor_t::showKeyAssignments(void) void ppuTileEditor_t::showKeyAssignments(void)