FIFOPlayerWindow: Save and restore window geometry

Aside from allowing users to persistently set the window to their
desired size, this is also necessary to allow saving of the splitter
positions in FIFOAnalyzer to work correctly.
This commit is contained in:
Dentomologist
2025-08-17 13:44:13 -07:00
parent 99be30c0e1
commit 1841c151c4

View File

@@ -83,6 +83,8 @@ FIFOPlayerWindow::FIFOPlayerWindow(FifoPlayer& fifo_player, FifoRecorder& fifo_r
FIFOPlayerWindow::~FIFOPlayerWindow() FIFOPlayerWindow::~FIFOPlayerWindow()
{ {
Settings::GetQSettings().setValue(QStringLiteral("fifoplayerwindow/geometry"), saveGeometry());
m_fifo_player.SetFileLoadedCallback({}); m_fifo_player.SetFileLoadedCallback({});
m_fifo_player.SetFrameWrittenCallback({}); m_fifo_player.SetFrameWrittenCallback({});
} }
@@ -189,6 +191,9 @@ void FIFOPlayerWindow::CreateWidgets()
void FIFOPlayerWindow::LoadSettings() void FIFOPlayerWindow::LoadSettings()
{ {
restoreGeometry(
Settings::GetQSettings().value(QStringLiteral("fifoplayerwindow/geometry")).toByteArray());
m_early_memory_updates->setChecked(Config::Get(Config::MAIN_FIFOPLAYER_EARLY_MEMORY_UPDATES)); m_early_memory_updates->setChecked(Config::Get(Config::MAIN_FIFOPLAYER_EARLY_MEMORY_UPDATES));
m_loop->setChecked(Config::Get(Config::MAIN_FIFOPLAYER_LOOP_REPLAY)); m_loop->setChecked(Config::Get(Config::MAIN_FIFOPLAYER_LOOP_REPLAY));
} }