summaryrefslogtreecommitdiffstats
path: root/shemov.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2011-05-22 10:37:05 +0200
committerArno <am@disconnect.de>2011-05-22 10:37:05 +0200
commit547cb6e2b19ba766d104e338d3501289f60489da (patch)
tree06c873ee059909f1ddb3e7b0ec49eec072da8cbc /shemov.cpp
parent880ada0d1d52b16f12c22f8b9efce0985b93fe76 (diff)
downloadSheMov-547cb6e2b19ba766d104e338d3501289f60489da.tar.gz
SheMov-547cb6e2b19ba766d104e338d3501289f60489da.tar.bz2
SheMov-547cb6e2b19ba766d104e338d3501289f60489da.zip
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.
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);
}