summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/sysinfo.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2008-12-13 20:09:31 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2008-12-13 20:09:31 +0000
commitbc7917daeb494de9c17d2daf779c7cd612329e35 (patch)
tree659bc54c9779050750db51e3d6b32d0b4db4475a /rbutil/rbutilqt/sysinfo.cpp
parentb42f379fa3f354ccc94266604bd30ac4f7ad70de (diff)
downloadrockbox-bc7917daeb494de9c17d2daf779c7cd612329e35.tar.gz
rockbox-bc7917daeb494de9c17d2daf779c7cd612329e35.tar.bz2
rockbox-bc7917daeb494de9c17d2daf779c7cd612329e35.zip
Make Rockbox Utility error out if the zip file its going to install requires more space than left on the device. Calculation adds a safety space of 1MB so you need at least 1MB more free space than the extracted archive. This also catches differences due to the size calculation not taking cluster losses into account. Free disk space is also displayed in the sysinfo dialog. Fixes FS#9417.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19428 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/sysinfo.cpp')
-rw-r--r--rbutil/rbutilqt/sysinfo.cpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/rbutil/rbutilqt/sysinfo.cpp b/rbutil/rbutilqt/sysinfo.cpp
index 7ca4b8585c..9a4c8b75b0 100644
--- a/rbutil/rbutilqt/sysinfo.cpp
+++ b/rbutil/rbutilqt/sysinfo.cpp
@@ -21,6 +21,8 @@
#include "sysinfo.h"
#include "ui_sysinfofrm.h"
#include "detect.h"
+#include "utils.h"
+#include "autodetection.h"
Sysinfo::Sysinfo(QWidget *parent) : QDialog(parent)
@@ -37,18 +39,33 @@ void Sysinfo::updateSysinfo(void)
{
QString info;
info += tr("<b>OS</b><br/>") + Detect::osVersionString() + "<hr/>";
- info += tr("<b>Username:</b><br/>%1<hr/>").arg(Detect::userName());
+ info += tr("<b>Username</b><br/>%1<hr/>").arg(Detect::userName());
#if defined(Q_OS_WIN32)
- info += tr("<b>Permissions:</b><br/>%1<hr/>").arg(Detect::userPermissionsString());
+ info += tr("<b>Permissions</b><br/>%1<hr/>").arg(Detect::userPermissionsString());
#endif
- info += tr("<b>Attached USB devices:</b><br/>");
+ info += tr("<b>Attached USB devices</b><br/>");
QMap<uint32_t, QString> usbids = Detect::listUsbDevices();
QList<uint32_t> usbkeys = usbids.keys();
- for(int i = 0; i < usbkeys.size(); i++)
- info += tr("VID: %1 PID: %2, %3<br/>")
+ for(int i = 0; i < usbkeys.size(); i++) {
+ info += tr("VID: %1 PID: %2, %3")
.arg((usbkeys.at(i)&0xffff0000)>>16, 4, 16, QChar('0'))
.arg(usbkeys.at(i)&0xffff, 4, 16, QChar('0'))
- .arg(usbids.value(usbkeys.at(i)));
+ .arg(usbids.value(usbkeys.at(i)));
+ if(i + 1 < usbkeys.size())
+ info += "<br/>";
+ }
+ info += "<hr/>";
+
+ info += "<b>" + tr("Filesystem") + "</b><br/>";
+ QStringList drives = Autodetection::mountpoints();
+ for(int i = 0; i < drives.size(); i++) {
+ info += tr("%1, %2 MiB available")
+ .arg(drives.at(i))
+ .arg(filesystemFree(drives.at(i)) / (1024*1024));
+ if(i + 1 < drives.size())
+ info += "<br/>";
+ }
+ info += "<hr/>";
ui.textBrowser->setHtml(info);
}