Enable loading playlists from filesystem

This commit is contained in:
Thomas Frauendorfer 2008-02-17 17:49:16 +01:00
parent 6af763a954
commit 5b5600aadd
5 changed files with 53 additions and 3 deletions

View file

@ -39,6 +39,7 @@
#include <QSettings>
#include <QFileDialog>
#include <QPainter>
#include <QUrl>
/*
*
@ -291,6 +292,7 @@ PlaylistWidget::addButtons (void)
Skin::PLS_LST_SAV_1);
b = new PlaylistMenuButton (m_lst, Skin::PLS_LST_OPN_0,
Skin::PLS_LST_OPN_1);
connect (b, SIGNAL (activated ()), this, SLOT (menuAddPls ()));
}
void
@ -360,6 +362,22 @@ PlaylistWidget::menuAddFile ()
}
void
PlaylistWidget::menuAddPls ()
{
QStringList files;
FileDialog fd (this, "add_Playlist");
files = fd.getFiles ();
if (files.count () > 0) {
XMMSHandler::getInstance ().xcollection ()->playlistClear ();
}
QString file = files[0];
XMMSHandler::getInstance ().xcollection ()->addPlsFile (QUrl (file));
}
void
PlaylistWidget::resizeEvent (QResizeEvent *event)
{

View file

@ -85,6 +85,7 @@ class PlaylistWidget : public QWidget {
void menuAddUrl ();
void menuAddDir ();
void menuAddFile ();
void menuAddPls ();
protected slots:
void openPlaylistChooser ();