summaryrefslogtreecommitdiffstats
path: root/shemov.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'shemov.cpp')
-rw-r--r--shemov.cpp10
1 files changed, 7 insertions, 3 deletions
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("<span style=\"color:#008000\">%1</span>").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("<span style=\"color:#008000\">%1 (%2) MiB</span>").arg(selectedSize).arg(freeSize);
}else{
- val = QString("<span style=\"color:#ff0000\">%1</span>").arg(l.toString(size));
+ val = QString("<span style=\"color:#ff0000\">%1 (%2) MiB</span>").arg(selectedSize).arg(freeSize);
}
mSelectedSize->setText(val);
}