From c4022017e995364abea5d3e2e8585be84eba4d06 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 3 Jul 2010 07:39:30 -0600 Subject: [PATCH] Make location view one line shorter --- src/calibre/gui2/widgets.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/calibre/gui2/widgets.py b/src/calibre/gui2/widgets.py index 97538d9a63..d46c020484 100644 --- a/src/calibre/gui2/widgets.py +++ b/src/calibre/gui2/widgets.py @@ -267,10 +267,10 @@ class LocationModel(QAbstractListModel): QVariant(QIcon(I('reader.svg'))), QVariant(QIcon(I('sd.svg'))), QVariant(QIcon(I('sd.svg')))] - self.text = [_('Library\n%d\nbooks'), - _('Reader\n%s\navailable'), - _('Card A\n%s\navailable'), - _('Card B\n%s\navailable')] + self.text = [_('Library\n%d books'), + _('Reader\n%s'), + _('Card A\n%s'), + _('Card B\n%s')] self.free = [-1, -1, -1] self.count = 0 self.highlight_row = 0 @@ -309,7 +309,12 @@ class LocationModel(QAbstractListModel): elif role == Qt.DecorationRole: data = self.icons[drow] elif role == Qt.ToolTipRole: - data = QVariant(self.tooltips[drow]) + ans = self.tooltips[row] + if row > 0: + fs = self.free[drow-1] + if fs > -1: + ans += '\n\n%s '%(human_readable(fs)) + _('free') + data = QVariant(ans) elif role == Qt.SizeHintRole: data = QVariant(QSize(155, 90)) elif role == Qt.FontRole: