]> code.delx.au - refind/commitdiff
Support for multiple screen shot files using screenshot_###.bmp
authorsrs5694 <srs5694@users.sourceforge.net>
Fri, 26 Apr 2013 23:22:31 +0000 (19:22 -0400)
committersrs5694 <srs5694@users.sourceforge.net>
Fri, 26 Apr 2013 23:22:31 +0000 (19:22 -0400)
filenames.

NEWS.txt
docs/refind/using.html
install.sh
libeg/image.c
libeg/libeg.h
libeg/screen.c
refind/main.c

index f813b2e1f26ac3eff42b30d8ae42d173e6076f03..afadc1816741a63f9fe478ce317416f272796b5f 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,3 +1,13 @@
+0.6.10 (?/??/2013):
+-------------------
+
+- Replaced hexadecimal error code with description if an error is
+  encountered when saving a screen shot.
+
+- Enable multiple screen shots: Rather than naming all screen shots
+  "screenshot.bmp", the name is now "screenshot_###.bmp", where "###" is a
+  sequence number, starting with "001".
+
 0.6.9 (4/25/2013):
 ------------------
 
index 091e6700612a048c6cf3948de5cd2e8ab3063801..b7b693377e35e04294b941de02bd118ab009909e 100644 (file)
@@ -266,7 +266,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 </tr>
 <tr>
    <td><i>F10</i></td>
-   <td>Saves an image of the current screen in the file <tt>screenshot.bmp</tt> in the ESP's root directory</td>
+   <td>Saves an image of the current screen in the file <tt>screenshot_<tt class="variable">###</tt>.bmp</tt>, where <tt class="variable">###</tt> is a sequence number starting with <tt>001</tt>, in the ESP's root directory</td>
 </tr>
 <tr>
    <td><i>F12</i> or (on some keyboards) <i>Eject</i></td>
index 66d3e9ce8ccb7e3dde9e710fb3faf5aa9ff90748..1d722e84570fc5a3dd5e04c5c05c9123bf8b5d4d 100755 (executable)
@@ -29,7 +29,7 @@
 #
 # Revision history:
 #
-# 0.6.9   -- Install gptsync on Macs if evidence of Windows found
+# 0.6.9   -- Install gptsync on Macs
 # 0.6.8   -- Bug fix: ESP scan now uses "uniq".
 # 0.6.6   -- Bug fix: Upgrade drivers when installed to EFI/BOOT. Also enable
 #            copying shim.efi and MokManager.efi over themselves.
index c529da931b9212d0a1ec8c7ea3a108660dad2b73..8b6078d5074c19444b78648431969041ffe6bc08 100644 (file)
@@ -175,7 +175,7 @@ EFI_STATUS egLoadFile(IN EFI_FILE* BaseDir, IN CHAR16 *FileName, OUT UINT8 **Fil
 
 static EFI_GUID ESPGuid = { 0xc12a7328, 0xf81f, 0x11d2, { 0xba, 0x4b, 0x00, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b } };
 
-static EFI_STATUS egFindESP(OUT EFI_FILE_HANDLE *RootDir)
+EFI_STATUS egFindESP(OUT EFI_FILE_HANDLE *RootDir)
 {
     EFI_STATUS          Status;
     UINTN               HandleCount = 0;
index 0275410825f9ed232935281d258c933e957e28d8..80731e4d99bc888981929a3c87b9dafc9d008237 100644 (file)
@@ -112,6 +112,7 @@ EG_IMAGE * egEnsureImageSize(IN EG_IMAGE *Image, IN UINTN Width, IN UINTN Height
 
 EFI_STATUS egLoadFile(IN EFI_FILE* BaseDir, IN CHAR16 *FileName,
                       OUT UINT8 **FileData, OUT UINTN *FileDataLength);
+EFI_STATUS egFindESP(OUT EFI_FILE_HANDLE *RootDir);
 EFI_STATUS egSaveFile(IN EFI_FILE* BaseDir OPTIONAL, IN CHAR16 *FileName,
                       IN UINT8 *FileData, IN UINTN FileDataLength);
 
index 9049d85ba224914a862264da5daa470261c895bf..4b9c580c52e84984316f60dd80dde03417173af9 100644 (file)
@@ -46,6 +46,7 @@
 #include "../refind/screen.h"
 #include "../refind/lib.h"
 #include "../include/refit_call_wrapper.h"
+#include "libeg.h"
 
 #include <efiUgaDraw.h>
 #include <efiConsoleControl.h>
@@ -477,6 +478,9 @@ VOID egScreenShot(VOID)
     UINT8           *FileData;
     UINTN           FileDataLength;
     UINTN           Index;
+    UINTN           ssNum;
+    CHAR16          Filename[80];
+    EFI_FILE*       BaseDir;
 
     Image = egCopyScreen();
     if (Image == NULL) {
@@ -492,11 +496,20 @@ VOID egScreenShot(VOID)
         goto bailout_wait;
     }
 
+    Status = egFindESP(&BaseDir);
+    if (EFI_ERROR(Status))
+        return;
+
+    // Search for existing screen shot files; increment number to an unused value...
+    ssNum = 001;
+    do {
+       SPrint(Filename, 80, L"screenshot_%03d.bmp", ssNum++);
+    } while (FileExists(BaseDir, Filename));
+
     // save to file on the ESP
-    Status = egSaveFile(NULL, L"screenshot.bmp", FileData, FileDataLength);
+    Status = egSaveFile(BaseDir, Filename, FileData, FileDataLength);
     FreePool(FileData);
-    if (EFI_ERROR(Status)) {
-        Print(L"Error egSaveFile: %x\n", Status);
+    if (CheckError(Status, L"in egSaveFile()")) {
         goto bailout_wait;
     }
 
index f0803a59af5eeb89c59d761a6878f246b2344063..cca2d1825c2fabc537912e7793978b8cdc2a2e7e 100644 (file)
@@ -135,7 +135,7 @@ static VOID AboutrEFInd(VOID)
 
     if (AboutMenu.EntryCount == 0) {
         AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
-        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.6.9");
+        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.6.9.1");
         AddMenuInfoLine(&AboutMenu, L"");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2013 Roderick W. Smith");