First go at a UI for playlist search and multiple playlists. Nothing works yet.

This commit is contained in:
David Sansome 2010-05-20 14:12:15 +00:00
parent a95fb6d1e6
commit b116d4a306
34 changed files with 895 additions and 60 deletions

View File

@ -172,5 +172,8 @@
<file>icons/48x48/zoom-in.png</file>
<file>icons/22x22/x-clementine-album.png</file>
<file>icons/22x22/x-clementine-artist.png</file>
<file>icons/22x22/document-new.png</file>
<file>icons/32x32/document-new.png</file>
<file>icons/48x48/document-new.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 873 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -44,6 +44,7 @@ class Library : public QObject {
void Init();
void StartThreads();
LibraryBackend* backend() const { return backend_; }
LibraryModel* model() const { return model_; }
private slots:

View File

@ -5,10 +5,12 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set(SOURCES
playlist.cpp
playlistbackend.cpp
playlistcontainer.cpp
playlistdelegates.cpp
playlistheader.cpp
playlistitem.cpp
playlistsequence.cpp
playlisttabbar.cpp
playlistundocommands.cpp
playlistview.cpp
songplaylistitem.cpp
@ -17,14 +19,17 @@ set(SOURCES
set(HEADERS
playlist.h
playlistbackend.h
playlistcontainer.h
playlistdelegates.h
playlistheader.h
playlistsequence.h
playlisttabbar.h
playlistview.h
songmimedata.h
)
set(UI
playlistcontainer.ui
playlistsequence.ui
)

View File

@ -0,0 +1,63 @@
/* 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 "playlistcontainer.h"
#include "ui_playlistcontainer.h"
#include "ui/iconloader.h"
PlaylistContainer::PlaylistContainer(QWidget *parent)
: QWidget(parent),
ui_(new Ui_PlaylistContainer)
{
ui_->setupUi(this);
// Icons
ui_->clear->setIcon(IconLoader::Load("edit-clear-locationbar-ltr"));
// Tab bar
ui_->tab_bar->setExpanding(false);
ui_->tab_bar->setMovable(true);
ui_->tab_bar->setShape(QTabBar::RoundedSouth);
ui_->tab_bar->addTab("foo");
ui_->tab_bar->addTab("bar");
// Connections
connect(ui_->clear, SIGNAL(clicked()), SLOT(ClearFilter()));
connect(ui_->tab_bar, SIGNAL(Rename(int,QString)), SIGNAL(Rename(int,QString)));
connect(ui_->tab_bar, SIGNAL(Remove(int)), SIGNAL(Remove(int)));
}
PlaylistContainer::~PlaylistContainer() {
delete ui_;
}
PlaylistView* PlaylistContainer::view() const {
return ui_->playlist;
}
void PlaylistContainer::SetActions(
QAction *new_playlist, QAction *save_playlist, QAction *load_playlist) {
ui_->create_new->setDefaultAction(new_playlist);
ui_->save->setDefaultAction(save_playlist);
ui_->load->setDefaultAction(load_playlist);
ui_->tab_bar->SetActions(new_playlist, save_playlist, load_playlist);
}
void PlaylistContainer::ClearFilter() {
ui_->filter->clear();
ui_->filter->setFocus();
}

View File

@ -0,0 +1,49 @@
/* 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 PLAYLISTCONTAINER_H
#define PLAYLISTCONTAINER_H
#include <QWidget>
class Ui_PlaylistContainer;
class PlaylistView;
class PlaylistContainer : public QWidget {
Q_OBJECT
public:
PlaylistContainer(QWidget *parent = 0);
~PlaylistContainer();
void SetActions(QAction* new_playlist, QAction* save_playlist,
QAction* load_playlist);
PlaylistView* view() const;
signals:
void Rename(int index, const QString& new_name);
void Remove(int index);
private slots:
void ClearFilter();
private:
Ui_PlaylistContainer* ui_;
};
#endif // PLAYLISTCONTAINER_H

View File

@ -0,0 +1,161 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PlaylistContainer</class>
<widget class="QWidget" name="PlaylistContainer">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>987</width>
<height>707</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QToolButton" name="create_new">
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="load">
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="save">
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="undo">
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="redo">
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="clear">
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="LineEdit" name="filter">
<property name="hint" stdset="0">
<string>Playlist search</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="PlaylistView" name="playlist">
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="editTriggers">
<set>QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked</set>
</property>
<property name="dragEnabled">
<bool>true</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::DragDrop</enum>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="uniformRowHeights">
<bool>true</bool>
</property>
<property name="itemsExpandable">
<bool>false</bool>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="PlaylistTabBar" name="tab_bar" native="true"/>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>LineEdit</class>
<extends>QLineEdit</extends>
<header>widgets/lineedit.h</header>
</customwidget>
<customwidget>
<class>PlaylistView</class>
<extends>QTreeView</extends>
<header>playlist/playlistview.h</header>
</customwidget>
<customwidget>
<class>PlaylistTabBar</class>
<extends>QWidget</extends>
<header>playlist/playlisttabbar.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,69 @@
/* 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 "playlisttabbar.h"
#include "ui/iconloader.h"
#include <QContextMenuEvent>
#include <QMenu>
#include <QInputDialog>
PlaylistTabBar::PlaylistTabBar(QWidget *parent)
: QTabBar(parent),
menu_(new QMenu(this)),
menu_index_(-1)
{
rename_ = menu_->addAction(IconLoader::Load("edit-rename"), tr("Rename playlist"), this, SLOT(Rename()));
remove_ = menu_->addAction(IconLoader::Load("list-remove"), tr("Remove playlist"), this, SLOT(Remove()));
menu_->addSeparator();
}
void PlaylistTabBar::SetActions(
QAction* new_playlist, QAction* save_playlist, QAction* load_playlist) {
menu_->insertAction(0, new_playlist);
menu_->insertAction(0, save_playlist);
menu_->insertAction(0, load_playlist);
}
void PlaylistTabBar::contextMenuEvent(QContextMenuEvent* e) {
menu_index_ = tabAt(e->pos());
rename_->setEnabled(menu_index_ != -1);
remove_->setEnabled(menu_index_ != -1);
menu_->popup(e->globalPos());
}
void PlaylistTabBar::Rename() {
if (menu_index_ == -1)
return;
QString name = tabText(menu_index_);
name = QInputDialog::getText(
this, tr("Rename playlist"), tr("Enter a new name for this playlist"),
QLineEdit::Normal, name);
if (name.isNull())
return;
emit Rename(menu_index_, name);
}
void PlaylistTabBar::Remove() {
if (menu_index_ == -1)
return;
emit Remove(menu_index_);
}

View File

@ -0,0 +1,51 @@
/* 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 PLAYLISTTABBAR_H
#define PLAYLISTTABBAR_H
#include <QTabBar>
class QMenu;
class PlaylistTabBar : public QTabBar {
Q_OBJECT
public:
PlaylistTabBar(QWidget *parent = 0);
void SetActions(QAction* new_playlist, QAction* save_playlist,
QAction* load_playlist);
signals:
void Rename(int index, const QString& name);
void Remove(int index);
private slots:
void Rename();
void Remove();
protected:
void contextMenuEvent(QContextMenuEvent *);
private:
QMenu* menu_;
int menu_index_;
QAction* rename_;
QAction* remove_;
};
#endif // PLAYLISTTABBAR_H

View File

@ -374,6 +374,15 @@ msgstr "Zobrazit skeci"
msgid "Hide %1"
msgstr "Skrýt %1"
msgid "Rename playlist"
msgstr ""
msgid "Remove playlist"
msgstr ""
msgid "Enter a new name for this playlist"
msgstr ""
#, c-format
msgid "add %n songs"
msgstr "Přidej %n skladby"
@ -385,6 +394,9 @@ msgstr "Odeber %n skladeb"
msgid "move songs"
msgstr "Přesuň skladby"
msgid "Playlist search"
msgstr ""
msgid "Don't repeat"
msgstr "Neopakovat"
@ -995,6 +1007,15 @@ msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "New playlist"
msgstr ""
msgid "Save playlist..."
msgstr ""
msgid "Load playlist..."
msgstr ""
msgid "Library"
msgstr "Knihovna"

View File

@ -376,6 +376,15 @@ msgstr "Vis sektion"
msgid "Hide %1"
msgstr "Skjul %1"
msgid "Rename playlist"
msgstr ""
msgid "Remove playlist"
msgstr ""
msgid "Enter a new name for this playlist"
msgstr ""
#, c-format
msgid "add %n songs"
msgstr "tilføj %n sange"
@ -387,6 +396,9 @@ msgstr "fjern %n sange"
msgid "move songs"
msgstr "flyt sange"
msgid "Playlist search"
msgstr ""
msgid "Don't repeat"
msgstr "Gentag ikke"
@ -998,6 +1010,15 @@ msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "New playlist"
msgstr ""
msgid "Save playlist..."
msgstr ""
msgid "Load playlist..."
msgstr ""
msgid "Library"
msgstr "Bibliotek"

View File

@ -373,6 +373,15 @@ msgstr "Spalten"
msgid "Hide %1"
msgstr "%1 ausblenden"
msgid "Rename playlist"
msgstr ""
msgid "Remove playlist"
msgstr ""
msgid "Enter a new name for this playlist"
msgstr ""
#, c-format
msgid "add %n songs"
msgstr "%n Stücke hinzufügen"
@ -384,6 +393,9 @@ msgstr "%n Stücke entfernen"
msgid "move songs"
msgstr "Stücke verschieben"
msgid "Playlist search"
msgstr ""
msgid "Don't repeat"
msgstr "Nicht wiederholen"
@ -994,6 +1006,15 @@ msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "New playlist"
msgstr ""
msgid "Save playlist..."
msgstr ""
msgid "Load playlist..."
msgstr ""
msgid "Library"
msgstr "Musiksammlung"

View File

@ -376,6 +376,15 @@ msgstr "Εμφάνισε το τμήμα"
msgid "Hide %1"
msgstr "Απόκρυψη %1"
msgid "Rename playlist"
msgstr ""
msgid "Remove playlist"
msgstr ""
msgid "Enter a new name for this playlist"
msgstr ""
#, c-format
msgid "add %n songs"
msgstr "προσθήκη %n τραγουδιών"
@ -387,6 +396,9 @@ msgstr "αφαίρεση %n τραγουδιών"
msgid "move songs"
msgstr "μετακίνηση τραγουδιών"
msgid "Playlist search"
msgstr ""
msgid "Don't repeat"
msgstr "Χωρίς επανάληψη"
@ -997,6 +1009,15 @@ msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "New playlist"
msgstr ""
msgid "Save playlist..."
msgstr ""
msgid "Load playlist..."
msgstr ""
msgid "Library"
msgstr "Βιβλιοθήκη"

View File

@ -373,6 +373,15 @@ msgstr "Show section"
msgid "Hide %1"
msgstr "Hide %1"
msgid "Rename playlist"
msgstr ""
msgid "Remove playlist"
msgstr ""
msgid "Enter a new name for this playlist"
msgstr ""
#, c-format
msgid "add %n songs"
msgstr ""
@ -384,6 +393,9 @@ msgstr ""
msgid "move songs"
msgstr ""
msgid "Playlist search"
msgstr ""
msgid "Don't repeat"
msgstr "Don't repeat"
@ -993,6 +1005,15 @@ msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "New playlist"
msgstr ""
msgid "Save playlist..."
msgstr ""
msgid "Load playlist..."
msgstr ""
msgid "Library"
msgstr "Library"

View File

@ -378,6 +378,15 @@ msgstr "Mostrar columna"
msgid "Hide %1"
msgstr "Ocultar %1"
msgid "Rename playlist"
msgstr ""
msgid "Remove playlist"
msgstr ""
msgid "Enter a new name for this playlist"
msgstr ""
#, c-format
msgid "add %n songs"
msgstr "agregar %n pistas"
@ -389,6 +398,9 @@ msgstr "remover %n pistas"
msgid "move songs"
msgstr "mover pistas"
msgid "Playlist search"
msgstr ""
msgid "Don't repeat"
msgstr "No repetir"
@ -1000,6 +1012,15 @@ msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "New playlist"
msgstr ""
msgid "Save playlist..."
msgstr ""
msgid "Load playlist..."
msgstr ""
msgid "Library"
msgstr "Colección"

View File

@ -373,6 +373,15 @@ msgstr ""
msgid "Hide %1"
msgstr "Piilota %1"
msgid "Rename playlist"
msgstr ""
msgid "Remove playlist"
msgstr ""
msgid "Enter a new name for this playlist"
msgstr ""
#, c-format
msgid "add %n songs"
msgstr ""
@ -384,6 +393,9 @@ msgstr ""
msgid "move songs"
msgstr ""
msgid "Playlist search"
msgstr ""
msgid "Don't repeat"
msgstr ""
@ -989,6 +1001,15 @@ msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "New playlist"
msgstr ""
msgid "Save playlist..."
msgstr ""
msgid "Load playlist..."
msgstr ""
msgid "Library"
msgstr ""

View File

@ -378,6 +378,15 @@ msgstr "Montrer la colonne"
msgid "Hide %1"
msgstr "Masquer %1"
msgid "Rename playlist"
msgstr ""
msgid "Remove playlist"
msgstr ""
msgid "Enter a new name for this playlist"
msgstr ""
#, c-format
msgid "add %n songs"
msgstr ""
@ -389,6 +398,9 @@ msgstr ""
msgid "move songs"
msgstr ""
msgid "Playlist search"
msgstr ""
msgid "Don't repeat"
msgstr "Ne pas répéter"
@ -1001,6 +1013,15 @@ msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "New playlist"
msgstr ""
msgid "Save playlist..."
msgstr ""
msgid "Load playlist..."
msgstr ""
msgid "Library"
msgstr "Bibliothèque"

View File

@ -373,6 +373,15 @@ msgstr "Mostrar a seczón"
msgid "Hide %1"
msgstr "Esconder %1"
msgid "Rename playlist"
msgstr ""
msgid "Remove playlist"
msgstr ""
msgid "Enter a new name for this playlist"
msgstr ""
#, c-format
msgid "add %n songs"
msgstr ""
@ -384,6 +393,9 @@ msgstr ""
msgid "move songs"
msgstr ""
msgid "Playlist search"
msgstr ""
msgid "Don't repeat"
msgstr ""
@ -991,6 +1003,15 @@ msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "New playlist"
msgstr ""
msgid "Save playlist..."
msgstr ""
msgid "Load playlist..."
msgstr ""
msgid "Library"
msgstr ""

View File

@ -376,6 +376,15 @@ msgstr "Mostra sezione"
msgid "Hide %1"
msgstr "Nascondi %1"
msgid "Rename playlist"
msgstr ""
msgid "Remove playlist"
msgstr ""
msgid "Enter a new name for this playlist"
msgstr ""
#, c-format
msgid "add %n songs"
msgstr "aggiungi %n brani"
@ -387,6 +396,9 @@ msgstr "rimuovi %n brani"
msgid "move songs"
msgstr "sposta brani"
msgid "Playlist search"
msgstr ""
msgid "Don't repeat"
msgstr "Non ripetere"
@ -998,6 +1010,15 @@ msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "New playlist"
msgstr ""
msgid "Save playlist..."
msgstr ""
msgid "Load playlist..."
msgstr ""
msgid "Library"
msgstr "Raccolta"

View File

@ -373,6 +373,15 @@ msgstr ""
msgid "Hide %1"
msgstr "%1 жасыру"
msgid "Rename playlist"
msgstr ""
msgid "Remove playlist"
msgstr ""
msgid "Enter a new name for this playlist"
msgstr ""
#, c-format
msgid "add %n songs"
msgstr ""
@ -384,6 +393,9 @@ msgstr ""
msgid "move songs"
msgstr ""
msgid "Playlist search"
msgstr ""
msgid "Don't repeat"
msgstr ""
@ -991,6 +1003,15 @@ msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "New playlist"
msgstr ""
msgid "Save playlist..."
msgstr ""
msgid "Load playlist..."
msgstr ""
msgid "Library"
msgstr ""

View File

@ -374,6 +374,15 @@ msgstr "Vis del"
msgid "Hide %1"
msgstr "Skjul %1"
msgid "Rename playlist"
msgstr ""
msgid "Remove playlist"
msgstr ""
msgid "Enter a new name for this playlist"
msgstr ""
#, c-format
msgid "add %n songs"
msgstr ""
@ -385,6 +394,9 @@ msgstr ""
msgid "move songs"
msgstr ""
msgid "Playlist search"
msgstr ""
msgid "Don't repeat"
msgstr "Ikke repetér"
@ -995,6 +1007,15 @@ msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "New playlist"
msgstr ""
msgid "Save playlist..."
msgstr ""
msgid "Load playlist..."
msgstr ""
msgid "Library"
msgstr "Bibliotek"

View File

@ -374,6 +374,15 @@ msgstr "Pokaż sekcję"
msgid "Hide %1"
msgstr "Ukryj %1"
msgid "Rename playlist"
msgstr ""
msgid "Remove playlist"
msgstr ""
msgid "Enter a new name for this playlist"
msgstr ""
#, c-format
msgid "add %n songs"
msgstr ""
@ -385,6 +394,9 @@ msgstr ""
msgid "move songs"
msgstr ""
msgid "Playlist search"
msgstr ""
msgid "Don't repeat"
msgstr "Nie powtarzaj"
@ -993,6 +1005,15 @@ msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "New playlist"
msgstr ""
msgid "Save playlist..."
msgstr ""
msgid "Load playlist..."
msgstr ""
msgid "Library"
msgstr "Biblioteka"

View File

@ -373,6 +373,15 @@ msgstr "Mostrar a secção"
msgid "Hide %1"
msgstr "Esconder %1"
msgid "Rename playlist"
msgstr ""
msgid "Remove playlist"
msgstr ""
msgid "Enter a new name for this playlist"
msgstr ""
#, c-format
msgid "add %n songs"
msgstr "adicionar %n canções"
@ -384,6 +393,9 @@ msgstr "remover %n canções"
msgid "move songs"
msgstr "mover canções"
msgid "Playlist search"
msgstr ""
msgid "Don't repeat"
msgstr "Não repetir"
@ -996,6 +1008,15 @@ msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "New playlist"
msgstr ""
msgid "Save playlist..."
msgstr ""
msgid "Load playlist..."
msgstr ""
msgid "Library"
msgstr "Biblioteca"

View File

@ -373,6 +373,15 @@ msgstr ""
msgid "Hide %1"
msgstr ""
msgid "Rename playlist"
msgstr ""
msgid "Remove playlist"
msgstr ""
msgid "Enter a new name for this playlist"
msgstr ""
#, c-format
msgid "add %n songs"
msgstr ""
@ -384,6 +393,9 @@ msgstr ""
msgid "move songs"
msgstr ""
msgid "Playlist search"
msgstr ""
msgid "Don't repeat"
msgstr ""
@ -989,6 +1001,15 @@ msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "New playlist"
msgstr ""
msgid "Save playlist..."
msgstr ""
msgid "Load playlist..."
msgstr ""
msgid "Library"
msgstr ""

View File

@ -373,6 +373,15 @@ msgstr "Arată secțiune"
msgid "Hide %1"
msgstr "Ascunde %1"
msgid "Rename playlist"
msgstr ""
msgid "Remove playlist"
msgstr ""
msgid "Enter a new name for this playlist"
msgstr ""
#, c-format
msgid "add %n songs"
msgstr ""
@ -384,6 +393,9 @@ msgstr ""
msgid "move songs"
msgstr ""
msgid "Playlist search"
msgstr ""
msgid "Don't repeat"
msgstr "Nu repeta"
@ -990,6 +1002,15 @@ msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "New playlist"
msgstr ""
msgid "Save playlist..."
msgstr ""
msgid "Load playlist..."
msgstr ""
msgid "Library"
msgstr "Bibliotecă"

View File

@ -373,6 +373,15 @@ msgstr "Показать секцию"
msgid "Hide %1"
msgstr "Скрыть %1"
msgid "Rename playlist"
msgstr ""
msgid "Remove playlist"
msgstr ""
msgid "Enter a new name for this playlist"
msgstr ""
#, c-format
msgid "add %n songs"
msgstr "добавить %n композиций"
@ -384,6 +393,9 @@ msgstr "удалить %n композиций"
msgid "move songs"
msgstr "переместить композиции"
msgid "Playlist search"
msgstr ""
msgid "Don't repeat"
msgstr "Не повторять"
@ -993,6 +1005,15 @@ msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "New playlist"
msgstr ""
msgid "Save playlist..."
msgstr ""
msgid "Load playlist..."
msgstr ""
msgid "Library"
msgstr "Коллекция"

View File

@ -374,6 +374,15 @@ msgstr "Zobraziť stĺpec"
msgid "Hide %1"
msgstr "Skryť %1"
msgid "Rename playlist"
msgstr ""
msgid "Remove playlist"
msgstr ""
msgid "Enter a new name for this playlist"
msgstr ""
#, c-format
msgid "add %n songs"
msgstr "pridať %n piesní"
@ -385,6 +394,9 @@ msgstr "odstrániť %n piesní"
msgid "move songs"
msgstr "presunúť piesne"
msgid "Playlist search"
msgstr ""
msgid "Don't repeat"
msgstr "Neopakovať"
@ -995,6 +1007,15 @@ msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "New playlist"
msgstr ""
msgid "Save playlist..."
msgstr ""
msgid "Load playlist..."
msgstr ""
msgid "Library"
msgstr "Zbierka"

View File

@ -375,6 +375,15 @@ msgstr "Visa kolumn"
msgid "Hide %1"
msgstr "Dölj %1"
msgid "Rename playlist"
msgstr ""
msgid "Remove playlist"
msgstr ""
msgid "Enter a new name for this playlist"
msgstr ""
#, c-format
msgid "add %n songs"
msgstr "Lägg till %n songer"
@ -386,6 +395,9 @@ msgstr "Ta bort %n songer"
msgid "move songs"
msgstr "Flytta songer"
msgid "Playlist search"
msgstr ""
msgid "Don't repeat"
msgstr "Upprepa inte"
@ -996,6 +1008,15 @@ msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "New playlist"
msgstr ""
msgid "Save playlist..."
msgstr ""
msgid "Load playlist..."
msgstr ""
msgid "Library"
msgstr "Bibliotek"

View File

@ -373,6 +373,15 @@ msgstr ""
msgid "Hide %1"
msgstr "Gizle %1"
msgid "Rename playlist"
msgstr ""
msgid "Remove playlist"
msgstr ""
msgid "Enter a new name for this playlist"
msgstr ""
#, c-format
msgid "add %n songs"
msgstr ""
@ -384,6 +393,9 @@ msgstr ""
msgid "move songs"
msgstr ""
msgid "Playlist search"
msgstr ""
msgid "Don't repeat"
msgstr ""
@ -989,6 +1001,15 @@ msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "New playlist"
msgstr ""
msgid "Save playlist..."
msgstr ""
msgid "Load playlist..."
msgstr ""
msgid "Library"
msgstr ""

View File

@ -364,6 +364,15 @@ msgstr ""
msgid "Hide %1"
msgstr ""
msgid "Rename playlist"
msgstr ""
msgid "Remove playlist"
msgstr ""
msgid "Enter a new name for this playlist"
msgstr ""
#, c-format
msgid "add %n songs"
msgstr ""
@ -375,6 +384,9 @@ msgstr ""
msgid "move songs"
msgstr ""
msgid "Playlist search"
msgstr ""
msgid "Don't repeat"
msgstr ""
@ -980,6 +992,15 @@ msgstr ""
msgid "Ctrl+J"
msgstr ""
msgid "New playlist"
msgstr ""
msgid "Save playlist..."
msgstr ""
msgid "Load playlist..."
msgstr ""
msgid "Library"
msgstr ""

View File

@ -34,6 +34,7 @@
#include "playlist/playlistbackend.h"
#include "playlist/playlist.h"
#include "playlist/playlistsequence.h"
#include "playlist/playlistview.h"
#include "playlist/songplaylistitem.h"
#include "radio/lastfmservice.h"
#include "radio/radiomodel.h"
@ -142,8 +143,8 @@ MainWindow::MainWindow(NetworkAccessManager* network, Engine::Type engine, QWidg
library_sort_model_->sort(0);
playlist_->IgnoreSorting(true);
ui_->playlist->setModel(playlist_);
ui_->playlist->SetItemDelegates(library_->model()->backend());
ui_->playlist->view()->setModel(playlist_);
ui_->playlist->view()->SetItemDelegates(library_->model()->backend());
playlist_->IgnoreSorting(false);
ui_->library_view->setModel(library_sort_model_);
@ -177,6 +178,9 @@ MainWindow::MainWindow(NetworkAccessManager* network, Engine::Type engine, QWidg
ui_->action_shuffle_mode->setIcon(IconLoader::Load("media-playlist-shuffle"));
ui_->action_stop->setIcon(IconLoader::Load("media-playback-stop"));
ui_->action_stop_after_this_track->setIcon(IconLoader::Load("media-playback-stop"));
ui_->action_new_playlist->setIcon(IconLoader::Load("document-new"));
ui_->action_load_playlist->setIcon(IconLoader::Load("document-open"));
ui_->action_save_playlist->setIcon(IconLoader::Load("document-save"));
// File view connections
connect(ui_->file_view, SIGNAL(AddToPlaylist(QList<QUrl>)), SLOT(AddFilesToPlaylist(QList<QUrl>)));
@ -210,7 +214,7 @@ MainWindow::MainWindow(NetworkAccessManager* network, Engine::Type engine, QWidg
connect(ui_->action_equalizer, SIGNAL(triggered()), equalizer_.get(), SLOT(show()));
connect(ui_->action_transcode, SIGNAL(triggered()), transcode_dialog_.get(), SLOT(show()));
connect(ui_->action_configure_global_shortcuts, SIGNAL(triggered()), global_shortcuts_dialog_.get(), SLOT(show()));
connect(ui_->action_jump, SIGNAL(triggered()), ui_->playlist, SLOT(JumpToCurrentlyPlayingTrack()));
connect(ui_->action_jump, SIGNAL(triggered()), ui_->playlist->view(), SLOT(JumpToCurrentlyPlayingTrack()));
// Give actions to buttons
ui_->forward_button->setDefaultAction(ui_->action_next_track);
@ -220,6 +224,8 @@ MainWindow::MainWindow(NetworkAccessManager* network, Engine::Type engine, QWidg
ui_->love_button->setDefaultAction(ui_->action_love);
ui_->ban_button->setDefaultAction(ui_->action_ban);
ui_->clear_playlist_button->setDefaultAction(ui_->action_clear_playlist);
ui_->playlist->SetActions(ui_->action_new_playlist, ui_->action_save_playlist,
ui_->action_load_playlist);
// Add the shuffle and repeat action groups to the menu
ui_->action_shuffle_mode->setMenu(playlist_sequence_->shuffle_menu());
@ -243,9 +249,9 @@ MainWindow::MainWindow(NetworkAccessManager* network, Engine::Type engine, QWidg
connect(player_, SIGNAL(Playing()), playlist_, SLOT(Playing()));
connect(player_, SIGNAL(Stopped()), playlist_, SLOT(Stopped()));
connect(player_, SIGNAL(Paused()), ui_->playlist, SLOT(StopGlowing()));
connect(player_, SIGNAL(Playing()), ui_->playlist, SLOT(StartGlowing()));
connect(player_, SIGNAL(Stopped()), ui_->playlist, SLOT(StopGlowing()));
connect(player_, SIGNAL(Paused()), ui_->playlist->view(), SLOT(StopGlowing()));
connect(player_, SIGNAL(Playing()), ui_->playlist->view(), SLOT(StartGlowing()));
connect(player_, SIGNAL(Stopped()), ui_->playlist->view(), SLOT(StopGlowing()));
connect(player_, SIGNAL(Paused()), osd_, SLOT(Paused()));
connect(player_, SIGNAL(Stopped()), osd_, SLOT(Stopped()));
@ -258,9 +264,9 @@ MainWindow::MainWindow(NetworkAccessManager* network, Engine::Type engine, QWidg
connect(playlist_, SIGNAL(PlaylistChanged()), player_, SLOT(PlaylistChanged()));
connect(playlist_, SIGNAL(EditingFinished(QModelIndex)), SLOT(PlaylistEditFinished(QModelIndex)));
connect(ui_->playlist, SIGNAL(doubleClicked(QModelIndex)), SLOT(PlayIndex(QModelIndex)));
connect(ui_->playlist, SIGNAL(PlayPauseItem(QModelIndex)), SLOT(PlayIndex(QModelIndex)));
connect(ui_->playlist, SIGNAL(RightClicked(QPoint,QModelIndex)), SLOT(PlaylistRightClick(QPoint,QModelIndex)));
connect(ui_->playlist->view(), SIGNAL(doubleClicked(QModelIndex)), SLOT(PlayIndex(QModelIndex)));
connect(ui_->playlist->view(), SIGNAL(PlayPauseItem(QModelIndex)), SLOT(PlayIndex(QModelIndex)));
connect(ui_->playlist->view(), SIGNAL(RightClicked(QPoint,QModelIndex)), SLOT(PlaylistRightClick(QPoint,QModelIndex)));
connect(track_slider_, SIGNAL(ValueChanged(int)), player_, SLOT(Seek(int)));
@ -750,7 +756,7 @@ void MainWindow::PlaylistRightClick(const QPoint& global_pos, const QModelIndex&
playlist_stop_after_->setEnabled(index.isValid());
// Are any of the selected songs editable?
QModelIndexList selection = ui_->playlist->selectionModel()->selection().indexes();
QModelIndexList selection = ui_->playlist->view()->selectionModel()->selection().indexes();
int editable = 0;
foreach (const QModelIndex& index, selection) {
if (index.column() != 0)
@ -809,7 +815,7 @@ void MainWindow::EditTracks() {
QList<int> rows;
foreach (const QModelIndex& index,
ui_->playlist->selectionModel()->selection().indexes()) {
ui_->playlist->view()->selectionModel()->selection().indexes()) {
if (index.column() != 0)
continue;
Song song = playlist_->item_at(index.row())->Metadata();
@ -830,7 +836,7 @@ void MainWindow::EditTracks() {
}
void MainWindow::RenumberTracks() {
QModelIndexList indexes=ui_->playlist->selectionModel()->selection().indexes();
QModelIndexList indexes=ui_->playlist->view()->selectionModel()->selection().indexes();
int track=1;
// Get the index list in order
@ -863,7 +869,7 @@ void MainWindow::SelectionSetValue() {
Playlist::Column column = (Playlist::Column)playlist_menu_index_.column();
QVariant column_value = playlist_->data(playlist_menu_index_);
QModelIndexList indexes=ui_->playlist->selectionModel()->selection().indexes();
QModelIndexList indexes=ui_->playlist->view()->selectionModel()->selection().indexes();
foreach (const QModelIndex& index, indexes) {
if (index.column() != 0)
continue;
@ -879,7 +885,7 @@ void MainWindow::SelectionSetValue() {
}
void MainWindow::EditValue() {
ui_->playlist->edit(playlist_menu_index_);
ui_->playlist->view()->edit(playlist_menu_index_);
}
void MainWindow::LibraryScanStarted() {
@ -962,7 +968,7 @@ void MainWindow::AddStreamAccepted() {
}
void MainWindow::PlaylistRemoveCurrent() {
ui_->playlist->RemoveSelected();
ui_->playlist->view()->RemoveSelected();
}

View File

@ -26,46 +26,12 @@
<number>0</number>
</property>
<item>
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
<item>
<widget class="PlaylistView" name="playlist">
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="editTriggers">
<set>QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked</set>
</property>
<property name="dragEnabled">
<bool>true</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::DragDrop</enum>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="uniformRowHeights">
<bool>true</bool>
</property>
<property name="itemsExpandable">
<bool>false</bool>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<property name="allColumnsShowFocus">
<bool>true</bool>
<widget class="PlaylistContainer" name="playlist" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
@ -405,6 +371,10 @@
<addaction name="action_shuffle_mode"/>
<addaction name="action_repeat_mode"/>
<addaction name="separator"/>
<addaction name="action_new_playlist"/>
<addaction name="action_save_playlist"/>
<addaction name="action_load_playlist"/>
<addaction name="separator"/>
<addaction name="action_jump"/>
<addaction name="action_clear_playlist"/>
<addaction name="action_shuffle"/>
@ -605,6 +575,21 @@
<string>Ctrl+J</string>
</property>
</action>
<action name="action_new_playlist">
<property name="text">
<string>New playlist</string>
</property>
</action>
<action name="action_save_playlist">
<property name="text">
<string>Save playlist...</string>
</property>
</action>
<action name="action_load_playlist">
<property name="text">
<string>Load playlist...</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
@ -613,11 +598,6 @@
<extends>QSlider</extends>
<header>widgets/sliderwidget.h</header>
</customwidget>
<customwidget>
<class>PlaylistView</class>
<extends>QTreeView</extends>
<header>playlist/playlistview.h</header>
</customwidget>
<customwidget>
<class>LibraryView</class>
<extends>QTreeView</extends>
@ -647,6 +627,12 @@
<header>radio/radioviewcontainer.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>PlaylistContainer</class>
<extends>QWidget</extends>
<header>playlist/playlistcontainer.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../../data/data.qrc"/>