Go to address dialog adjustments for debugger and hex editor.
This commit is contained in:
parent
e9cb6498cd
commit
c3fbabc633
|
@ -1825,6 +1825,9 @@ void ConsoleDebugger::openGotoAddrDialog(void)
|
||||||
okButton = new QPushButton( tr("Go") );
|
okButton = new QPushButton( tr("Go") );
|
||||||
cancelButton = new QPushButton( tr("Cancel") );
|
cancelButton = new QPushButton( tr("Cancel") );
|
||||||
|
|
||||||
|
okButton->setIcon( style()->standardIcon( QStyle::SP_DialogApplyButton ) );
|
||||||
|
cancelButton->setIcon( style()->standardIcon( QStyle::SP_DialogCancelButton ) );
|
||||||
|
|
||||||
connect( okButton, SIGNAL(clicked(void)), &dialog, SLOT(accept(void)) );
|
connect( okButton, SIGNAL(clicked(void)), &dialog, SLOT(accept(void)) );
|
||||||
connect( cancelButton, SIGNAL(clicked(void)), &dialog, SLOT(reject(void)) );
|
connect( cancelButton, SIGNAL(clicked(void)), &dialog, SLOT(reject(void)) );
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
|
#include <QSpinBox>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QMenuBar>
|
#include <QMenuBar>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
@ -2186,23 +2187,57 @@ void QHexEdit::openGotoAddrDialog(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
char stmp[128];
|
char stmp[128];
|
||||||
QInputDialog dialog(this);
|
QDialog dialog(this);
|
||||||
|
QLabel *lbl;
|
||||||
|
QSpinBox *sbox;
|
||||||
|
QVBoxLayout *vbox;
|
||||||
|
QHBoxLayout *hbox;
|
||||||
|
QPushButton *okButton, *cancelButton;
|
||||||
|
|
||||||
sprintf( stmp, "Specify Address [ 0x0 -> 0x%X ]", mb.size()-1 );
|
sprintf( stmp, "Specify Address [ 0x0 -> 0x%X ]", mb.size()-1 );
|
||||||
|
|
||||||
|
vbox = new QVBoxLayout();
|
||||||
|
hbox = new QHBoxLayout();
|
||||||
|
lbl = new QLabel( tr(stmp) );
|
||||||
|
|
||||||
|
okButton = new QPushButton( tr("Go") );
|
||||||
|
cancelButton = new QPushButton( tr("Cancel") );
|
||||||
|
|
||||||
|
okButton->setIcon( style()->standardIcon( QStyle::SP_DialogApplyButton ) );
|
||||||
|
cancelButton->setIcon( style()->standardIcon( QStyle::SP_DialogCancelButton ) );
|
||||||
|
|
||||||
|
connect( okButton, SIGNAL(clicked(void)), &dialog, SLOT(accept(void)) );
|
||||||
|
connect( cancelButton, SIGNAL(clicked(void)), &dialog, SLOT(reject(void)) );
|
||||||
|
|
||||||
|
sbox = new QSpinBox();
|
||||||
|
sbox->setRange(0x0000, mb.size()-1);
|
||||||
|
sbox->setDisplayIntegerBase(16);
|
||||||
|
sbox->setValue( 0 );
|
||||||
|
|
||||||
|
QFont font = sbox->font();
|
||||||
|
font.setCapitalization(QFont::AllUppercase);
|
||||||
|
sbox->setFont(font);
|
||||||
|
|
||||||
|
hbox->addWidget( cancelButton );
|
||||||
|
hbox->addWidget( okButton );
|
||||||
|
|
||||||
|
vbox->addWidget( lbl );
|
||||||
|
vbox->addWidget( sbox );
|
||||||
|
vbox->addLayout( hbox );
|
||||||
|
|
||||||
|
dialog.setLayout( vbox );
|
||||||
|
|
||||||
dialog.setWindowTitle( tr("Goto Address") );
|
dialog.setWindowTitle( tr("Goto Address") );
|
||||||
dialog.setLabelText( tr(stmp) );
|
|
||||||
dialog.setOkButtonText( tr("Go") );
|
okButton->setDefault(true);
|
||||||
//dialog.setTextValue( tr("0") );
|
|
||||||
|
|
||||||
ret = dialog.exec();
|
ret = dialog.exec();
|
||||||
|
|
||||||
if ( QDialog::Accepted == ret )
|
if ( QDialog::Accepted == ret )
|
||||||
{
|
{
|
||||||
int addr;
|
int addr;
|
||||||
std::string s = dialog.textValue().toStdString();
|
|
||||||
|
|
||||||
addr = strtol( s.c_str(), NULL, 16 );
|
addr = sbox->value();
|
||||||
|
|
||||||
parent->gotoAddress(addr);
|
parent->gotoAddress(addr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue