From 0d658156b36739963e5ef64ad5d75aef9472e0b4 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 10 Oct 2019 12:39:07 +0100 Subject: [PATCH] Add a finishing dialog when recompressing a capture --- qrenderdoc/Code/CaptureContext.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/qrenderdoc/Code/CaptureContext.cpp b/qrenderdoc/Code/CaptureContext.cpp index efe957456..e09f6d26c 100644 --- a/qrenderdoc/Code/CaptureContext.cpp +++ b/qrenderdoc/Code/CaptureContext.cpp @@ -1000,6 +1000,8 @@ void CaptureContext::RecompressCapture() QString destFilename = GetCaptureFilename(); QString tempFilename; + qint64 oldSize = QFile(destFilename).size(); + ICaptureFile *cap = NULL; ICaptureFile *tempCap = NULL; @@ -1141,6 +1143,15 @@ void CaptureContext::RecompressCapture() m_MainWindow->RemoveRecentCapture(tempFilename); QFile::remove(tempFilename); } + + qint64 newSize = QFile(m_CaptureFile).size(); + + RDDialog::information( + m_MainWindow, tr("Capture recompressed"), + tr("Compression successful, capture is %1% of the original size: %2 MB -> %3 MB") + .arg(double(newSize * 100) / double(oldSize), 0, 'f', 2) + .arg(double(oldSize) / (1024.0 * 1024.0), 0, 'f', 1) + .arg(double(newSize) / (1024.0 * 1024.0), 0, 'f', 1)); } bool CaptureContext::SaveCaptureTo(const rdcstr &captureFile)