library view has now three modes: 'all songs', 'duplicates only' and new 'untagged songs only' (check out the http://code.google.com/p/clementine-player/wiki/LibraryViewModes) - fixes issue #305

+ hiding the 'complexity' of QueryOptions filter and query_mode mutual exclusion behind it's API
This commit is contained in:
Paweł Bara 2011-02-06 13:18:18 +00:00
parent e08c6cc6a5
commit 82e92bb3ac
55 changed files with 519 additions and 181 deletions

View File

@ -17,6 +17,7 @@
#include "libraryfilterwidget.h"
#include "librarymodel.h"
#include "libraryquery.h"
#include "groupbydialog.h"
#include "ui_libraryfilterwidget.h"
#include "ui/iconloader.h"
@ -192,12 +193,11 @@ void LibraryFilterWidget::SetFilterHint(const QString& hint) {
filter_->set_hint(hint);
}
void LibraryFilterWidget::SetDuplicatesOnly(bool duplicates_only) {
// no filtering in duplicates_only mode
void LibraryFilterWidget::SetQueryMode(QueryOptions::QueryMode query_mode) {
filter_->clear();
filter_->set_enabled(!duplicates_only);
filter_->set_enabled(query_mode == QueryOptions::QueryMode_All);
model_->SetFilterDuplicatesOnly(duplicates_only);
model_->SetFilterQueryMode(query_mode);
}
void LibraryFilterWidget::SetAgeFilterEnabled(bool enabled) {

View File

@ -26,6 +26,7 @@
class GroupByDialog;
class LineEditInterface;
class QueryOptions;
class SettingsDialog;
class Ui_LibraryFilterWidget;
@ -52,7 +53,7 @@ class LibraryFilterWidget : public QWidget {
void SetLibraryModel(LibraryModel* model);
public slots:
void SetDuplicatesOnly(bool duplicates_only);
void SetQueryMode(QueryOptions::QueryMode view);
signals:
void UpPressed();

View File

@ -589,7 +589,7 @@ void LibraryModel::BeginReset() {
}
// Smart playlists?
if (show_smart_playlists_ && query_options_.filter.isEmpty())
if (show_smart_playlists_ && query_options_.get_filter().isEmpty())
CreateSmartPlaylists();
}
@ -981,23 +981,17 @@ SongList LibraryModel::GetChildSongs(const QModelIndex &index) const {
}
void LibraryModel::SetFilterAge(int age) {
query_options_.max_age = age;
query_options_.set_max_age(age);
ResetAsync();
}
void LibraryModel::SetFilterText(const QString& text) {
// duplicates_only and filter are mutually exclusive
query_options_.filter = text;
query_options_.duplicates_only = false;
query_options_.set_filter(text);
ResetAsync();
}
void LibraryModel::SetFilterDuplicatesOnly(bool duplicates_only) {
// duplicates_only and filter are mutually exclusive
query_options_.duplicates_only = duplicates_only;
query_options_.filter = "";
void LibraryModel::SetFilterQueryMode(QueryOptions::QueryMode query_mode) {
query_options_.set_query_mode(query_mode);
ResetAsync();
}

View File

@ -138,7 +138,7 @@ class LibraryModel : public SimpleTreeModel<LibraryItem> {
public slots:
void SetFilterAge(int age);
void SetFilterText(const QString& text);
void SetFilterDuplicatesOnly(bool duplicates_only);
void SetFilterQueryMode(QueryOptions::QueryMode query_mode);
void SetGroupBy(const LibraryModel::Grouping& g);
void Init();

View File

@ -24,7 +24,7 @@
QueryOptions::QueryOptions()
: max_age(-1),
duplicates_only(false)
query_mode(QueryMode_All)
{
}
@ -33,14 +33,14 @@ LibraryQuery::LibraryQuery(const QueryOptions& options)
: join_with_fts_(false),
limit_(-1)
{
if (!options.filter.isEmpty()) {
if (!options.get_filter().isEmpty()) {
// We need to munge the filter text a little bit to get it to work as
// expected with sqlite's FTS3:
// 1) Append * to all tokens.
// 2) Prefix "fts" to column names.
// Split on whitespace
QStringList tokens(options.filter.split(QRegExp("\\s+")));
QStringList tokens(options.get_filter().split(QRegExp("\\s+")));
QString query;
foreach (QString token, tokens) {
token.remove('(');
@ -57,21 +57,24 @@ LibraryQuery::LibraryQuery(const QueryOptions& options)
join_with_fts_ = true;
}
if (options.max_age != -1) {
int cutoff = QDateTime::currentDateTime().toTime_t() - options.max_age;
if (options.get_max_age() != -1) {
int cutoff = QDateTime::currentDateTime().toTime_t() - options.get_max_age();
where_clauses_ << "ctime > ?";
bound_values_ << cutoff;
}
duplicates_only_ = false;
// TODO: currently you cannot use any QueryMode other than All and fts at the same time.
// joining songs, duplicated_songs and songs_fts all together takes a huge amount of
// time. the query takes about 20 seconds on my machine then. why?
// untagged mode could work with additional filtering but I'm disabling it just to be
// consistent - this way filtering is available only in the All mode.
// remember though that when you fix the Duplicates + FTS cooperation, enable the
// filtering in both Duplicates and Untagged modes.
duplicates_only_ = options.get_query_mode() == QueryOptions::QueryMode_Duplicates;
if(options.duplicates_only) {
// TODO: currently you cannot use the duplicates_only flag and fts at the same time.
// joining songs, duplicated_songs and songs_fts all together takes a huge amount of
// time. the query takes about 20 seconds then. why?
Q_ASSERT(!join_with_fts_);
duplicates_only_ = true;
if (options.get_query_mode() == QueryOptions::QueryMode_Untagged) {
where_clauses_ << "(artist = '' OR album = '' OR title ='')";
}
}

View File

@ -27,20 +27,46 @@
class Song;
class LibraryBackend;
// This structure let's you customize behaviour of any LibraryQuery.
struct QueryOptions {
// Modes of LibraryQuery:
// - use the all songs table
// - use the duplicated songs view; by duplicated we mean those songs
// for which the (artist, album, title) tuple is found more than once
// in the songs table
// - use the untagged songs view; by untagged we mean those for which
// at least one of the (artist, album, title) tags is empty
// Please note that additional filtering based on fts table (the filter
// attribute) won't work in Duplicates and Untagged modes.
enum QueryMode {
QueryMode_All,
QueryMode_Duplicates,
QueryMode_Untagged
};
QueryOptions();
bool Matches(const Song& song) const;
// Please note that this attribute is mutually exclusive with the 'duplicates_only'
// flag!
QString get_filter() const { return filter; }
void set_filter(QString filter) {
this->filter = filter;
this->query_mode = QueryMode_All;
}
int get_max_age() const { return max_age; }
void set_max_age(int max_age) { this->max_age = max_age; }
QueryMode get_query_mode() const { return query_mode; }
void set_query_mode(QueryMode query_mode) {
this->query_mode = query_mode;
this->filter = QString();
}
private:
QString filter;
int max_age;
// If true, the query will operate not on the whole songs table but only on those rows
// which are duplicated. By duplication we mean a situation where two or more songs
// with equal (artist, album, title) tuple exist (case sensitive).
// Please note that this flag is mutually exclusive with the 'filter' attribute!
bool duplicates_only;
QueryMode query_mode;
};
class LibraryQuery {

View File

@ -5,13 +5,24 @@ class QueryOptions {
%End
public:
enum QueryMode {
QueryMode_All,
QueryMode_Duplicates,
QueryMode_Untagged
};
QueryOptions();
bool Matches(const Song& song) const;
QString filter;
int max_age;
bool duplicates_only;
QString get_filter() const;
void set_filter(QString filter);
int get_max_age() const;
void set_max_age(int max_age);
QueryMode get_query_mode() const;
void set_query_mode(QueryMode view);
};
class LibraryQuery {

View File

@ -2102,21 +2102,27 @@ msgstr ""
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr ""
msgid "Show in various artists"
msgstr ""
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr ""

View File

@ -2116,21 +2116,27 @@ msgstr ""
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr ""
msgid "Show in various artists"
msgstr ""
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr ""

View File

@ -2138,21 +2138,27 @@ msgstr "Показване на красиво OSD"
msgid "Show above status bar"
msgstr "Покажи над status bar-а"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "Покажи всичките песни"
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Покажи в пълен размер..."
msgid "Show in various artists"
msgstr "Показвай в смесени артисти"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "Показване на бутоните \"харесвам\" и \"бан\""

View File

@ -2104,21 +2104,27 @@ msgstr ""
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr ""
msgid "Show in various artists"
msgstr ""
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr ""

View File

@ -2139,21 +2139,27 @@ msgstr "Mostra un OSD bonic"
msgid "Show above status bar"
msgstr "Mostra sota la barra d'estat"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Mostra a mida completa..."
msgid "Show in various artists"
msgstr "Mostra a Artiste"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr ""

View File

@ -2141,21 +2141,27 @@ msgstr "Používat oznámení Clementine"
msgid "Show above status bar"
msgstr "Ukázat nad stavovým řádkem"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "Ukázat všechny písničky"
msgid "Show cover art in library"
msgstr "Ukázat obal v knihovně"
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Ukázat plnou velikost..."
msgid "Show in various artists"
msgstr "Ukázat pod různými umělci"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "Ukázat tlačítka \"Milovat\" a \"Zakázat\""

View File

@ -2102,21 +2102,27 @@ msgstr ""
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr ""
msgid "Show in various artists"
msgstr ""
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr ""

View File

@ -2107,21 +2107,27 @@ msgstr "Vis en køn OSD"
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Vis i fuld størrelse..."
msgid "Show in various artists"
msgstr "Vis under diverse kunstnere"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "Vis \"elsker\" og \"bandlys\"-knapperne"

View File

@ -2143,21 +2143,27 @@ msgstr "Clementines Benachrichtigungen benutzen"
msgid "Show above status bar"
msgstr "Über der Statusleiste zeigen"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "Alle Titel anzeigen"
msgid "Show cover art in library"
msgstr "Zeigt Cover in Musiksammlung an"
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Vollbild..."
msgid "Show in various artists"
msgstr "Unter \"Verschiedene Interpreten\" anzeigen"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "\"Lieben\" und \"Bannen\" Knöpfe anzeigen"

View File

@ -2152,21 +2152,27 @@ msgstr "Εμφάνισε ένα όμορφο OSD"
msgid "Show above status bar"
msgstr "Εμφάνιση πάνω από την μπάρα κατάστασης"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "Εμφάνιση όλλων των τραγουδιών"
msgid "Show cover art in library"
msgstr "Εμφάνιση του εξώφυλλου στην βιβλιοθήκη"
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Εμφάνισε σε πλήρες μέγεθος..."
msgid "Show in various artists"
msgstr "Εμφάνιση στους διάφορους καλλιτέχνες"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "Εμφάνισε τα κουμπιά \"αγάπη\"και \"απαγόρευση\""

View File

@ -2102,21 +2102,27 @@ msgstr ""
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr ""
msgid "Show in various artists"
msgstr ""
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr ""

View File

@ -2106,21 +2106,27 @@ msgstr "Show a pretty OSD"
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Show fullsize..."
msgid "Show in various artists"
msgstr "Show in various artists"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "Show the \"love\" and \"ban\" buttons"

View File

@ -2103,21 +2103,27 @@ msgstr "Show a pretty OSD"
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Show fullsize..."
msgid "Show in various artists"
msgstr "Show in various artists"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "Show the \"love\" and \"ban\" buttons"

View File

@ -2102,21 +2102,27 @@ msgstr ""
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr ""
msgid "Show in various artists"
msgstr ""
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr ""

View File

@ -2151,21 +2151,27 @@ msgstr "Mostrar OSD Estético"
msgid "Show above status bar"
msgstr "Mostrar la barra de estado superior"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "Mostrar todas las canciones"
msgid "Show cover art in library"
msgstr "Mostrar portadas en la librería"
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Mostrar carátula..."
msgid "Show in various artists"
msgstr "Mostrar en Varios artistas"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "Mostrar los botones \"Me encanta\" y \"Prohibir\""

View File

@ -2103,21 +2103,27 @@ msgstr ""
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "Näita kõiki laule"
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr ""
msgid "Show in various artists"
msgstr ""
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr ""

View File

@ -2102,21 +2102,27 @@ msgstr ""
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr ""
msgid "Show in various artists"
msgstr ""
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr ""

View File

@ -2103,21 +2103,27 @@ msgstr ""
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr ""
msgid "Show in various artists"
msgstr ""
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr ""

View File

@ -2157,21 +2157,27 @@ msgstr "Utiliser l'affichage à l'écran (OSD)"
msgid "Show above status bar"
msgstr "Afficher au dessus de la barre d'état"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "Afficher tous les morceaux"
msgid "Show cover art in library"
msgstr "Afficher les jaquettes des albums dans la bibliothèque"
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Afficher en taille réelle..."
msgid "Show in various artists"
msgstr "Classer dans la catégorie «Compilations d'artistes»"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "Montrer les boutons « j'aime » et « je déteste »"

View File

@ -2111,21 +2111,27 @@ msgstr ""
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr ""
msgid "Show in various artists"
msgstr "Mostrar en vários artistas"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr ""

View File

@ -2122,21 +2122,27 @@ msgstr "הצגת OSD"
msgid "Show above status bar"
msgstr "הצג מעל לשורת המצב"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "הצג את כל השירים"
msgid "Show cover art in library"
msgstr "הצגת עטיפת אלבום בספרייה"
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "הצג על מסך מלא..."
msgid "Show in various artists"
msgstr "הצג תחת אמנים שונים"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "להציג את הלחצנים \"אוהב\" ו-\"חסום\""

View File

@ -2102,21 +2102,27 @@ msgstr ""
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr ""
msgid "Show in various artists"
msgstr ""
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr ""

View File

@ -2134,21 +2134,27 @@ msgstr "Prikaži ljepši OSD"
msgid "Show above status bar"
msgstr "Prikaži iznad statusne trake"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "Prikaži sve pjesme"
msgid "Show cover art in library"
msgstr "Prikaži omot albuma u zbirci"
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Prikaži u punoj veličini..."
msgid "Show in various artists"
msgstr "Prikaži u različitim izvođačima"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "Prikaži \"Sviđa mi se\" i \"Zabrana\" tipku"

View File

@ -2140,21 +2140,27 @@ msgstr "Pretty OSD megjelenítése"
msgid "Show above status bar"
msgstr "Jelenítse meg az állapotsáv fölött"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "Minden számot mutasson"
msgid "Show cover art in library"
msgstr "Albumborító megjelenítése a zenetárban"
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Jelenítse meg teljes méretben..."
msgid "Show in various artists"
msgstr "Jelenítse meg a különböző előadók között"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "Jelenítse meg a \"kedvenc\" és \"tiltás\" gombokat"

View File

@ -2146,21 +2146,27 @@ msgstr "Mostra un OSD gradevole"
msgid "Show above status bar"
msgstr "Mostra la barra di stato superiore"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "Mostra tutti i brani"
msgid "Show cover art in library"
msgstr "Mostra le copertine nella raccolta"
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Mostra a dimensioni originali..."
msgid "Show in various artists"
msgstr "Mostra in artisti vari"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "Mostra i pulsanti \"Mi piace\" e \"Vieta\""

View File

@ -2131,21 +2131,27 @@ msgstr "Pretty OSD を表示する"
msgid "Show above status bar"
msgstr "ステータス バーの上に表示"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "すべての曲を表示"
msgid "Show cover art in library"
msgstr "ライブラリにカバー アートを表示"
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "原寸表示"
msgid "Show in various artists"
msgstr "さまざまなアーティストに表示する"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "\"Love\" および \"Ban\" ボタンを表示する"

View File

@ -2102,21 +2102,27 @@ msgstr ""
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr ""
msgid "Show in various artists"
msgstr ""
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr ""

View File

@ -2135,21 +2135,27 @@ msgstr "Rodyti gražų OSD"
msgid "Show above status bar"
msgstr "Rodyti virš būsenos juostos"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "Rodyti visas dainas"
msgid "Show cover art in library"
msgstr "Rodyti albumo viršelius fonotekoje"
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Rodyti viso dydžio..."
msgid "Show in various artists"
msgstr "Rodyti įvairiuose atlikėjuose"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "Rodyti \"meilė\" ir \"blokavimas\" mygtukus"

View File

@ -2102,21 +2102,27 @@ msgstr ""
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr ""
msgid "Show in various artists"
msgstr "Rādīt pie dažādiem izpildītājiem"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr ""

View File

@ -2114,21 +2114,27 @@ msgstr "Vis en Clementine-spesifikk skrivebordsmelding"
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Vis i fullskjerm..."
msgid "Show in various artists"
msgstr "Vis under Diverse Artister"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "Vis \"Elsk\" og \"Bannlys\" knappene"

View File

@ -2138,21 +2138,27 @@ msgstr "Mooie OSD weergeven"
msgid "Show above status bar"
msgstr "Boven statusbalk weergeven"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "Alle nummers weergeven"
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Volledig weergeven..."
msgid "Show in various artists"
msgstr "In diverse artiesten weergeven"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "\"Mooi\" en \"ban\" knoppen weergeven"

View File

@ -2102,21 +2102,27 @@ msgstr ""
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr ""
msgid "Show in various artists"
msgstr ""
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr ""

View File

@ -2139,21 +2139,27 @@ msgstr "Pokazuj ładne OSD (menu ekranowe)"
msgid "Show above status bar"
msgstr "Pokaż ponad paskiem stanu"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "Pokaż wszystkie ścieżki"
msgid "Show cover art in library"
msgstr "Pokazuj okładki w bibliotece"
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Pokaż w pełnej wielkości..."
msgid "Show in various artists"
msgstr "Pokaż w różni wykonawcy"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "Pokaż przyciski \"Dodaj do ulubionych\" i \"Zbanuj\""

View File

@ -2142,21 +2142,27 @@ msgstr "Mostrar um OSD personalizado"
msgid "Show above status bar"
msgstr "Mostrar acima da barra de estado"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "Mostrar todas as músicas"
msgid "Show cover art in library"
msgstr "Mostrar capa de álbum na coleção"
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Mostrar tamanho total..."
msgid "Show in various artists"
msgstr "Mostrar em vários artistas"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "Mostrar os botões \"adorar\" e \"banir\""

View File

@ -2140,21 +2140,27 @@ msgstr "Mostrar aviso estilizado na tela"
msgid "Show above status bar"
msgstr "Mostrar acima da barra de status"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "Mostrar todas as músicas"
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Exibir tamanho real..."
msgid "Show in various artists"
msgstr "Exibir em vários artistas"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "Exibir os botões \"adoro\" e \"odeio\""

View File

@ -2102,21 +2102,27 @@ msgstr ""
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr ""
msgid "Show in various artists"
msgstr "Arată în artiști diferiți"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr ""

View File

@ -2133,21 +2133,27 @@ msgstr "Показывать OSD"
msgid "Show above status bar"
msgstr "Показать над строкой состояния"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "Показать все песни"
msgid "Show cover art in library"
msgstr "Показывать обложки в библиотеке"
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Показать полный размер..."
msgid "Show in various artists"
msgstr "Показать в \"Разных исполнителях\""
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "Показывать кнопки \"Избранное\" и \"Запретить\""

View File

@ -2131,21 +2131,27 @@ msgstr "Zobrazovať krásne OSD"
msgid "Show above status bar"
msgstr "Zobraziť nad stavovou lištou"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "Zobraziť všetky piesne"
msgid "Show cover art in library"
msgstr "Zobraziť obaly albumov v zbierke"
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Zobraziť celú veľkosť..."
msgid "Show in various artists"
msgstr "Zobrazovať v rôznich interprétoch"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "Zobrazovať \"obľúbené\" a \"zakázané\" tlačítka"

View File

@ -2133,21 +2133,27 @@ msgstr "Pokaži lep zaslonski prikaz"
msgid "Show above status bar"
msgstr "Pokaži nad vrstico stanja"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "Pokaži vse skladbe"
msgid "Show cover art in library"
msgstr "Kaži ovitek albuma v knjižnici"
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Pokaži v polni velikosti ..."
msgid "Show in various artists"
msgstr "Pokaži med \"Različni izvajalci\""
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "Pokaži gumbe \"Priljubljena\" in \"Blokiraj\""

View File

@ -2106,21 +2106,27 @@ msgstr ""
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr ""
msgid "Show in various artists"
msgstr ""
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr ""

View File

@ -2135,21 +2135,27 @@ msgstr "Visa en skön notifiering"
msgid "Show above status bar"
msgstr "Visa ovanför statusraden"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "Visa alla låtarna"
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Visa full storlek..."
msgid "Show in various artists"
msgstr "Visa i diverse artister"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "Visa knapparna \"Älska\" och \"Blockera\""

View File

@ -2132,21 +2132,27 @@ msgstr "Şirin bir OSD göster"
msgid "Show above status bar"
msgstr "Durum çubuğunun üzerinde göster"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "Tüm şarkıları göster"
msgid "Show cover art in library"
msgstr "Kapak resmini kütüphanede göster"
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Tam boyutta göster"
msgid "Show in various artists"
msgstr "Çeşitli sanatçılarda göster"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "\"Beğen\" ve \"Yasakla\" tuşlarını göster"

View File

@ -2092,21 +2092,27 @@ msgstr ""
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr ""
msgid "Show in various artists"
msgstr ""
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr ""

View File

@ -2132,21 +2132,27 @@ msgstr "Показувати приємні повідомлення OSD"
msgid "Show above status bar"
msgstr "Показати вище, в рядку стану"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "Показати всі композиції"
msgid "Show cover art in library"
msgstr "Показувати обкладинки у фонотеці"
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "Показати на повний розмір..."
msgid "Show in various artists"
msgstr "Показувати в різних виконавцях"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "Показувати кнопки \"love\" та \"ban\""

View File

@ -2104,21 +2104,27 @@ msgstr ""
msgid "Show above status bar"
msgstr ""
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr ""
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr ""
msgid "Show in various artists"
msgstr ""
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "显示“标记喜爱”和“禁止”按钮"

View File

@ -2106,21 +2106,27 @@ msgstr "顯示一個漂亮的OSD"
msgid "Show above status bar"
msgstr "顯示在狀態欄上方"
msgid "Show all songs"
msgstr ""
msgid "Show all the songs"
msgstr "顯示所有的歌曲"
msgid "Show cover art in library"
msgstr ""
msgid "Show duplicates only"
msgstr ""
msgid "Show fullsize..."
msgstr "全螢幕..."
msgid "Show in various artists"
msgstr "顯示各演唱者"
msgid "Show only duplicates"
msgstr ""
msgid "Show only untagged"
msgstr ""
msgid "Show the \"love\" and \"ban\" buttons"
msgstr "顯示 [喜愛] 和 [禁止] 按鈕"

View File

@ -419,9 +419,18 @@ MainWindow::MainWindow(
connect(device_view_, SIGNAL(AddToPlaylistSignal(QMimeData*)), SLOT(AddToPlaylist(QMimeData*)));
// Library filter widget
QAction* duplicates_only_action = new QAction(tr("Show duplicates only"), this);
duplicates_only_action->setCheckable(true);
connect(duplicates_only_action, SIGNAL(toggled(bool)), library_view_->filter(), SLOT(SetDuplicatesOnly(bool)));
QActionGroup* library_view_group = new QActionGroup(this);
library_show_all_ = library_view_group->addAction(tr("Show all songs"));
library_show_duplicates_ = library_view_group->addAction(tr("Show only duplicates"));
library_show_untagged_ = library_view_group->addAction(tr("Show only untagged"));
library_show_all_->setCheckable(true);
library_show_duplicates_->setCheckable(true);
library_show_untagged_->setCheckable(true);
library_show_all_->setChecked(true);
connect(library_view_group, SIGNAL(triggered(QAction*)), SLOT(ChangeLibraryQueryMode(QAction*)));
QAction* library_config_action = new QAction(
IconLoader::Load("configure"), tr("Configure library..."), this);
@ -432,7 +441,9 @@ MainWindow::MainWindow(
QAction* separator = new QAction(this);
separator->setSeparator(true);
library_view_->filter()->AddMenuAction(duplicates_only_action);
library_view_->filter()->AddMenuAction(library_show_all_);
library_view_->filter()->AddMenuAction(library_show_duplicates_);
library_view_->filter()->AddMenuAction(library_show_untagged_);
library_view_->filter()->AddMenuAction(separator);
library_view_->filter()->AddMenuAction(library_config_action);
@ -1563,6 +1574,16 @@ void MainWindow::PlaylistCopyToDevice() {
}
}
void MainWindow::ChangeLibraryQueryMode(QAction* action) {
if(action == library_show_duplicates_) {
library_view_->filter()->SetQueryMode(QueryOptions::QueryMode_Duplicates);
} else if (action == library_show_untagged_) {
library_view_->filter()->SetQueryMode(QueryOptions::QueryMode_Untagged);
} else {
library_view_->filter()->SetQueryMode(QueryOptions::QueryMode_All);
}
}
#ifdef HAVE_LIBLASTFM
void MainWindow::ShowCoverManager() {
if (!cover_manager_) {

View File

@ -161,6 +161,8 @@ class MainWindow : public QMainWindow, public PlatformInterface {
void PlaylistOrganiseSelected(bool copy);
void PlaylistDelete();
void ChangeLibraryQueryMode(QAction* action);
void PlayIndex(const QModelIndex& index);
void StopAfterCurrent();
@ -283,6 +285,10 @@ class MainWindow : public QMainWindow, public PlatformInterface {
ScriptManager* scripts_;
boost::scoped_ptr<ScriptDialog> script_dialog_;
QAction* library_show_all_;
QAction* library_show_duplicates_;
QAction* library_show_untagged_;
QMenu* playlist_menu_;
QAction* playlist_play_pause_;
QAction* playlist_stop_after_;