From 99f385ecf3a443f2e99c5e418dc285490860a088 Mon Sep 17 00:00:00 2001 From: Stephen White Date: Tue, 12 Jun 2018 19:17:00 +1000 Subject: [PATCH] "Saving Complete" message is now displayed only if disk images were written back --- src/DiskCaddy.cpp | 3 ++- src/DiskCaddy.h | 2 +- src/main.cpp | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/DiskCaddy.cpp b/src/DiskCaddy.cpp index 92e1143..871cfac 100644 --- a/src/DiskCaddy.cpp +++ b/src/DiskCaddy.cpp @@ -32,7 +32,7 @@ static char buffer[256] = { 0 }; static u32 white = RGBA(0xff, 0xff, 0xff, 0xff); static u32 red = RGBA(0xff, 0, 0, 0xff); -void DiskCaddy::Empty() +bool DiskCaddy::Empty() { int x; int y; @@ -100,6 +100,7 @@ void DiskCaddy::Empty() disks.clear(); selectedIndex = 0; + return anyDirty; } bool DiskCaddy::Insert(const FILINFO* fileInfo, bool readOnly) diff --git a/src/DiskCaddy.h b/src/DiskCaddy.h index d86e5e0..567139b 100644 --- a/src/DiskCaddy.h +++ b/src/DiskCaddy.h @@ -35,7 +35,7 @@ public: void SetScreen(Screen* screen, ScreenBase* screenLCD) { this->screen = screen; this->screenLCD = screenLCD; } - void Empty(); + bool Empty(); bool Insert(const FILINFO* fileInfo, bool readOnly); diff --git a/src/main.cpp b/src/main.cpp index 2b18c59..220072c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -867,8 +867,8 @@ void emulator() // - will write back all changed/dirty/written to disk images now // - TDOO: need to display the image names as they write back // - pass in a call back function? - diskCaddy.Empty(); - IEC_Bus::WaitMicroSeconds(2 * 1000000); + if (diskCaddy.Empty()) + IEC_Bus::WaitMicroSeconds(2 * 1000000); fileBrowser->ClearSelections(); fileBrowser->RefeshDisplay(); // Just redisplay the current folder.