Added code to save/restore Qt window geometry for commonly used tools and debug windows.
This commit is contained in:
parent
d57cf3e35c
commit
7b1e171ba7
|
@ -29,6 +29,7 @@
|
|||
#include <QFileDialog>
|
||||
#include <QScreen>
|
||||
#include <QGuiApplication>
|
||||
#include <QSettings>
|
||||
|
||||
#include "../../types.h"
|
||||
#include "../../fceu.h"
|
||||
|
@ -69,6 +70,7 @@ void updateCheatDialog(void)
|
|||
GuiCheatsDialog_t::GuiCheatsDialog_t(QWidget *parent)
|
||||
: QDialog(parent, Qt::Window)
|
||||
{
|
||||
QSettings settings;
|
||||
QHBoxLayout *mainLayout, *hbox, *hbox1;
|
||||
QVBoxLayout *vbox, *vbox1, *vbox2, *vbox3;
|
||||
QTreeWidgetItem *item;
|
||||
|
@ -448,6 +450,8 @@ GuiCheatsDialog_t::GuiCheatsDialog_t(QWidget *parent)
|
|||
connect(exportCheatFileBtn, SIGNAL(clicked(void)), this, SLOT(saveCheatFile(void)));
|
||||
|
||||
showActiveCheatList(true);
|
||||
|
||||
restoreGeometry(settings.value("cheatsWindow/geometry").toByteArray());
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
GuiCheatsDialog_t::~GuiCheatsDialog_t(void)
|
||||
|
@ -460,12 +464,14 @@ GuiCheatsDialog_t::~GuiCheatsDialog_t(void)
|
|||
wasPausedByCheats = false;
|
||||
|
||||
win = NULL;
|
||||
printf("Destroy Cheat Window Event\n");
|
||||
//printf("Destroy Cheat Window Event\n");
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void GuiCheatsDialog_t::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
printf("Cheat Close Window Event\n");
|
||||
QSettings settings;
|
||||
//printf("Cheat Close Window Event\n");
|
||||
settings.setValue("cheatsWindow/geometry", saveGeometry());
|
||||
done(0);
|
||||
deleteLater();
|
||||
event->accept();
|
||||
|
@ -473,7 +479,9 @@ void GuiCheatsDialog_t::closeEvent(QCloseEvent *event)
|
|||
//----------------------------------------------------------------------------
|
||||
void GuiCheatsDialog_t::closeWindow(void)
|
||||
{
|
||||
QSettings settings;
|
||||
//printf("Close Window\n");
|
||||
settings.setValue("cheatsWindow/geometry", saveGeometry());
|
||||
done(0);
|
||||
deleteLater();
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
// CodeDataLogger.cpp
|
||||
//
|
||||
#include <QDir>
|
||||
#include <QSettings>
|
||||
#include <QFileDialog>
|
||||
#include <QInputDialog>
|
||||
#include <QMessageBox>
|
||||
|
@ -55,6 +56,7 @@ static int getDefaultCDLFile(char *filepath);
|
|||
CodeDataLoggerDialog_t::CodeDataLoggerDialog_t(QWidget *parent)
|
||||
: QDialog(parent, Qt::Window)
|
||||
{
|
||||
QSettings settings;
|
||||
QVBoxLayout *mainLayout, *vbox1, *vbox;
|
||||
QHBoxLayout *hbox;
|
||||
QGridLayout *grid;
|
||||
|
@ -261,18 +263,22 @@ CodeDataLoggerDialog_t::CodeDataLoggerDialog_t(QWidget *parent)
|
|||
getDefaultCDLFile(nameo);
|
||||
LoadCDLog(nameo);
|
||||
}
|
||||
|
||||
restoreGeometry(settings.value("cdLogger/geometry").toByteArray());
|
||||
}
|
||||
//----------------------------------------------------
|
||||
CodeDataLoggerDialog_t::~CodeDataLoggerDialog_t(void)
|
||||
{
|
||||
updateTimer->stop();
|
||||
|
||||
printf("Code Data Logger Window Deleted\n");
|
||||
//printf("Code Data Logger Window Deleted\n");
|
||||
}
|
||||
//----------------------------------------------------
|
||||
void CodeDataLoggerDialog_t::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
printf("Code Data Logger Close Window Event\n");
|
||||
QSettings settings;
|
||||
//printf("Code Data Logger Close Window Event\n");
|
||||
settings.setValue("cdLogger/geometry", saveGeometry());
|
||||
done(0);
|
||||
deleteLater();
|
||||
event->accept();
|
||||
|
@ -280,7 +286,9 @@ void CodeDataLoggerDialog_t::closeEvent(QCloseEvent *event)
|
|||
//----------------------------------------------------
|
||||
void CodeDataLoggerDialog_t::closeWindow(void)
|
||||
{
|
||||
printf("Code Data Logger Close Window\n");
|
||||
QSettings settings;
|
||||
//printf("Code Data Logger Close Window\n");
|
||||
settings.setValue("cdLogger/geometry", saveGeometry());
|
||||
done(0);
|
||||
deleteLater();
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include <QAction>
|
||||
#include <QActionGroup>
|
||||
#include <QGuiApplication>
|
||||
#include <QSettings>
|
||||
|
||||
#include "../../types.h"
|
||||
#include "../../fceu.h"
|
||||
|
@ -97,6 +98,7 @@ ConsoleDebugger::ConsoleDebugger(QWidget *parent)
|
|||
QTreeWidgetItem * item;
|
||||
int opt, useNativeMenuBar;
|
||||
fceuDecIntValidtor *validator;
|
||||
QSettings settings;
|
||||
|
||||
font.setFamily("Courier New");
|
||||
font.setStyle( QFont::StyleNormal );
|
||||
|
@ -687,13 +689,15 @@ ConsoleDebugger::ConsoleDebugger(QWidget *parent)
|
|||
loadGameDebugBreakpoints();
|
||||
}
|
||||
}
|
||||
|
||||
restoreGeometry(settings.value("debugger/geometry").toByteArray());
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
ConsoleDebugger::~ConsoleDebugger(void)
|
||||
{
|
||||
std::list <ConsoleDebugger*>::iterator it;
|
||||
|
||||
printf("Destroy Debugger Window\n");
|
||||
//printf("Destroy Debugger Window\n");
|
||||
periodicTimer->stop();
|
||||
|
||||
for (it = dbgWinList.begin(); it != dbgWinList.end(); it++)
|
||||
|
@ -701,7 +705,7 @@ ConsoleDebugger::~ConsoleDebugger(void)
|
|||
if ( (*it) == this )
|
||||
{
|
||||
dbgWinList.erase(it);
|
||||
printf("Removing Debugger Window\n");
|
||||
//printf("Removing Debugger Window\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -715,7 +719,9 @@ ConsoleDebugger::~ConsoleDebugger(void)
|
|||
//----------------------------------------------------------------------------
|
||||
void ConsoleDebugger::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
printf("Debugger Close Window Event\n");
|
||||
QSettings settings;
|
||||
//printf("Debugger Close Window Event\n");
|
||||
settings.setValue("debugger/geometry", saveGeometry());
|
||||
done(0);
|
||||
deleteLater();
|
||||
event->accept();
|
||||
|
@ -723,7 +729,9 @@ void ConsoleDebugger::closeEvent(QCloseEvent *event)
|
|||
//----------------------------------------------------------------------------
|
||||
void ConsoleDebugger::closeWindow(void)
|
||||
{
|
||||
QSettings settings;
|
||||
//printf("Close Window\n");
|
||||
settings.setValue("debugger/geometry", saveGeometry());
|
||||
done(0);
|
||||
deleteLater();
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QActionGroup>
|
||||
#include <QSettings>
|
||||
|
||||
#include "../../types.h"
|
||||
#include "../../fceu.h"
|
||||
|
@ -1085,6 +1086,7 @@ HexEditorDialog_t::HexEditorDialog_t(QWidget *parent)
|
|||
QAction *act, *actHlgt, *actHlgtRV, *actColorFG, *actColorBG;
|
||||
QActionGroup *group;
|
||||
int useNativeMenuBar;
|
||||
QSettings settings;
|
||||
|
||||
QDialog::setWindowTitle( tr("Hex Editor") );
|
||||
|
||||
|
@ -1429,6 +1431,8 @@ HexEditorDialog_t::HexEditorDialog_t(QWidget *parent)
|
|||
FCEUI_CreateCheatMap();
|
||||
|
||||
unloadTableAct->setEnabled( editor->charTable.customMapLoaded );
|
||||
|
||||
restoreGeometry(settings.value("hexEditor/geometry").toByteArray());
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
HexEditorDialog_t::~HexEditorDialog_t(void)
|
||||
|
@ -1522,7 +1526,9 @@ void HexEditorDialog_t::populateBookmarkMenu(void)
|
|||
//----------------------------------------------------------------------------
|
||||
void HexEditorDialog_t::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
printf("Hex Editor Close Window Event\n");
|
||||
QSettings settings;
|
||||
//printf("Hex Editor Close Window Event\n");
|
||||
settings.setValue("hexEditor/geometry", saveGeometry());
|
||||
done(0);
|
||||
deleteLater();
|
||||
event->accept();
|
||||
|
@ -1530,7 +1536,9 @@ void HexEditorDialog_t::closeEvent(QCloseEvent *event)
|
|||
//----------------------------------------------------------------------------
|
||||
void HexEditorDialog_t::closeWindow(void)
|
||||
{
|
||||
QSettings settings;
|
||||
//printf("Close Window\n");
|
||||
settings.setValue("hexEditor/geometry", saveGeometry());
|
||||
done(0);
|
||||
deleteLater();
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <QInputDialog>
|
||||
#include <QColorDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QSettings>
|
||||
|
||||
#include "../../types.h"
|
||||
#include "../../fceu.h"
|
||||
|
@ -132,6 +133,7 @@ static int conv2hex( int i )
|
|||
ppuNameTableViewerDialog_t::ppuNameTableViewerDialog_t(QWidget *parent)
|
||||
: QDialog( parent, Qt::Window )
|
||||
{
|
||||
QSettings settings;
|
||||
QHBoxLayout *mainLayout;
|
||||
QVBoxLayout *vbox1, *vbox2, *vbox3;
|
||||
QHBoxLayout *hbox, *hbox1;
|
||||
|
@ -530,6 +532,8 @@ ppuNameTableViewerDialog_t::ppuNameTableViewerDialog_t(QWidget *parent)
|
|||
|
||||
updateMirrorText();
|
||||
refreshMenuSelections();
|
||||
|
||||
restoreGeometry(settings.value("ntViewer/geometry").toByteArray());
|
||||
}
|
||||
//----------------------------------------------------
|
||||
ppuNameTableViewerDialog_t::~ppuNameTableViewerDialog_t(void)
|
||||
|
@ -537,12 +541,14 @@ ppuNameTableViewerDialog_t::~ppuNameTableViewerDialog_t(void)
|
|||
updateTimer->stop();
|
||||
nameTableViewWindow = NULL;
|
||||
|
||||
printf("Name Table Viewer Window Deleted\n");
|
||||
//printf("Name Table Viewer Window Deleted\n");
|
||||
}
|
||||
//----------------------------------------------------
|
||||
void ppuNameTableViewerDialog_t::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
printf("Name Table Viewer Close Window Event\n");
|
||||
QSettings settings;
|
||||
//printf("Name Table Viewer Close Window Event\n");
|
||||
settings.setValue("ntViewer/geometry", saveGeometry());
|
||||
done(0);
|
||||
deleteLater();
|
||||
event->accept();
|
||||
|
@ -550,7 +556,9 @@ void ppuNameTableViewerDialog_t::closeEvent(QCloseEvent *event)
|
|||
//----------------------------------------------------
|
||||
void ppuNameTableViewerDialog_t::closeWindow(void)
|
||||
{
|
||||
printf("Close Window\n");
|
||||
QSettings settings;
|
||||
//printf("Close Window\n");
|
||||
settings.setValue("ntViewer/geometry", saveGeometry());
|
||||
done(0);
|
||||
deleteLater();
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#include <QAction>
|
||||
#include <QSettings>
|
||||
#include <QCloseEvent>
|
||||
#include <QFileDialog>
|
||||
#include <QColorDialog>
|
||||
|
@ -63,6 +64,7 @@ static std::vector <colorChangeData_t> redoColorHistory;
|
|||
PaletteEditorDialog_t::PaletteEditorDialog_t(QWidget *parent)
|
||||
: QDialog( parent )
|
||||
{
|
||||
QSettings settings;
|
||||
QVBoxLayout *mainLayout;
|
||||
QMenuBar *menuBar;
|
||||
QMenu *fileMenu, *editMenu, *memMenu, *subMenu;
|
||||
|
@ -177,11 +179,13 @@ PaletteEditorDialog_t::PaletteEditorDialog_t(QWidget *parent)
|
|||
connect(updateTimer, &QTimer::timeout, this, &PaletteEditorDialog_t::updatePeriodic);
|
||||
|
||||
updateTimer->start(500); // 2hz
|
||||
|
||||
restoreGeometry(settings.value("paletteEditor/geometry").toByteArray());
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
PaletteEditorDialog_t::~PaletteEditorDialog_t(void)
|
||||
{
|
||||
printf("Destroy Palette Editor Config Window\n");
|
||||
//printf("Destroy Palette Editor Config Window\n");
|
||||
|
||||
updateTimer->stop();
|
||||
|
||||
|
@ -191,7 +195,9 @@ PaletteEditorDialog_t::~PaletteEditorDialog_t(void)
|
|||
//----------------------------------------------------------------------------
|
||||
void PaletteEditorDialog_t::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
QSettings settings;
|
||||
//printf("Palette Editor Close Window Event\n");
|
||||
settings.setValue("paletteEditor/geometry", saveGeometry());
|
||||
done(0);
|
||||
deleteLater();
|
||||
event->accept();
|
||||
|
@ -199,7 +205,9 @@ void PaletteEditorDialog_t::closeEvent(QCloseEvent *event)
|
|||
//----------------------------------------------------------------------------
|
||||
void PaletteEditorDialog_t::closeWindow(void)
|
||||
{
|
||||
QSettings settings;
|
||||
//printf("Close Window\n");
|
||||
settings.setValue("paletteEditor/geometry", saveGeometry());
|
||||
done(0);
|
||||
deleteLater();
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <SDL.h>
|
||||
#include <QMenuBar>
|
||||
#include <QAction>
|
||||
#include <QSettings>
|
||||
#include <QHeaderView>
|
||||
#include <QCloseEvent>
|
||||
#include <QGroupBox>
|
||||
|
@ -68,6 +69,7 @@ void openRamWatchWindow( QWidget *parent, int force )
|
|||
RamWatchDialog_t::RamWatchDialog_t(QWidget *parent)
|
||||
: QDialog( parent, Qt::Window )
|
||||
{
|
||||
QSettings settings;
|
||||
QMenuBar *menuBar;
|
||||
QHBoxLayout *mainLayout;
|
||||
QVBoxLayout *vbox, *vbox1;
|
||||
|
@ -303,6 +305,8 @@ RamWatchDialog_t::RamWatchDialog_t(QWidget *parent)
|
|||
connect( updateTimer, &QTimer::timeout, this, &RamWatchDialog_t::periodicUpdate );
|
||||
|
||||
updateTimer->start( 100 ); // 10hz
|
||||
|
||||
restoreGeometry(settings.value("ramWatch/geometry").toByteArray());
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
RamWatchDialog_t::~RamWatchDialog_t(void)
|
||||
|
@ -318,7 +322,9 @@ RamWatchDialog_t::~RamWatchDialog_t(void)
|
|||
//----------------------------------------------------------------------------
|
||||
void RamWatchDialog_t::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
printf("RAM Watch Close Window Event\n");
|
||||
QSettings settings;
|
||||
//printf("RAM Watch Close Window Event\n");
|
||||
settings.setValue("ramWatch/geometry", saveGeometry());
|
||||
done(0);
|
||||
deleteLater();
|
||||
event->accept();
|
||||
|
@ -326,7 +332,9 @@ void RamWatchDialog_t::closeEvent(QCloseEvent *event)
|
|||
//----------------------------------------------------------------------------
|
||||
void RamWatchDialog_t::closeWindow(void)
|
||||
{
|
||||
QSettings settings;
|
||||
//printf("Close Window\n");
|
||||
settings.setValue("ramWatch/geometry", saveGeometry());
|
||||
done(0);
|
||||
deleteLater();
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#include <QAction>
|
||||
#include <QSettings>
|
||||
#include <QFileDialog>
|
||||
#include <QInputDialog>
|
||||
#include <QMessageBox>
|
||||
|
@ -140,6 +141,7 @@ static void initLogOption( const char *name, int bitmask )
|
|||
TraceLoggerDialog_t::TraceLoggerDialog_t(QWidget *parent)
|
||||
: QDialog(parent, Qt::Window)
|
||||
{
|
||||
QSettings settings;
|
||||
QVBoxLayout *mainLayout;
|
||||
QHBoxLayout *hbox;
|
||||
QGridLayout *grid;
|
||||
|
@ -361,6 +363,8 @@ TraceLoggerDialog_t::TraceLoggerDialog_t(QWidget *parent)
|
|||
updateTimer->start(50); // 20hz
|
||||
|
||||
diskThread = new TraceLogDiskThread_t(this);
|
||||
|
||||
restoreGeometry(settings.value("traceLogger/geometry").toByteArray());
|
||||
}
|
||||
//----------------------------------------------------
|
||||
TraceLoggerDialog_t::~TraceLoggerDialog_t(void)
|
||||
|
@ -380,7 +384,9 @@ TraceLoggerDialog_t::~TraceLoggerDialog_t(void)
|
|||
//----------------------------------------------------
|
||||
void TraceLoggerDialog_t::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
printf("Trace Logger Close Window Event\n");
|
||||
QSettings settings;
|
||||
//printf("Trace Logger Close Window Event\n");
|
||||
settings.setValue("traceLogger/geometry", saveGeometry());
|
||||
done(0);
|
||||
deleteLater();
|
||||
event->accept();
|
||||
|
@ -388,7 +394,9 @@ void TraceLoggerDialog_t::closeEvent(QCloseEvent *event)
|
|||
//----------------------------------------------------
|
||||
void TraceLoggerDialog_t::closeWindow(void)
|
||||
{
|
||||
printf("Trace Logger Close Window\n");
|
||||
QSettings settings;
|
||||
//printf("Trace Logger Close Window\n");
|
||||
settings.setValue("traceLogger/geometry", saveGeometry());
|
||||
done(0);
|
||||
deleteLater();
|
||||
}
|
||||
|
@ -2314,7 +2322,11 @@ void TraceLogDiskThread_t::run(void)
|
|||
DWORD bytesWritten;
|
||||
WriteFile( logFile, buf, idx, &bytesWritten, NULL ); idx = 0;
|
||||
#else
|
||||
write( logFile, buf, idx ); idx = 0;
|
||||
if ( write( logFile, buf, idx ) < 0 )
|
||||
{
|
||||
// HANDLE ERROR TODO
|
||||
}
|
||||
idx = 0;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -2327,7 +2339,11 @@ void TraceLogDiskThread_t::run(void)
|
|||
DWORD bytesWritten;
|
||||
WriteFile( logFile, buf, idx, &bytesWritten, NULL ); idx = 0;
|
||||
#else
|
||||
write( logFile, buf, idx ); idx = 0;
|
||||
if ( write( logFile, buf, idx ) < 0 )
|
||||
{
|
||||
// HANDLE ERROR TODO
|
||||
}
|
||||
idx = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -87,6 +87,10 @@ int main( int argc, char *argv[] )
|
|||
QApplication app(argc, argv);
|
||||
//const char *styleSheetEnv = NULL;
|
||||
|
||||
QCoreApplication::setOrganizationName("TasVideos");
|
||||
QCoreApplication::setOrganizationDomain("TasVideos.org");
|
||||
QCoreApplication::setApplicationName("fceux");
|
||||
|
||||
#ifdef WIN32
|
||||
if (AttachConsole(ATTACH_PARENT_PROCESS))
|
||||
{
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <QAction>
|
||||
#include <QMenuBar>
|
||||
#include <QPainter>
|
||||
#include <QSettings>
|
||||
#include <QFileDialog>
|
||||
#include <QInputDialog>
|
||||
#include <QColorDialog>
|
||||
|
@ -193,6 +194,7 @@ static int exportActivePaletteACT( const char *filename )
|
|||
ppuViewerDialog_t::ppuViewerDialog_t(QWidget *parent)
|
||||
: QDialog( parent, Qt::Window )
|
||||
{
|
||||
QSettings settings;
|
||||
QMenuBar *menuBar;
|
||||
QVBoxLayout *mainLayout, *vbox;
|
||||
QVBoxLayout *patternVbox[2];
|
||||
|
@ -437,6 +439,8 @@ ppuViewerDialog_t::ppuViewerDialog_t(QWidget *parent)
|
|||
connect( updateTimer, &QTimer::timeout, this, &ppuViewerDialog_t::periodicUpdate );
|
||||
|
||||
updateTimer->start( 33 ); // 30hz
|
||||
|
||||
restoreGeometry(settings.value("ppuViewer/geometry").toByteArray());
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
|
@ -450,7 +454,9 @@ ppuViewerDialog_t::~ppuViewerDialog_t(void)
|
|||
//----------------------------------------------------
|
||||
void ppuViewerDialog_t::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
printf("PPU Viewer Close Window Event\n");
|
||||
QSettings settings;
|
||||
//printf("PPU Viewer Close Window Event\n");
|
||||
settings.setValue("ppuViewer/geometry", saveGeometry());
|
||||
done(0);
|
||||
deleteLater();
|
||||
event->accept();
|
||||
|
@ -458,7 +464,9 @@ void ppuViewerDialog_t::closeEvent(QCloseEvent *event)
|
|||
//----------------------------------------------------
|
||||
void ppuViewerDialog_t::closeWindow(void)
|
||||
{
|
||||
printf("Close Window\n");
|
||||
QSettings settings;
|
||||
//printf("Close Window\n");
|
||||
settings.setValue("ppuViewer/geometry", saveGeometry());
|
||||
done(0);
|
||||
deleteLater();
|
||||
}
|
||||
|
@ -2791,6 +2799,7 @@ void ppuTileEditColorPicker_t::paintEvent(QPaintEvent *event)
|
|||
spriteViewerDialog_t::spriteViewerDialog_t(QWidget *parent)
|
||||
: QDialog(parent, Qt::Window)
|
||||
{
|
||||
QSettings settings;
|
||||
QMenuBar *menuBar;
|
||||
QVBoxLayout *mainLayout, *vbox, *vbox1, *vbox2, *vbox3;
|
||||
QHBoxLayout *hbox, *hbox1, *hbox2;
|
||||
|
@ -3058,6 +3067,8 @@ spriteViewerDialog_t::spriteViewerDialog_t(QWidget *parent)
|
|||
updateTimer->start( 33 ); // 30hz
|
||||
|
||||
resize( minimumSizeHint() );
|
||||
|
||||
restoreGeometry(settings.value("spriteViewer/geometry").toByteArray());
|
||||
}
|
||||
//----------------------------------------------------
|
||||
spriteViewerDialog_t::~spriteViewerDialog_t(void)
|
||||
|
@ -3070,7 +3081,9 @@ spriteViewerDialog_t::~spriteViewerDialog_t(void)
|
|||
//----------------------------------------------------
|
||||
void spriteViewerDialog_t::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
printf("Sprite Viewer Close Window Event\n");
|
||||
QSettings settings;
|
||||
//printf("Sprite Viewer Close Window Event\n");
|
||||
settings.setValue("spriteViewer/geometry", saveGeometry());
|
||||
done(0);
|
||||
deleteLater();
|
||||
event->accept();
|
||||
|
@ -3078,7 +3091,9 @@ void spriteViewerDialog_t::closeEvent(QCloseEvent *event)
|
|||
//----------------------------------------------------
|
||||
void spriteViewerDialog_t::closeWindow(void)
|
||||
{
|
||||
printf("Close Window\n");
|
||||
QSettings settings;
|
||||
//printf("Close Window\n");
|
||||
settings.setValue("spriteViewer/geometry", saveGeometry());
|
||||
done(0);
|
||||
deleteLater();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue