Make the playlist header present a one-level menu for showing and hiding columns. Fixes issue #381
This commit is contained in:
parent
07ba35ff6d
commit
3fe941f5c1
|
@ -24,12 +24,10 @@
|
|||
PlaylistHeader::PlaylistHeader(Qt::Orientation orientation, QWidget* parent)
|
||||
: QHeaderView(orientation, parent),
|
||||
menu_(new QMenu(this)),
|
||||
show_menu_(new QMenu(this)),
|
||||
show_mapper_(new QSignalMapper(this))
|
||||
{
|
||||
hide_action_ = menu_->addAction(tr("Hide..."), this, SLOT(HideCurrent()));
|
||||
QAction* show_action = menu_->addAction(tr("Show section"));
|
||||
show_action->setMenu(show_menu_);
|
||||
menu_->addSeparator();
|
||||
|
||||
connect(show_mapper_, SIGNAL(mapped(int)), SLOT(ToggleVisible(int)));
|
||||
}
|
||||
|
@ -47,7 +45,8 @@ void PlaylistHeader::contextMenuEvent(QContextMenuEvent* e) {
|
|||
hide_action_->setText(tr("Hide %1").arg(title));
|
||||
}
|
||||
|
||||
show_menu_->clear();
|
||||
qDeleteAll(show_actions_);
|
||||
show_actions_.clear();
|
||||
for (int i=0 ; i<count() ; ++i) {
|
||||
AddColumnAction(i);
|
||||
}
|
||||
|
@ -58,9 +57,10 @@ void PlaylistHeader::contextMenuEvent(QContextMenuEvent* e) {
|
|||
void PlaylistHeader::AddColumnAction(int index) {
|
||||
QString title(model()->headerData(index, Qt::Horizontal).toString());
|
||||
|
||||
QAction* action = show_menu_->addAction(title, show_mapper_, SLOT(map()));
|
||||
QAction* action = menu_->addAction(title, show_mapper_, SLOT(map()));
|
||||
action->setCheckable(true);
|
||||
action->setChecked(!isSectionHidden(index));
|
||||
show_actions_ << action;
|
||||
|
||||
show_mapper_->setMapping(action, index);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ class PlaylistHeader : public QHeaderView {
|
|||
int menu_section_;
|
||||
QMenu* menu_;
|
||||
QAction* hide_action_;
|
||||
QMenu* show_menu_;
|
||||
QList<QAction*> show_actions_;
|
||||
|
||||
QSignalMapper* show_mapper_;
|
||||
};
|
||||
|
|
|
@ -289,9 +289,6 @@ msgstr "المجرى"
|
|||
msgid "Hide..."
|
||||
msgstr "إخفاء..."
|
||||
|
||||
msgid "Show section"
|
||||
msgstr "اظهر القسم"
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "أخفِ %1"
|
||||
|
@ -1415,5 +1412,8 @@ msgstr ""
|
|||
msgid "0:00:00"
|
||||
msgstr ""
|
||||
|
||||
#~ msgid "Show section"
|
||||
#~ msgstr "اظهر القسم"
|
||||
|
||||
#~ msgid "Options"
|
||||
#~ msgstr "خيارات"
|
||||
|
|
|
@ -290,9 +290,6 @@ msgstr "Proud"
|
|||
msgid "Hide..."
|
||||
msgstr "Skrýt..."
|
||||
|
||||
msgid "Show section"
|
||||
msgstr "Zobrazit skeci"
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "Skrýt %1"
|
||||
|
@ -1419,6 +1416,9 @@ msgstr ""
|
|||
msgid "0:00:00"
|
||||
msgstr "0:00:00"
|
||||
|
||||
#~ msgid "Show section"
|
||||
#~ msgstr "Zobrazit skeci"
|
||||
|
||||
#~ msgid "Enter your Last.fm details below:"
|
||||
#~ msgstr "Níže zadejte přihlašovací údaje pro Last.fm:"
|
||||
|
||||
|
|
|
@ -292,9 +292,6 @@ msgstr "Stream"
|
|||
msgid "Hide..."
|
||||
msgstr "Skjul..."
|
||||
|
||||
msgid "Show section"
|
||||
msgstr "Vis sektion"
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "Skjul %1"
|
||||
|
@ -1422,6 +1419,9 @@ msgstr ""
|
|||
msgid "0:00:00"
|
||||
msgstr "0:00:00"
|
||||
|
||||
#~ msgid "Show section"
|
||||
#~ msgstr "Vis sektion"
|
||||
|
||||
#~ msgid "Enter your Last.fm details below:"
|
||||
#~ msgstr "Indtast dine Last.fm-detaljer herunder:"
|
||||
|
||||
|
|
|
@ -290,9 +290,6 @@ msgstr "Stream"
|
|||
msgid "Hide..."
|
||||
msgstr "Verstecken..."
|
||||
|
||||
msgid "Show section"
|
||||
msgstr "Spalten"
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "%1 ausblenden"
|
||||
|
@ -1423,6 +1420,9 @@ msgstr ""
|
|||
msgid "0:00:00"
|
||||
msgstr "0:00:00"
|
||||
|
||||
#~ msgid "Show section"
|
||||
#~ msgstr "Spalten"
|
||||
|
||||
#~ msgid "Enter your Last.fm details below:"
|
||||
#~ msgstr "Geben Sie hier Ihre Last.fm Daten ein:"
|
||||
|
||||
|
|
|
@ -293,9 +293,6 @@ msgstr "Stream"
|
|||
msgid "Hide..."
|
||||
msgstr "Απόκρυψη..."
|
||||
|
||||
msgid "Show section"
|
||||
msgstr "Εμφάνιση τμήματος"
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "Απόκρυψη %1"
|
||||
|
@ -1425,6 +1422,9 @@ msgstr "Σφάλμα του Clementine."
|
|||
msgid "0:00:00"
|
||||
msgstr "0:00:00"
|
||||
|
||||
#~ msgid "Show section"
|
||||
#~ msgstr "Εμφάνιση τμήματος"
|
||||
|
||||
#~ msgid "Enter your Last.fm details below:"
|
||||
#~ msgstr "Εισάγετε τις λεπτομέρειες για το Last.fm:"
|
||||
|
||||
|
|
|
@ -290,9 +290,6 @@ msgstr "Stream"
|
|||
msgid "Hide..."
|
||||
msgstr "Hide..."
|
||||
|
||||
msgid "Show section"
|
||||
msgstr "Show section"
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "Hide %1"
|
||||
|
@ -1420,6 +1417,9 @@ msgstr "Clementine Error"
|
|||
msgid "0:00:00"
|
||||
msgstr "0:00:00"
|
||||
|
||||
#~ msgid "Show section"
|
||||
#~ msgstr "Show section"
|
||||
|
||||
#~ msgid "Enter your Last.fm details below:"
|
||||
#~ msgstr "Enter your Last.fm details below:"
|
||||
|
||||
|
|
|
@ -289,9 +289,6 @@ msgstr "Stream"
|
|||
msgid "Hide..."
|
||||
msgstr "Hide..."
|
||||
|
||||
msgid "Show section"
|
||||
msgstr "Show section"
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "Hide %1"
|
||||
|
@ -1417,6 +1414,9 @@ msgstr ""
|
|||
msgid "0:00:00"
|
||||
msgstr "0:00:00"
|
||||
|
||||
#~ msgid "Show section"
|
||||
#~ msgstr "Show section"
|
||||
|
||||
#~ msgid "Enter your Last.fm details below:"
|
||||
#~ msgstr "Enter your Last.fm details below:"
|
||||
|
||||
|
|
|
@ -292,9 +292,6 @@ msgstr "Transmisión"
|
|||
msgid "Hide..."
|
||||
msgstr "Ocultar..."
|
||||
|
||||
msgid "Show section"
|
||||
msgstr "Mostrar columna"
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "Ocultar %1"
|
||||
|
@ -1431,6 +1428,9 @@ msgstr "Error de Clementine"
|
|||
msgid "0:00:00"
|
||||
msgstr "0:00:00"
|
||||
|
||||
#~ msgid "Show section"
|
||||
#~ msgstr "Mostrar columna"
|
||||
|
||||
#~ msgid "Enter your Last.fm details below:"
|
||||
#~ msgstr "Ingrese su información de Last.fm debajo:"
|
||||
|
||||
|
|
|
@ -289,9 +289,6 @@ msgstr ""
|
|||
msgid "Hide..."
|
||||
msgstr "Piilota"
|
||||
|
||||
msgid "Show section"
|
||||
msgstr ""
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "Piilota %1"
|
||||
|
|
|
@ -290,9 +290,6 @@ msgstr "Flux"
|
|||
msgid "Hide..."
|
||||
msgstr "Masquer..."
|
||||
|
||||
msgid "Show section"
|
||||
msgstr "Montrer la colonne"
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "Masquer %1"
|
||||
|
@ -1427,6 +1424,9 @@ msgstr ""
|
|||
msgid "0:00:00"
|
||||
msgstr "0:00:00"
|
||||
|
||||
#~ msgid "Show section"
|
||||
#~ msgstr "Montrer la colonne"
|
||||
|
||||
#~ msgid "Enter your Last.fm details below:"
|
||||
#~ msgstr "Inscrivez vos identifiants Last.fm ci-dessous :"
|
||||
|
||||
|
|
|
@ -289,9 +289,6 @@ msgstr "Fluxo"
|
|||
msgid "Hide..."
|
||||
msgstr "Esconder..."
|
||||
|
||||
msgid "Show section"
|
||||
msgstr "Mostrar a seczón"
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "Esconder %1"
|
||||
|
@ -1416,3 +1413,6 @@ msgstr ""
|
|||
|
||||
msgid "0:00:00"
|
||||
msgstr ""
|
||||
|
||||
#~ msgid "Show section"
|
||||
#~ msgstr "Mostrar a seczón"
|
||||
|
|
|
@ -292,9 +292,6 @@ msgstr "Flusso"
|
|||
msgid "Hide..."
|
||||
msgstr "Nascondi..."
|
||||
|
||||
msgid "Show section"
|
||||
msgstr "Mostra sezione"
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "Nascondi %1"
|
||||
|
@ -1428,6 +1425,9 @@ msgstr "Errore di Clementine"
|
|||
msgid "0:00:00"
|
||||
msgstr "0:00:00"
|
||||
|
||||
#~ msgid "Show section"
|
||||
#~ msgstr "Mostra sezione"
|
||||
|
||||
#~ msgid "Enter your Last.fm details below:"
|
||||
#~ msgstr "Inserisci di seguito i tuoi dettagli Last.fm:"
|
||||
|
||||
|
|
|
@ -289,9 +289,6 @@ msgstr "Ағындық"
|
|||
msgid "Hide..."
|
||||
msgstr ""
|
||||
|
||||
msgid "Show section"
|
||||
msgstr ""
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "%1 жасыру"
|
||||
|
|
|
@ -289,9 +289,6 @@ msgstr "Strøm"
|
|||
msgid "Hide..."
|
||||
msgstr "Skjul..."
|
||||
|
||||
msgid "Show section"
|
||||
msgstr "Vis del"
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "Skjul %1"
|
||||
|
@ -1419,6 +1416,9 @@ msgstr ""
|
|||
msgid "0:00:00"
|
||||
msgstr "0:00:00"
|
||||
|
||||
#~ msgid "Show section"
|
||||
#~ msgstr "Vis del"
|
||||
|
||||
#~ msgid "Enter your Last.fm details below:"
|
||||
#~ msgstr "Fyll inn din Last.fm brukerinformasjon under:"
|
||||
|
||||
|
|
|
@ -289,9 +289,6 @@ msgstr "Flux"
|
|||
msgid "Hide..."
|
||||
msgstr "Amagar..."
|
||||
|
||||
msgid "Show section"
|
||||
msgstr ""
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "Amagar « %1 »"
|
||||
|
|
|
@ -290,9 +290,6 @@ msgstr ""
|
|||
msgid "Hide..."
|
||||
msgstr "Ukryj..."
|
||||
|
||||
msgid "Show section"
|
||||
msgstr "Pokaż sekcję"
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "Ukryj %1"
|
||||
|
@ -1417,6 +1414,9 @@ msgstr ""
|
|||
msgid "0:00:00"
|
||||
msgstr ""
|
||||
|
||||
#~ msgid "Show section"
|
||||
#~ msgstr "Pokaż sekcję"
|
||||
|
||||
#~ msgid "Enter your Last.fm details below:"
|
||||
#~ msgstr "Podaj swoje dane dla Last.fm:"
|
||||
|
||||
|
|
|
@ -291,9 +291,6 @@ msgstr "Emissão"
|
|||
msgid "Hide..."
|
||||
msgstr "Ocultar..."
|
||||
|
||||
msgid "Show section"
|
||||
msgstr "Mostrar secção"
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "Ocultar %1"
|
||||
|
@ -1422,6 +1419,9 @@ msgstr "Erro do Clementine"
|
|||
msgid "0:00:00"
|
||||
msgstr "0:00:00"
|
||||
|
||||
#~ msgid "Show section"
|
||||
#~ msgstr "Mostrar secção"
|
||||
|
||||
#~ msgid "Enter your Last.fm details below:"
|
||||
#~ msgstr "Introduza em baixo os seus detalhes Last.fm:"
|
||||
|
||||
|
|
|
@ -291,9 +291,6 @@ msgstr "Transmissão online"
|
|||
msgid "Hide..."
|
||||
msgstr "Esconder..."
|
||||
|
||||
msgid "Show section"
|
||||
msgstr "Mostrar sessão"
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "Ocultar %1"
|
||||
|
@ -1425,6 +1422,9 @@ msgstr ""
|
|||
msgid "0:00:00"
|
||||
msgstr "0:00:00"
|
||||
|
||||
#~ msgid "Show section"
|
||||
#~ msgstr "Mostrar sessão"
|
||||
|
||||
#~ msgid "Enter your Last.fm details below:"
|
||||
#~ msgstr "Digite seus dados do Last.fm abaixo:"
|
||||
|
||||
|
|
|
@ -289,9 +289,6 @@ msgstr "Flux"
|
|||
msgid "Hide..."
|
||||
msgstr "Ascunde..."
|
||||
|
||||
msgid "Show section"
|
||||
msgstr "Arată secțiune"
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "Ascunde %1"
|
||||
|
@ -1416,6 +1413,9 @@ msgstr ""
|
|||
msgid "0:00:00"
|
||||
msgstr "0:00:00"
|
||||
|
||||
#~ msgid "Show section"
|
||||
#~ msgstr "Arată secțiune"
|
||||
|
||||
#~ msgid "Radio"
|
||||
#~ msgstr "Radio"
|
||||
|
||||
|
|
|
@ -290,9 +290,6 @@ msgstr "Поток"
|
|||
msgid "Hide..."
|
||||
msgstr "Скрыть..."
|
||||
|
||||
msgid "Show section"
|
||||
msgstr "Показать секцию"
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "Скрыть %1"
|
||||
|
@ -1422,6 +1419,9 @@ msgstr ""
|
|||
msgid "0:00:00"
|
||||
msgstr "0:00:00"
|
||||
|
||||
#~ msgid "Show section"
|
||||
#~ msgstr "Показать секцию"
|
||||
|
||||
#~ msgid "Enter your Last.fm details below:"
|
||||
#~ msgstr "Введите ваши данные Last.fm:"
|
||||
|
||||
|
|
|
@ -291,9 +291,6 @@ msgstr "Stream"
|
|||
msgid "Hide..."
|
||||
msgstr "Skryť..."
|
||||
|
||||
msgid "Show section"
|
||||
msgstr "Zobraziť stĺpec"
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "Skryť %1"
|
||||
|
@ -1422,6 +1419,9 @@ msgstr "Chyba Clementine"
|
|||
msgid "0:00:00"
|
||||
msgstr "0:00:00"
|
||||
|
||||
#~ msgid "Show section"
|
||||
#~ msgstr "Zobraziť stĺpec"
|
||||
|
||||
#~ msgid "Enter your Last.fm details below:"
|
||||
#~ msgstr "Vložte svoje Last.fm detaily nižšie:"
|
||||
|
||||
|
|
|
@ -289,9 +289,6 @@ msgstr "Ström"
|
|||
msgid "Hide..."
|
||||
msgstr "Dölj..."
|
||||
|
||||
msgid "Show section"
|
||||
msgstr "Visa kolumn"
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "Dölj %1"
|
||||
|
@ -1422,6 +1419,9 @@ msgstr ""
|
|||
msgid "0:00:00"
|
||||
msgstr "0:00:00"
|
||||
|
||||
#~ msgid "Show section"
|
||||
#~ msgstr "Visa kolumn"
|
||||
|
||||
#~ msgid "Enter your Last.fm details below:"
|
||||
#~ msgstr "Fyll i dina Last.fm uppgifter nedan:"
|
||||
|
||||
|
|
|
@ -289,9 +289,6 @@ msgstr ""
|
|||
msgid "Hide..."
|
||||
msgstr ""
|
||||
|
||||
msgid "Show section"
|
||||
msgstr ""
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "Gizle %1"
|
||||
|
|
|
@ -289,9 +289,6 @@ msgstr "流媒体"
|
|||
msgid "Hide..."
|
||||
msgstr "隐藏..."
|
||||
|
||||
msgid "Show section"
|
||||
msgstr ""
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr "隐藏 %1"
|
||||
|
|
|
@ -289,9 +289,6 @@ msgstr ""
|
|||
msgid "Hide..."
|
||||
msgstr ""
|
||||
|
||||
msgid "Show section"
|
||||
msgstr ""
|
||||
|
||||
#, qt-format
|
||||
msgid "Hide %1"
|
||||
msgstr ""
|
||||
|
|
Loading…
Reference in New Issue