Making sure that all Tools windows have their geometry saved and recalled for Qt GUI.
This commit is contained in:
parent
20d69ffa9f
commit
8b59b85be8
|
@ -456,6 +456,8 @@ GuiCheatsDialog_t::GuiCheatsDialog_t(QWidget *parent)
|
|||
//----------------------------------------------------------------------------
|
||||
GuiCheatsDialog_t::~GuiCheatsDialog_t(void)
|
||||
{
|
||||
QSettings settings;
|
||||
|
||||
if (EmulationPaused && wasPausedByCheats)
|
||||
{
|
||||
EmulationPaused = 0;
|
||||
|
@ -463,6 +465,8 @@ GuiCheatsDialog_t::~GuiCheatsDialog_t(void)
|
|||
}
|
||||
wasPausedByCheats = false;
|
||||
|
||||
settings.setValue("cheatsWindow/geometry", saveGeometry());
|
||||
|
||||
win = NULL;
|
||||
//printf("Destroy Cheat Window Event\n");
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <SDL.h>
|
||||
#include <QHeaderView>
|
||||
#include <QCloseEvent>
|
||||
#include <QSettings>
|
||||
|
||||
#include "Qt/main.h"
|
||||
#include "Qt/dface.h"
|
||||
|
@ -46,6 +47,7 @@ FrameTimingDialog_t::FrameTimingDialog_t(QWidget *parent)
|
|||
QTreeWidgetItem *item;
|
||||
QPushButton *resetBtn, *closeButton;
|
||||
struct frameTimingStat_t stats;
|
||||
QSettings settings;
|
||||
|
||||
getFrameTimingStats(&stats);
|
||||
|
||||
|
@ -165,17 +167,23 @@ FrameTimingDialog_t::FrameTimingDialog_t(QWidget *parent)
|
|||
connect(updateTimer, &QTimer::timeout, this, &FrameTimingDialog_t::updatePeriodic);
|
||||
|
||||
updateTimer->start(200); // 5hz
|
||||
|
||||
restoreGeometry(settings.value("frameTimingWindow/geometry").toByteArray());
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
FrameTimingDialog_t::~FrameTimingDialog_t(void)
|
||||
{
|
||||
printf("Destroy Frame Timing Window\n");
|
||||
QSettings settings;
|
||||
|
||||
//printf("Destroy Frame Timing Window\n");
|
||||
updateTimer->stop();
|
||||
|
||||
settings.setValue("frameTimingWindow/geometry", saveGeometry());
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void FrameTimingDialog_t::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
printf("Frame Timing Close Window Event\n");
|
||||
//printf("Frame Timing Close Window Event\n");
|
||||
done(0);
|
||||
deleteLater();
|
||||
event->accept();
|
||||
|
|
|
@ -185,12 +185,15 @@ PaletteEditorDialog_t::PaletteEditorDialog_t(QWidget *parent)
|
|||
//----------------------------------------------------------------------------
|
||||
PaletteEditorDialog_t::~PaletteEditorDialog_t(void)
|
||||
{
|
||||
QSettings settings;
|
||||
//printf("Destroy Palette Editor Config Window\n");
|
||||
|
||||
updateTimer->stop();
|
||||
|
||||
undoColorHistory.clear();
|
||||
redoColorHistory.clear();
|
||||
|
||||
settings.setValue("paletteEditor/geometry", saveGeometry());
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void PaletteEditorDialog_t::closeEvent(QCloseEvent *event)
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include <QFileDialog>
|
||||
#include <QValidator>
|
||||
#include <QPainter>
|
||||
#include <QSettings>
|
||||
|
||||
#include "../../types.h"
|
||||
#include "../../fceu.h"
|
||||
|
@ -210,6 +211,7 @@ RamSearchDialog_t::RamSearchDialog_t(QWidget *parent)
|
|||
QMenu *fileMenu;
|
||||
QAction *act;
|
||||
int useNativeMenuBar;
|
||||
QSettings settings;
|
||||
|
||||
setWindowTitle("RAM Search");
|
||||
|
||||
|
@ -483,12 +485,16 @@ RamSearchDialog_t::RamSearchDialog_t(QWidget *parent)
|
|||
connect(updateTimer, &QTimer::timeout, this, &RamSearchDialog_t::periodicUpdate);
|
||||
|
||||
updateTimer->start(8); // ~120hz
|
||||
|
||||
restoreGeometry(settings.value("ramSearchWindow/geometry").toByteArray());
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
RamSearchDialog_t::~RamSearchDialog_t(void)
|
||||
{
|
||||
QSettings settings;
|
||||
|
||||
updateTimer->stop();
|
||||
printf("Destroy RAM Search Window\n");
|
||||
//printf("Destroy RAM Search Window\n");
|
||||
ramSearchWin = NULL;
|
||||
|
||||
actvSrchList.clear();
|
||||
|
@ -499,6 +505,7 @@ RamSearchDialog_t::~RamSearchDialog_t(void)
|
|||
{
|
||||
memLoc[addr].hist.clear();
|
||||
}
|
||||
settings.setValue("ramSearchWindow/geometry", saveGeometry());
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void RamSearchDialog_t::closeEvent(QCloseEvent *event)
|
||||
|
|
|
@ -311,13 +311,17 @@ RamWatchDialog_t::RamWatchDialog_t(QWidget *parent)
|
|||
//----------------------------------------------------------------------------
|
||||
RamWatchDialog_t::~RamWatchDialog_t(void)
|
||||
{
|
||||
QSettings settings;
|
||||
|
||||
updateTimer->stop();
|
||||
|
||||
if ( ramWatchMainWin == this )
|
||||
{
|
||||
ramWatchMainWin = NULL;
|
||||
}
|
||||
printf("Destroy RAM Watch Config Window\n");
|
||||
settings.setValue("ramWatch/geometry", saveGeometry());
|
||||
|
||||
//printf("Destroy RAM Watch Config Window\n");
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void RamWatchDialog_t::closeEvent(QCloseEvent *event)
|
||||
|
|
Loading…
Reference in New Issue