Added missing config paramaters for Qt Hex Editor.
This commit is contained in:
parent
bf41302862
commit
829e8cb3f1
|
@ -1087,7 +1087,7 @@ HexEditorDialog_t::HexEditorDialog_t(QWidget *parent)
|
||||||
QAction *act, *actHlgt, *actHlgtRV;
|
QAction *act, *actHlgt, *actHlgtRV;
|
||||||
ColorMenuItem *actColorFG, *actColorBG, *actRowColColor, *actAltColColor;
|
ColorMenuItem *actColorFG, *actColorBG, *actRowColColor, *actAltColColor;
|
||||||
QActionGroup *group;
|
QActionGroup *group;
|
||||||
int useNativeMenuBar;
|
int opt, useNativeMenuBar, refreshRateOpt;
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
||||||
QDialog::setWindowTitle( tr("Hex Editor") );
|
QDialog::setWindowTitle( tr("Hex Editor") );
|
||||||
|
@ -1096,6 +1096,11 @@ HexEditorDialog_t::HexEditorDialog_t(QWidget *parent)
|
||||||
|
|
||||||
menuBar = new QMenuBar(this);
|
menuBar = new QMenuBar(this);
|
||||||
|
|
||||||
|
grid = new QGridLayout(this);
|
||||||
|
editor = new QHexEdit(this);
|
||||||
|
vbar = new QScrollBar( Qt::Vertical, this );
|
||||||
|
hbar = new QScrollBar( Qt::Horizontal, this );
|
||||||
|
|
||||||
// This is needed for menu bar to show up on MacOS
|
// This is needed for menu bar to show up on MacOS
|
||||||
g_config->getOption( "SDL.UseNativeMenuBar", &useNativeMenuBar );
|
g_config->getOption( "SDL.UseNativeMenuBar", &useNativeMenuBar );
|
||||||
|
|
||||||
|
@ -1262,9 +1267,12 @@ HexEditorDialog_t::HexEditorDialog_t(QWidget *parent)
|
||||||
|
|
||||||
group->setExclusive(true);
|
group->setExclusive(true);
|
||||||
|
|
||||||
|
g_config->getOption("SDL.HexEditRefreshRate", &refreshRateOpt);
|
||||||
|
|
||||||
// View -> Refresh Rate -> 5 Hz
|
// View -> Refresh Rate -> 5 Hz
|
||||||
act = new QAction(tr("5 Hz"), this);
|
act = new QAction(tr("5 Hz"), this);
|
||||||
act->setCheckable(true);
|
act->setCheckable(true);
|
||||||
|
act->setChecked( refreshRateOpt == 5 );
|
||||||
connect(act, SIGNAL(triggered()), this, SLOT(setViewRefresh5Hz(void)) );
|
connect(act, SIGNAL(triggered()), this, SLOT(setViewRefresh5Hz(void)) );
|
||||||
|
|
||||||
group->addAction(act);
|
group->addAction(act);
|
||||||
|
@ -1273,7 +1281,7 @@ HexEditorDialog_t::HexEditorDialog_t(QWidget *parent)
|
||||||
// View -> Refresh Rate -> 10 Hz
|
// View -> Refresh Rate -> 10 Hz
|
||||||
act = new QAction(tr("10 Hz"), this);
|
act = new QAction(tr("10 Hz"), this);
|
||||||
act->setCheckable(true);
|
act->setCheckable(true);
|
||||||
act->setChecked(true);
|
act->setChecked( refreshRateOpt == 10 );
|
||||||
connect(act, SIGNAL(triggered()), this, SLOT(setViewRefresh10Hz(void)) );
|
connect(act, SIGNAL(triggered()), this, SLOT(setViewRefresh10Hz(void)) );
|
||||||
|
|
||||||
group->addAction(act);
|
group->addAction(act);
|
||||||
|
@ -1282,6 +1290,7 @@ HexEditorDialog_t::HexEditorDialog_t(QWidget *parent)
|
||||||
// View -> Refresh Rate -> 20 Hz
|
// View -> Refresh Rate -> 20 Hz
|
||||||
act = new QAction(tr("20 Hz"), this);
|
act = new QAction(tr("20 Hz"), this);
|
||||||
act->setCheckable(true);
|
act->setCheckable(true);
|
||||||
|
act->setChecked( refreshRateOpt == 20 );
|
||||||
connect(act, SIGNAL(triggered()), this, SLOT(setViewRefresh20Hz(void)) );
|
connect(act, SIGNAL(triggered()), this, SLOT(setViewRefresh20Hz(void)) );
|
||||||
|
|
||||||
group->addAction(act);
|
group->addAction(act);
|
||||||
|
@ -1290,6 +1299,7 @@ HexEditorDialog_t::HexEditorDialog_t(QWidget *parent)
|
||||||
// View -> Refresh Rate -> 30 Hz
|
// View -> Refresh Rate -> 30 Hz
|
||||||
act = new QAction(tr("30 Hz"), this);
|
act = new QAction(tr("30 Hz"), this);
|
||||||
act->setCheckable(true);
|
act->setCheckable(true);
|
||||||
|
act->setChecked( refreshRateOpt == 30 );
|
||||||
connect(act, SIGNAL(triggered()), this, SLOT(setViewRefresh30Hz(void)) );
|
connect(act, SIGNAL(triggered()), this, SLOT(setViewRefresh30Hz(void)) );
|
||||||
|
|
||||||
group->addAction(act);
|
group->addAction(act);
|
||||||
|
@ -1298,6 +1308,7 @@ HexEditorDialog_t::HexEditorDialog_t(QWidget *parent)
|
||||||
// View -> Refresh Rate -> 60 Hz
|
// View -> Refresh Rate -> 60 Hz
|
||||||
act = new QAction(tr("60 Hz"), this);
|
act = new QAction(tr("60 Hz"), this);
|
||||||
act->setCheckable(true);
|
act->setCheckable(true);
|
||||||
|
act->setChecked( refreshRateOpt == 60 );
|
||||||
connect(act, SIGNAL(triggered()), this, SLOT(setViewRefresh60Hz(void)) );
|
connect(act, SIGNAL(triggered()), this, SLOT(setViewRefresh60Hz(void)) );
|
||||||
|
|
||||||
group->addAction(act);
|
group->addAction(act);
|
||||||
|
@ -1307,41 +1318,53 @@ HexEditorDialog_t::HexEditorDialog_t(QWidget *parent)
|
||||||
colorMenu = menuBar->addMenu(tr("&Color"));
|
colorMenu = menuBar->addMenu(tr("&Color"));
|
||||||
|
|
||||||
// Color -> Highlight Activity
|
// Color -> Highlight Activity
|
||||||
|
g_config->getOption("SDL.HexEditActivityHlgt", &opt);
|
||||||
|
editor->setHighlightActivity( opt );
|
||||||
|
|
||||||
actHlgt = new QAction(tr("Highlight &Activity"), this);
|
actHlgt = new QAction(tr("Highlight &Activity"), this);
|
||||||
//actHlgt->setShortcuts(QKeySequence::Open);
|
//actHlgt->setShortcuts(QKeySequence::Open);
|
||||||
actHlgt->setStatusTip(tr("Highlight Activity"));
|
actHlgt->setStatusTip(tr("Highlight Activity"));
|
||||||
actHlgt->setCheckable(true);
|
actHlgt->setCheckable(true);
|
||||||
actHlgt->setChecked(true);
|
actHlgt->setChecked(opt);
|
||||||
connect(actHlgt, SIGNAL(triggered(bool)), this, SLOT(actvHighlightCB(bool)) );
|
connect(actHlgt, SIGNAL(triggered(bool)), this, SLOT(actvHighlightCB(bool)) );
|
||||||
|
|
||||||
colorMenu->addAction(actHlgt);
|
colorMenu->addAction(actHlgt);
|
||||||
|
|
||||||
// Color -> Highlight Reverse Video
|
// Color -> Highlight Reverse Video
|
||||||
|
g_config->getOption("SDL.HexEditReverseVideo", &opt);
|
||||||
|
editor->setHighlightReverseVideo( opt );
|
||||||
|
|
||||||
actHlgtRV = new QAction(tr("Highlight &Reverse Video"), this);
|
actHlgtRV = new QAction(tr("Highlight &Reverse Video"), this);
|
||||||
//actHlgtRV->setShortcuts(QKeySequence::Open);
|
//actHlgtRV->setShortcuts(QKeySequence::Open);
|
||||||
actHlgtRV->setStatusTip(tr("Highlight Reverse Video"));
|
actHlgtRV->setStatusTip(tr("Highlight Reverse Video"));
|
||||||
actHlgtRV->setCheckable(true);
|
actHlgtRV->setCheckable(true);
|
||||||
actHlgtRV->setChecked(true);
|
actHlgtRV->setChecked(opt);
|
||||||
connect(actHlgtRV, SIGNAL(triggered(bool)), this, SLOT(actvHighlightRVCB(bool)) );
|
connect(actHlgtRV, SIGNAL(triggered(bool)), this, SLOT(actvHighlightRVCB(bool)) );
|
||||||
|
|
||||||
colorMenu->addAction(actHlgtRV);
|
colorMenu->addAction(actHlgtRV);
|
||||||
|
|
||||||
// Color -> Highlight Reverse Video
|
// Color -> Highlight Reverse Video
|
||||||
|
g_config->getOption("SDL.HexEditRowColumnHlgt", &opt);
|
||||||
|
editor->setRowColHlgtEna( opt );
|
||||||
|
|
||||||
rolColHlgtAct = new QAction(tr("Highlight &Cursor Row/Column"), this);
|
rolColHlgtAct = new QAction(tr("Highlight &Cursor Row/Column"), this);
|
||||||
//rolColHlgtAct->setShortcuts(QKeySequence::Open);
|
//rolColHlgtAct->setShortcuts(QKeySequence::Open);
|
||||||
rolColHlgtAct->setStatusTip(tr("Highlight Cursor Row/Column"));
|
rolColHlgtAct->setStatusTip(tr("Highlight Cursor Row/Column"));
|
||||||
rolColHlgtAct->setCheckable(true);
|
rolColHlgtAct->setCheckable(true);
|
||||||
rolColHlgtAct->setChecked(false);
|
rolColHlgtAct->setChecked(opt);
|
||||||
connect(rolColHlgtAct, SIGNAL(triggered(bool)), this, SLOT(rolColHlgtChanged(bool)) );
|
connect(rolColHlgtAct, SIGNAL(triggered(bool)), this, SLOT(rolColHlgtChanged(bool)) );
|
||||||
|
|
||||||
colorMenu->addAction(rolColHlgtAct);
|
colorMenu->addAction(rolColHlgtAct);
|
||||||
|
|
||||||
// Color -> Highlight Reverse Video
|
// Color -> Highlight Reverse Video
|
||||||
|
g_config->getOption("SDL.HexEditAltnColumnColor", &opt);
|
||||||
|
editor->setAltColHlgtEna( opt );
|
||||||
|
|
||||||
altColHlgtAct = new QAction(tr("&Alternating Column Colors"), this);
|
altColHlgtAct = new QAction(tr("&Alternating Column Colors"), this);
|
||||||
//altColHlgtAct->setShortcuts(QKeySequence::Open);
|
//altColHlgtAct->setShortcuts(QKeySequence::Open);
|
||||||
altColHlgtAct->setStatusTip(tr("&Alternating Column Colors"));
|
altColHlgtAct->setStatusTip(tr("&Alternating Column Colors"));
|
||||||
altColHlgtAct->setCheckable(true);
|
altColHlgtAct->setCheckable(true);
|
||||||
altColHlgtAct->setChecked(false);
|
altColHlgtAct->setChecked(opt);
|
||||||
connect(altColHlgtAct, SIGNAL(triggered(bool)), this, SLOT(altColHlgtChanged(bool)) );
|
connect(altColHlgtAct, SIGNAL(triggered(bool)), this, SLOT(altColHlgtChanged(bool)) );
|
||||||
|
|
||||||
colorMenu->addAction(altColHlgtAct);
|
colorMenu->addAction(altColHlgtAct);
|
||||||
|
@ -1392,10 +1415,6 @@ HexEditorDialog_t::HexEditorDialog_t(QWidget *parent)
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
//mainLayout = new QVBoxLayout();
|
//mainLayout = new QVBoxLayout();
|
||||||
|
|
||||||
grid = new QGridLayout(this);
|
|
||||||
editor = new QHexEdit(this);
|
|
||||||
vbar = new QScrollBar( Qt::Vertical, this );
|
|
||||||
hbar = new QScrollBar( Qt::Horizontal, this );
|
|
||||||
|
|
||||||
grid->setMenuBar( menuBar );
|
grid->setMenuBar( menuBar );
|
||||||
|
|
||||||
|
@ -1430,7 +1449,8 @@ HexEditorDialog_t::HexEditorDialog_t(QWidget *parent)
|
||||||
|
|
||||||
connect( periodicTimer, &QTimer::timeout, this, &HexEditorDialog_t::updatePeriodic );
|
connect( periodicTimer, &QTimer::timeout, this, &HexEditorDialog_t::updatePeriodic );
|
||||||
|
|
||||||
periodicTimer->start( 100 ); // 10hz
|
//printf("Refresh Rate: %i\n", 1000 / refreshRateOpt );
|
||||||
|
periodicTimer->start( 1000 / refreshRateOpt );
|
||||||
|
|
||||||
// Lock the mutex before adding a new window to the list,
|
// Lock the mutex before adding a new window to the list,
|
||||||
// we want to be sure that the emulator is not iterating the list
|
// we want to be sure that the emulator is not iterating the list
|
||||||
|
@ -1742,54 +1762,67 @@ void HexEditorDialog_t::changeFontRequest(void)
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void HexEditorDialog_t::setViewRefresh5Hz(void)
|
void HexEditorDialog_t::setViewRefresh5Hz(void)
|
||||||
{
|
{
|
||||||
|
g_config->setOption("SDL.HexEditRefreshRate", 5);
|
||||||
periodicTimer->stop();
|
periodicTimer->stop();
|
||||||
periodicTimer->start(200);
|
periodicTimer->start(200);
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void HexEditorDialog_t::setViewRefresh10Hz(void)
|
void HexEditorDialog_t::setViewRefresh10Hz(void)
|
||||||
{
|
{
|
||||||
|
g_config->setOption("SDL.HexEditRefreshRate", 10);
|
||||||
periodicTimer->stop();
|
periodicTimer->stop();
|
||||||
periodicTimer->start(100);
|
periodicTimer->start(100);
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void HexEditorDialog_t::setViewRefresh20Hz(void)
|
void HexEditorDialog_t::setViewRefresh20Hz(void)
|
||||||
{
|
{
|
||||||
|
g_config->setOption("SDL.HexEditRefreshRate", 20);
|
||||||
periodicTimer->stop();
|
periodicTimer->stop();
|
||||||
periodicTimer->start(50);
|
periodicTimer->start(50);
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void HexEditorDialog_t::setViewRefresh30Hz(void)
|
void HexEditorDialog_t::setViewRefresh30Hz(void)
|
||||||
{
|
{
|
||||||
|
g_config->setOption("SDL.HexEditRefreshRate", 30);
|
||||||
periodicTimer->stop();
|
periodicTimer->stop();
|
||||||
periodicTimer->start(33);
|
periodicTimer->start(33);
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void HexEditorDialog_t::setViewRefresh60Hz(void)
|
void HexEditorDialog_t::setViewRefresh60Hz(void)
|
||||||
{
|
{
|
||||||
|
g_config->setOption("SDL.HexEditRefreshRate", 60);
|
||||||
periodicTimer->stop();
|
periodicTimer->stop();
|
||||||
periodicTimer->start(16);
|
periodicTimer->start(16);
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void HexEditorDialog_t::actvHighlightCB(bool enable)
|
void HexEditorDialog_t::actvHighlightCB(bool enable)
|
||||||
{
|
{
|
||||||
|
g_config->setOption("SDL.HexEditActivityHlgt", enable);
|
||||||
|
|
||||||
//printf("Highlight: %i \n", enable );
|
//printf("Highlight: %i \n", enable );
|
||||||
editor->setHighlightActivity( enable );
|
editor->setHighlightActivity( enable );
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void HexEditorDialog_t::actvHighlightRVCB(bool enable)
|
void HexEditorDialog_t::actvHighlightRVCB(bool enable)
|
||||||
{
|
{
|
||||||
|
g_config->setOption("SDL.HexEditReverseVideo", enable);
|
||||||
|
|
||||||
//printf("Highlight: %i \n", enable );
|
//printf("Highlight: %i \n", enable );
|
||||||
editor->setHighlightReverseVideo( enable );
|
editor->setHighlightReverseVideo( enable );
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void HexEditorDialog_t::rolColHlgtChanged(bool enable)
|
void HexEditorDialog_t::rolColHlgtChanged(bool enable)
|
||||||
{
|
{
|
||||||
|
g_config->setOption("SDL.HexEditRowColumnHlgt", enable);
|
||||||
|
|
||||||
//printf("Highlight: %i \n", enable );
|
//printf("Highlight: %i \n", enable );
|
||||||
editor->setRowColHlgtEna( enable );
|
editor->setRowColHlgtEna( enable );
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void HexEditorDialog_t::altColHlgtChanged(bool enable)
|
void HexEditorDialog_t::altColHlgtChanged(bool enable)
|
||||||
{
|
{
|
||||||
|
g_config->setOption("SDL.HexEditAltnColumnColor", enable);
|
||||||
|
|
||||||
//printf("Highlight: %i \n", enable );
|
//printf("Highlight: %i \n", enable );
|
||||||
editor->setAltColHlgtEna( enable );
|
editor->setAltColHlgtEna( enable );
|
||||||
}
|
}
|
||||||
|
|
|
@ -568,6 +568,11 @@ InitConfig()
|
||||||
config->addOption("SDL.HexEditCursorColorRC", "#000080");
|
config->addOption("SDL.HexEditCursorColorRC", "#000080");
|
||||||
config->addOption("SDL.HexEditAltColColor" , "#545454");
|
config->addOption("SDL.HexEditAltColColor" , "#545454");
|
||||||
config->addOption("SDL.HexEditFont" , "");
|
config->addOption("SDL.HexEditFont" , "");
|
||||||
|
config->addOption("SDL.HexEditActivityHlgt", true);
|
||||||
|
config->addOption("SDL.HexEditReverseVideo", true);
|
||||||
|
config->addOption("SDL.HexEditRowColumnHlgt", false);
|
||||||
|
config->addOption("SDL.HexEditAltnColumnColor", false);
|
||||||
|
config->addOption("SDL.HexEditRefreshRate", 10);
|
||||||
|
|
||||||
// Debugger Options
|
// Debugger Options
|
||||||
config->addOption("autoLoadDebugFiles" , "SDL.AutoLoadDebugFiles", 1);
|
config->addOption("autoLoadDebugFiles" , "SDL.AutoLoadDebugFiles", 1);
|
||||||
|
|
Loading…
Reference in New Issue