Commit b135e38d authored by Scott Wheeler's avatar Scott Wheeler

Prompt the user on whether they want to load files into the collection

list or into the current list when they do "Open" from a playlist other
than the collection.

svn path=/trunk/kdemultimedia/juk/; revision=206817
parent e67658a3
......@@ -19,6 +19,7 @@
#include <kiconloader.h>
#include <kapplication.h>
#include <kstandarddirs.h>
#include <kmessagebox.h>
#include <kdebug.h>
#include <qinputdialog.h>
......@@ -241,6 +242,26 @@ QString PlaylistSplitter::extensionsString(const QStringList &extensions, const
return s;
}
void PlaylistSplitter::open(const QString &file)
{
if(visiblePlaylist() == collection ||
KMessageBox::questionYesNo(this, i18n("Do you want to add this item to the current list or to the collection list?"),
QString::null, KGuiItem(i18n("Current")), KGuiItem(i18n("Collection"))) == KMessageBox::No)
add(file, collection);
else
add(file, visiblePlaylist());
}
void PlaylistSplitter::open(const QStringList &files)
{
if(visiblePlaylist() == collection ||
KMessageBox::questionYesNo(this, i18n("Do you want to add these items to the current list or to the collection list?"),
QString::null, KGuiItem(i18n("Current")), KGuiItem(i18n("Collection"))) == KMessageBox::No)
add(files, collection);
else
add(files, visiblePlaylist());
}
////////////////////////////////////////////////////////////////////////////////
// public slots
////////////////////////////////////////////////////////////////////////////////
......
......@@ -136,12 +136,12 @@ public:
* Open each of \a files, where \a files is a list of playlists and music
* files.
*/
void open(const QStringList &files) { add(files, visiblePlaylist()); }
void open(const QStringList &files);
/**
* Open \a file where \a is a playlist or music file.
*/
void open(const QString &file) { add(file, visiblePlaylist()); }
void open(const QString &file);
// static methods
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment