From 547cb6e2b19ba766d104e338d3501289f60489da Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 22 May 2011 10:37:05 +0200 Subject: Display size in MiB Display size of selected files in MiB in the status bar. Also show bytes free if the selected files would be burned to a DVD. --- shemov.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'shemov.cpp') diff --git a/shemov.cpp b/shemov.cpp index 212642b..96e2399 100644 --- a/shemov.cpp +++ b/shemov.cpp @@ -278,10 +278,14 @@ void SheMov::newMovieWizardWithFiles(){ void SheMov::setSize(qint64 size){ QLocale l; QString val; - if(size < Q_INT64_C(4707319808)){ - val = QString("%1").arg(l.toString(size)); + const qint64 dvdSize = Q_INT64_C(4707319808); + qint64 free = dvdSize - size; + QString selectedSize = l.toString(size / 1024.0 / 1024.0, 'f', 2); + QString freeSize = l.toString(free / 1024.0 / 1024.0, 'f', 2); + if(size < dvdSize){ + val = QString("%1 (%2) MiB").arg(selectedSize).arg(freeSize); }else{ - val = QString("%1").arg(l.toString(size)); + val = QString("%1 (%2) MiB").arg(selectedSize).arg(freeSize); } mSelectedSize->setText(val); } -- cgit v1.2.3-70-g09d2