Display device free space information in the device properties dialog

This commit is contained in:
David Sansome 2010-07-29 20:03:24 +00:00
parent af0a9ac79b
commit 3ad30d14a8
36 changed files with 432 additions and 107 deletions

View File

@ -143,6 +143,7 @@ set(SOURCES
widgets/errordialog.cpp
widgets/fileview.cpp
widgets/fileviewlist.cpp
widgets/freespacebar.cpp
widgets/lineedit.cpp
widgets/linetextedit.cpp
widgets/multiloadingindicator.cpp
@ -258,6 +259,7 @@ set(HEADERS
widgets/errordialog.h
widgets/fileview.h
widgets/fileviewlist.h
widgets/freespacebar.h
widgets/lineedit.h
widgets/linetextedit.h
widgets/multiloadingindicator.h

View File

@ -82,15 +82,6 @@ void DeviceProperties::ShowDevice(int row) {
// Basic information
ui_->name->setText(index_.data(DeviceManager::Role_FriendlyName).toString());
// Size
QString size_text = Utilities::PrettySize(
index_.data(DeviceManager::Role_Capacity).toLongLong());
qint64 free_space = index_.data(DeviceManager::Role_FreeSpace).toLongLong();
if (free_space)
size_text += QString(" (%1 %2)").arg(Utilities::PrettySize(free_space),
tr("available"));
ui_->capacity->setText(size_text);
// Find the right icon
QString icon_name = index_.data(DeviceManager::Role_IconName).toString();
for (int i=0 ; i<ui_->icon->count() ; ++i) {
@ -141,6 +132,26 @@ void DeviceProperties::UpdateHardwareInfo() {
} else {
ui_->hardware_info_stack->setCurrentWidget(ui_->hardware_info_not_connected_page);
}
// Size
quint64 total = index_.data(DeviceManager::Role_Capacity).toLongLong();
QString total_text = Utilities::PrettySize(total);
QVariant free_var = index_.data(DeviceManager::Role_FreeSpace);
if (free_var.isValid()) {
quint64 free = free_var.toLongLong();
QString free_text = Utilities::PrettySize(free);
ui_->free_space_label->setText(tr("Available space"));
ui_->free_space_value->setText(tr("%1 of %2").arg(free_text, total_text));
ui_->free_space_bar->set_total_bytes(total);
ui_->free_space_bar->set_free_bytes(free);
ui_->free_space_bar->show();
} else {
ui_->free_space_label->setText(tr("Capacity"));
ui_->free_space_value->setText(total_text);
ui_->free_space_bar->hide();
}
}
void DeviceProperties::accept() {

View File

@ -14,7 +14,7 @@
<string>Device Properties</string>
</property>
<property name="windowIcon">
<iconset>
<iconset resource="../../data/data.qrc">
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
@ -69,19 +69,22 @@
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<widget class="QLabel" name="free_space_label">
<property name="text">
<string>Capacity</string>
<string>Available space</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="capacity">
<widget class="QLabel" name="free_space_value">
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="FreeSpaceBar" name="free_space_bar" native="true"/>
</item>
</layout>
</item>
<item>
@ -172,13 +175,23 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>FreeSpaceBar</class>
<extends>QWidget</extends>
<header>widgets/freespacebar.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>name</tabstop>
<tabstop>icon</tabstop>
<tabstop>hardware_info</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
<resources>
<include location="../../data/data.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>

View File

@ -32,6 +32,10 @@ msgstr ""
msgid "%1 days"
msgstr ""
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr ""
@ -253,6 +257,9 @@ msgstr ""
msgid "Automatically open single categories in the library tree"
msgstr ""
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr ""
@ -1717,9 +1724,6 @@ msgstr ""
msgid "add %n songs"
msgstr "أضِف %n أغاني\\أغنية"
msgid "available"
msgstr ""
msgid "bpm"
msgstr ""

View File

@ -32,6 +32,10 @@ msgstr ""
msgid "%1 days"
msgstr ""
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr ""
@ -253,6 +257,9 @@ msgstr ""
msgid "Automatically open single categories in the library tree"
msgstr ""
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr ""
@ -1717,9 +1724,6 @@ msgstr ""
msgid "add %n songs"
msgstr ""
msgid "available"
msgstr ""
msgid "bpm"
msgstr ""

View File

@ -33,6 +33,10 @@ msgstr ""
msgid "%1 days"
msgstr "%1 dnů"
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr ""
@ -254,6 +258,9 @@ msgstr ""
msgid "Automatically open single categories in the library tree"
msgstr "Automaticky otevře jednostlivé kategorie ve stromu knihovny"
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1721,9 +1728,6 @@ msgstr "[pro úpravy klikněte]"
msgid "add %n songs"
msgstr "Přidej %n skladby"
msgid "available"
msgstr "dostupné"
msgid "bpm"
msgstr "bpm"
@ -1751,6 +1755,9 @@ msgstr "zastavit"
msgid "track %1"
msgstr "stopa %1"
#~ msgid "available"
#~ msgstr "dostupné"
#~ msgid "Connected"
#~ msgstr "Připojeno"

View File

@ -33,6 +33,10 @@ msgstr ""
msgid "%1 days"
msgstr ""
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr ""
@ -254,6 +258,9 @@ msgstr "Automatisk opdatering"
msgid "Automatically open single categories in the library tree"
msgstr "Åbn automatisk enkelte kategorier i bibliotekstræet"
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1724,9 +1731,6 @@ msgstr "[Klik for at redigere]"
msgid "add %n songs"
msgstr "tilføj %n sange"
msgid "available"
msgstr ""
msgid "bpm"
msgstr ""

View File

@ -33,6 +33,10 @@ msgstr "%1 Alben"
msgid "%1 days"
msgstr "%1 Tage"
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr "%1 Wiedergabelisten (%2)"
@ -258,6 +262,9 @@ msgstr "Automatisch aktualisieren"
msgid "Automatically open single categories in the library tree"
msgstr "Kategorien in der Musiksammlung automatisch öffnen"
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1747,9 +1754,6 @@ msgstr "[zum Bearbeiten klicken]"
msgid "add %n songs"
msgstr "%n Stücke hinzufügen"
msgid "available"
msgstr "verfügbar"
msgid "bpm"
msgstr "BPM"
@ -1777,6 +1781,9 @@ msgstr "Anhalten"
msgid "track %1"
msgstr "Stück %1"
#~ msgid "available"
#~ msgstr "verfügbar"
#~ msgid "Disconnect device"
#~ msgstr "Gerät trennen"

View File

@ -34,6 +34,10 @@ msgstr "%1 άλμπουμ"
msgid "%1 days"
msgstr "%1 ημέρες"
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr "%1 λίστες αναπαραγωγής (%2)"
@ -260,6 +264,9 @@ msgstr "Αυτόματη ενημέρωση"
msgid "Automatically open single categories in the library tree"
msgstr "Άνοιξε αυτόμα τις μόνες κατηγορίες του δέντρου της βιβλιοθήκης"
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1752,9 +1759,6 @@ msgstr "[κλικ για τροποποίηση]"
msgid "add %n songs"
msgstr "προσθήκη %n τραγουδιών"
msgid "available"
msgstr "διαθέσιμο"
msgid "bpm"
msgstr "bpm"
@ -1782,6 +1786,9 @@ msgstr "διακοπή"
msgid "track %1"
msgstr "κομμάτι %1"
#~ msgid "available"
#~ msgstr "διαθέσιμο"
#~ msgid "Disconnect device"
#~ msgstr "Αποσύνδεση συσκευής"

View File

@ -32,6 +32,10 @@ msgstr ""
msgid "%1 days"
msgstr ""
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr "%1 playlists (%2)"
@ -253,6 +257,9 @@ msgstr ""
msgid "Automatically open single categories in the library tree"
msgstr "Automatically open single categories in the library tree"
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1722,9 +1729,6 @@ msgstr "[click to edit]"
msgid "add %n songs"
msgstr "add %n songs"
msgid "available"
msgstr ""
msgid "bpm"
msgstr ""

View File

@ -32,6 +32,10 @@ msgstr ""
msgid "%1 days"
msgstr ""
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr ""
@ -253,6 +257,9 @@ msgstr ""
msgid "Automatically open single categories in the library tree"
msgstr "Automatically open single categories in the library tree"
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1719,9 +1726,6 @@ msgstr "[click to edit]"
msgid "add %n songs"
msgstr ""
msgid "available"
msgstr ""
msgid "bpm"
msgstr ""

View File

@ -33,6 +33,10 @@ msgstr "%1 álbumes"
msgid "%1 days"
msgstr "%1 días"
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr "%1 listas de reproducción (%2)"
@ -261,6 +265,9 @@ msgid "Automatically open single categories in the library tree"
msgstr ""
"Expandir automáticamente las categorías únicas en el árbol de la colección"
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1753,9 +1760,6 @@ msgstr "[click para editar]"
msgid "add %n songs"
msgstr "agregar %n pistas"
msgid "available"
msgstr "disponible"
msgid "bpm"
msgstr "bpm"
@ -1783,6 +1787,9 @@ msgstr "detener"
msgid "track %1"
msgstr "Pista %1"
#~ msgid "available"
#~ msgstr "disponible"
#~ msgid "Disconnect device"
#~ msgstr "Desconectar el dispositivo"

View File

@ -32,6 +32,10 @@ msgstr "%1 levyä"
msgid "%1 days"
msgstr "%1 päivää"
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr "%1 soittolistaa (%2)"
@ -253,6 +257,9 @@ msgstr ""
msgid "Automatically open single categories in the library tree"
msgstr ""
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1719,9 +1726,6 @@ msgstr ""
msgid "add %n songs"
msgstr ""
msgid "available"
msgstr ""
msgid "bpm"
msgstr ""

View File

@ -33,6 +33,10 @@ msgstr "%1 albums"
msgid "%1 days"
msgstr "%1 jours"
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr "%1 listes de lecture (%2)"
@ -254,6 +258,9 @@ msgstr "Mise à jour automatique"
msgid "Automatically open single categories in the library tree"
msgstr ""
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1733,9 +1740,6 @@ msgstr "[cliquer pour modifier]"
msgid "add %n songs"
msgstr ""
msgid "available"
msgstr ""
msgid "bpm"
msgstr ""

View File

@ -32,6 +32,10 @@ msgstr ""
msgid "%1 days"
msgstr ""
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr ""
@ -253,6 +257,9 @@ msgstr ""
msgid "Automatically open single categories in the library tree"
msgstr ""
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1719,9 +1726,6 @@ msgstr "[clique para editar]"
msgid "add %n songs"
msgstr ""
msgid "available"
msgstr ""
msgid "bpm"
msgstr ""

View File

@ -33,6 +33,10 @@ msgstr "Copy text \t %1 album"
msgid "%1 days"
msgstr "%1 giorni"
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr "%1 scalette (%2)"
@ -260,6 +264,9 @@ msgstr "Aggiornamento automatico"
msgid "Automatically open single categories in the library tree"
msgstr "Apri automaticamente categorie singole nell'albero della raccolta"
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1757,9 +1764,6 @@ msgstr "[clic per modificare]"
msgid "add %n songs"
msgstr "aggiungi %n brani"
msgid "available"
msgstr ""
msgid "bpm"
msgstr "bpm"

View File

@ -32,6 +32,10 @@ msgstr ""
msgid "%1 days"
msgstr ""
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr ""
@ -253,6 +257,9 @@ msgstr ""
msgid "Automatically open single categories in the library tree"
msgstr ""
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1719,9 +1726,6 @@ msgstr ""
msgid "add %n songs"
msgstr ""
msgid "available"
msgstr ""
msgid "bpm"
msgstr ""

View File

@ -32,6 +32,10 @@ msgstr "%1 albumai"
msgid "%1 days"
msgstr "%1 dienos"
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr "%1 grojaraščiai (%2)"
@ -253,6 +257,9 @@ msgstr ""
msgid "Automatically open single categories in the library tree"
msgstr ""
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr ""
@ -1717,9 +1724,6 @@ msgstr ""
msgid "add %n songs"
msgstr ""
msgid "available"
msgstr ""
msgid "bpm"
msgstr ""

View File

@ -32,6 +32,10 @@ msgstr ""
msgid "%1 days"
msgstr ""
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr ""
@ -253,6 +257,9 @@ msgstr ""
msgid "Automatically open single categories in the library tree"
msgstr "Automatisk åpne enkeltkategorier i bibliotektreet"
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1721,9 +1728,6 @@ msgstr "[klikk for å endre]"
msgid "add %n songs"
msgstr ""
msgid "available"
msgstr ""
msgid "bpm"
msgstr ""

View File

@ -32,6 +32,10 @@ msgstr "%1 albums"
msgid "%1 days"
msgstr "%1 dag(en)"
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr "%1 afspeellijsten (%2)"
@ -257,6 +261,9 @@ msgstr "Automatisch updaten"
msgid "Automatically open single categories in the library tree"
msgstr "Automatisch enkelvoudige categorieën in bibliotheekboom openen"
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1746,9 +1753,6 @@ msgstr "[klik om te bewerken]"
msgid "add %n songs"
msgstr "%n nummers toevoegen"
msgid "available"
msgstr ""
msgid "bpm"
msgstr "bpm"

View File

@ -32,6 +32,10 @@ msgstr ""
msgid "%1 days"
msgstr ""
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr ""
@ -253,6 +257,9 @@ msgstr ""
msgid "Automatically open single categories in the library tree"
msgstr ""
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1717,9 +1724,6 @@ msgstr ""
msgid "add %n songs"
msgstr ""
msgid "available"
msgstr ""
msgid "bpm"
msgstr ""

View File

@ -33,6 +33,10 @@ msgstr "%1 albumów"
msgid "%1 days"
msgstr "%1 dni"
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr "%1 list odtwarzania (%2)"
@ -254,6 +258,9 @@ msgstr "Automatyczna aktualizacja"
msgid "Automatically open single categories in the library tree"
msgstr "Automatycznie otwórz pojedyncze kategorie w drzewie biblioteki"
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "Uderzenia na minutę"
@ -1728,9 +1735,6 @@ msgstr "[kliknij aby edytować]"
msgid "add %n songs"
msgstr ""
msgid "available"
msgstr ""
msgid "bpm"
msgstr ""

View File

@ -32,6 +32,10 @@ msgstr "%1 álbuns"
msgid "%1 days"
msgstr "%1 dias"
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr "Listas de reprodução %1 (%2)"
@ -258,6 +262,9 @@ msgid "Automatically open single categories in the library tree"
msgstr ""
"Na biblioteca em árvore, abrir automaticamente as categorias individuais"
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1743,9 +1750,6 @@ msgstr "[clique para editar]"
msgid "add %n songs"
msgstr "adicionar %n canções"
msgid "available"
msgstr "disponível"
msgid "bpm"
msgstr "bpm"
@ -1773,6 +1777,9 @@ msgstr "parar"
msgid "track %1"
msgstr "faixa %1"
#~ msgid "available"
#~ msgstr "disponível"
#~ msgid "Disconnect device"
#~ msgstr "Desligar o dispositivo"

View File

@ -32,6 +32,10 @@ msgstr "%1 albuns"
msgid "%1 days"
msgstr "%1 dias"
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr "%1 listas de reprodução (%2)"
@ -256,6 +260,9 @@ msgstr ""
msgid "Automatically open single categories in the library tree"
msgstr "Abrir categorias únicas na árvore da biblioteca automaticamente"
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1737,9 +1744,6 @@ msgstr "[clique para editar]"
msgid "add %n songs"
msgstr "Adicionar %n músicas"
msgid "available"
msgstr ""
msgid "bpm"
msgstr "bpm"

View File

@ -32,6 +32,10 @@ msgstr ""
msgid "%1 days"
msgstr ""
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr ""
@ -253,6 +257,9 @@ msgstr ""
msgid "Automatically open single categories in the library tree"
msgstr ""
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1718,9 +1725,6 @@ msgstr ""
msgid "add %n songs"
msgstr ""
msgid "available"
msgstr ""
msgid "bpm"
msgstr ""

View File

@ -31,6 +31,10 @@ msgstr "%1 альбом(ов)"
msgid "%1 days"
msgstr "%1 дней"
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr "%1 списков воспроизведения (%2)"
@ -256,6 +260,9 @@ msgstr "Автоматическое обновление"
msgid "Automatically open single categories in the library tree"
msgstr "Автоматически открывать одиночные категории в дереве коллекции"
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1743,9 +1750,6 @@ msgstr "[щелкните, чтобы изменить]"
msgid "add %n songs"
msgstr "добавить %n композиций"
msgid "available"
msgstr "доступно"
msgid "bpm"
msgstr "bpm"
@ -1773,6 +1777,9 @@ msgstr "Остановить"
msgid "track %1"
msgstr "композиция %1"
#~ msgid "available"
#~ msgstr "доступно"
#~ msgid "Disconnect device"
#~ msgstr "Отсоединение устройства"

View File

@ -33,6 +33,10 @@ msgstr "%1 albumov"
msgid "%1 days"
msgstr "%1 dní"
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr "%1 playlistov (%2)"
@ -258,6 +262,9 @@ msgstr "Automatické aktualizovanie"
msgid "Automatically open single categories in the library tree"
msgstr "Automaticky otvoriť jednotlivé kategórie v strome zbierky"
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1741,9 +1748,6 @@ msgstr "[kliknite pre úpravu]"
msgid "add %n songs"
msgstr "pridať %n piesní"
msgid "available"
msgstr "dostupné"
msgid "bpm"
msgstr "bpm"
@ -1771,6 +1775,9 @@ msgstr "zastaviť"
msgid "track %1"
msgstr "skladba %1"
#~ msgid "available"
#~ msgstr "dostupné"
#~ msgid "Disconnect device"
#~ msgstr "Odpojiť zariadenie"

View File

@ -32,6 +32,10 @@ msgstr "%1 албума"
msgid "%1 days"
msgstr "%1 дана"
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr "%1 листа нумера (%2)"
@ -253,6 +257,9 @@ msgstr "Аутоматско ажурирање"
msgid "Automatically open single categories in the library tree"
msgstr "Аутоматски отвори појединачне категорије у стаблу библиотеке"
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "ОПМ"
@ -1724,9 +1731,6 @@ msgstr ""
msgid "add %n songs"
msgstr "додај %n песама"
msgid "available"
msgstr ""
msgid "bpm"
msgstr "опм"

View File

@ -32,6 +32,10 @@ msgstr ""
msgid "%1 days"
msgstr "%1 dagar"
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr "%1 spellistor (%2)"
@ -253,6 +257,9 @@ msgstr ""
msgid "Automatically open single categories in the library tree"
msgstr "Öppna enkla kategorier i biblioteksträdet automatiskt"
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1725,9 +1732,6 @@ msgstr "[klicka för att redigera]"
msgid "add %n songs"
msgstr "Lägg till %n songer"
msgid "available"
msgstr ""
msgid "bpm"
msgstr ""

View File

@ -32,6 +32,10 @@ msgstr "%1 albüm"
msgid "%1 days"
msgstr "%1 gün"
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr "%1 çalma listesi (%2)"
@ -253,6 +257,9 @@ msgstr ""
msgid "Automatically open single categories in the library tree"
msgstr ""
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "BPM"
@ -1723,9 +1730,6 @@ msgstr "[düzenlemek için tıklayın]"
msgid "add %n songs"
msgstr "%n şakıyı ekle"
msgid "available"
msgstr ""
msgid "bpm"
msgstr "bpm"

View File

@ -22,6 +22,10 @@ msgstr ""
msgid "%1 days"
msgstr ""
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr ""
@ -243,6 +247,9 @@ msgstr ""
msgid "Automatically open single categories in the library tree"
msgstr ""
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr ""
@ -1707,9 +1714,6 @@ msgstr ""
msgid "add %n songs"
msgstr ""
msgid "available"
msgstr ""
msgid "bpm"
msgstr ""

View File

@ -32,6 +32,10 @@ msgstr "%1 альбом(ів)"
msgid "%1 days"
msgstr "%1 дн."
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr "%1 списків відтворення (%2)"
@ -257,6 +261,9 @@ msgstr "Автоматичне оновлення"
msgid "Automatically open single categories in the library tree"
msgstr "Автоматично відкривати одиночні категорії в дереві фонотеки"
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr "Бітів за хвилину"
@ -1742,9 +1749,6 @@ msgstr "[клацніть, щоб змінити]"
msgid "add %n songs"
msgstr "додати %n композицій"
msgid "available"
msgstr "доступно"
msgid "bpm"
msgstr "такт/хв."
@ -1772,6 +1776,9 @@ msgstr "зупинити"
msgid "track %1"
msgstr "доріжка %1"
#~ msgid "available"
#~ msgstr "доступно"
#~ msgid "Disconnect device"
#~ msgstr "Роз'єднати пристрій"

View File

@ -32,6 +32,10 @@ msgstr ""
msgid "%1 days"
msgstr ""
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr ""
@ -253,6 +257,9 @@ msgstr ""
msgid "Automatically open single categories in the library tree"
msgstr ""
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr ""
@ -1717,9 +1724,6 @@ msgstr ""
msgid "add %n songs"
msgstr ""
msgid "available"
msgstr ""
msgid "bpm"
msgstr ""

View File

@ -32,6 +32,10 @@ msgstr "%1 專輯"
msgid "%1 days"
msgstr "%1 日"
#, qt-format
msgid "%1 of %2"
msgstr ""
#, qt-format
msgid "%1 playlists (%2)"
msgstr "%1 播放清單 (%2)"
@ -257,6 +261,9 @@ msgstr ""
msgid "Automatically open single categories in the library tree"
msgstr "自動開啟音樂庫中的單一類型"
msgid "Available space"
msgstr ""
msgid "BPM"
msgstr ""
@ -1724,9 +1731,6 @@ msgstr "[點擊以編輯]"
msgid "add %n songs"
msgstr "加入 %n 歌"
msgid "available"
msgstr ""
msgid "bpm"
msgstr "bpm"

View File

@ -0,0 +1,96 @@
/* This file is part of Clementine.
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#include "freespacebar.h"
#include <QLinearGradient>
#include <QPainter>
const int FreeSpaceBar::kBarHeight = 20;
const int FreeSpaceBar::kBarBorderRadius = 8;
const int FreeSpaceBar::kMarkerSpacing = 32;
const QRgb FreeSpaceBar::kColorBg1 = qRgb(214, 207, 200);
const QRgb FreeSpaceBar::kColorBg2 = qRgb(234, 226, 218);
const QRgb FreeSpaceBar::kColorBar1 = qRgb(250, 148, 76);
const QRgb FreeSpaceBar::kColorBar2 = qRgb(214, 102, 24);
const QRgb FreeSpaceBar::kColorBorder = qRgb(174, 168, 162);
FreeSpaceBar::FreeSpaceBar(QWidget *parent)
: QWidget(parent),
free_(33),
total_(100)
{
setMinimumHeight(kBarHeight);
}
void FreeSpaceBar::set_free_bytes(quint64 bytes) {
free_ = bytes;
update();
}
void FreeSpaceBar::set_total_bytes(quint64 bytes) {
total_ = bytes;
update();
}
QSize FreeSpaceBar::sizeHint() const {
return QSize(150, kBarHeight);
}
void FreeSpaceBar::paintEvent(QPaintEvent*) {
QPainter p(this);
p.setRenderHint(QPainter::Antialiasing);
p.setRenderHint(QPainter::HighQualityAntialiasing);
QRect background_rect(rect());
QRect bar_rect(background_rect);
bar_rect.setWidth(float(bar_rect.width()) * (float(total_ - free_) / total_));
QLinearGradient background_gradient(background_rect.topLeft(), background_rect.bottomLeft());
background_gradient.setColorAt(0, kColorBg1);
background_gradient.setColorAt(1, kColorBg2);
QLinearGradient bar_gradient(bar_rect.topLeft(), bar_rect.bottomLeft());
bar_gradient.setColorAt(0, kColorBar1);
bar_gradient.setColorAt(1, kColorBar2);
// Draw the background
p.setPen(Qt::NoPen);
p.setBrush(background_gradient);
p.drawRoundedRect(background_rect, kBarBorderRadius, kBarBorderRadius);
// Draw the bar foreground
p.setBrush(bar_gradient);
p.drawRoundedRect(bar_rect, kBarBorderRadius, kBarBorderRadius);
// Draw marker lines over the top every few pixels
p.setOpacity(0.35);
p.setRenderHint(QPainter::Antialiasing, false);
p.setPen(QPen(palette().color(QPalette::Light), 1.0));
for (int x = background_rect.left() + kMarkerSpacing ;
x < background_rect.right() ; x += kMarkerSpacing) {
p.drawLine(x, background_rect.top() + 2, x, background_rect.bottom() - 2);
}
// Draw a border
p.setRenderHint(QPainter::Antialiasing);
p.setOpacity(1.0);
p.setPen(kColorBorder);
p.setBrush(Qt::NoBrush);
p.drawRoundedRect(background_rect, kBarBorderRadius, kBarBorderRadius);
}

View File

@ -0,0 +1,55 @@
/* This file is part of Clementine.
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FREESPACEBAR_H
#define FREESPACEBAR_H
#include <QWidget>
class FreeSpaceBar : public QWidget {
Q_OBJECT
Q_PROPERTY(quint64 free READ free_bytes WRITE set_free_bytes);
Q_PROPERTY(quint64 total READ total_bytes WRITE set_total_bytes);
public:
FreeSpaceBar(QWidget* parent = 0);
static const int kBarHeight;
static const int kBarBorderRadius;
static const int kMarkerSpacing;
static const QRgb kColorBg1;
static const QRgb kColorBg2;
static const QRgb kColorBar1;
static const QRgb kColorBar2;
static const QRgb kColorBorder;
quint64 free_bytes() const { return free_; }
quint64 total_bytes() const { return total_; }
void set_free_bytes(quint64 bytes);
void set_total_bytes(quint64 bytes);
QSize sizeHint() const;
protected:
void paintEvent(QPaintEvent*);
private:
quint64 free_;
quint64 total_;
};
#endif // FREESPACEBAR_H