summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/rbutilqt.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2012-06-20 21:00:43 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2012-06-26 18:30:27 +0200
commitf419128a6b371d2752553ef3850f10c2cdf46912 (patch)
tree9b88dd45a000e3c86a0a89f20f1d1da368e5a9b2 /rbutil/rbutilqt/rbutilqt.cpp
parent40e306ba3776a90cc8670e792961edfe89b28115 (diff)
downloadrockbox-f419128a6b371d2752553ef3850f10c2cdf46912.tar.gz
rockbox-f419128a6b371d2752553ef3850f10c2cdf46912.tar.bz2
rockbox-f419128a6b371d2752553ef3850f10c2cdf46912.zip
Show player picture left of device configuration.
After shrinking the size of the Rockbox logo shown and making the selected device display two lines there is now enough room to also show an icon of the player. The icon is scaled depending on the application font size, so for setups configured with a larger font it still should show up in a reasonable size. Change-Id: I8f62f3292c62f820309157db73741b57fd6371ef
Diffstat (limited to 'rbutil/rbutilqt/rbutilqt.cpp')
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp30
1 files changed, 19 insertions, 11 deletions
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index 27efcea6db..575859fd46 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -364,20 +364,28 @@ void RbUtilQt::updateDevice()
ui.menuA_ctions->setEnabled(configurationValid);
// displayed device info
- QString mountpoint = RbSettings::value(RbSettings::Mountpoint).toString();
QString brand = SystemInfo::value(SystemInfo::CurBrand).toString();
- QString name = SystemInfo::value(SystemInfo::CurName).toString() +
- " (" + ServerInfo::value(ServerInfo::CurStatus).toString() + ")";
+ QString name
+ = QString("%1 (%2)").arg(SystemInfo::value(SystemInfo::CurName).toString(),
+ ServerInfo::value(ServerInfo::CurStatus).toString());
+ ui.labelDevice->setText(tr("<b>%1 %2</b>").arg(brand, name));
+
+ QString mountpoint = RbSettings::value(RbSettings::Mountpoint).toString();
QString mountdisplay = QDir::toNativeSeparators(mountpoint);
- QString label = Utils::filesystemName(mountpoint);
- if(!label.isEmpty())
- mountdisplay += " (" + label + ")";
+ if(!mountdisplay.isEmpty()) {
+ QString label = Utils::filesystemName(mountpoint);
+ if(!label.isEmpty()) mountdisplay += QString(" (%1)").arg(label);
+ ui.labelMountpoint->setText(tr("<b>%1</b>").arg(mountdisplay));
+ }
+ else {
+ mountdisplay = "(unknown)";
+ }
- if(name.isEmpty()) name = "&lt;none&gt;";
- if(mountpoint.isEmpty())
- mountpoint = "&lt;invalid&gt;";
- ui.labelDevice->setText(tr("<b>%1 %2</b>").arg(brand, name));
- ui.labelMountpoint->setText(tr("<b>%1</b>").arg(mountdisplay));
+ QPixmap pm;
+ QString m = SystemInfo::value(SystemInfo::CurPlayerPicture).toString();
+ pm.load(":/icons/players/" + m + "-small.png");
+ pm = pm.scaledToHeight(QFontMetrics(QApplication::font()).height() * 3);
+ ui.labelPlayerPic->setPixmap(pm);
// hide quickstart buttons if no release available
bool installable = !ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty();