Commit 286f74ae authored by Scott Wheeler's avatar Scott Wheeler

A number of modifications to the new "upcoming playlist" stuff.

*) First, I think that the name "Play Queue" is better.  I'm still not crazy
   about that, but for a user visible string I like it more than "Upcoming Playlist".

*) Switched the icon to use the "today" icon for now.

*) I don't see any reason to disallow removing files in the upcoming playlist;
   that seems like an unnecessary special case.

*) Don't raise the upcoming playlist when it's shown.  That wasn't concistant with
   the other "special" playlists.

*) Get rid of the "upcoming item" thing in the Playlist RMB menu and just have it
   automatically show / enqueue things into the upcoming playlist; one queueing
   system is enough, thank you.  ;-)

There are a handful of other things that need to happen here, but I presume that
those will come from Michael and I over the next little while.

svn path=/trunk/kdemultimedia/juk/; revision=339083
parent 9a5ac9f3
......@@ -151,7 +151,7 @@ void JuK::setupActions()
new KToggleAction(i18n("Popup &Track Announcement"),
KShortcut(), this, 0, actions(), "togglePopups");
new KToggleAction(i18n("Save &Upcoming Tracks"),
new KToggleAction(i18n("Save &Play Queue"),
KShortcut(), this, 0, actions(), "saveUpcomingTracks");
connect(m_toggleSystemTrayAction, SIGNAL(toggled(bool)),
......@@ -610,12 +610,6 @@ void Playlist::markItemSelected(PlaylistItem *item, bool selected)
// public slots
void Playlist::slotSetNext()
QListViewItemIterator it(this, QListViewItemIterator::Selected);
TrackSequenceManager::instance()->setNextItem(static_cast<PlaylistItem *>(it.current()));
void Playlist::copy()
kapp->clipboard()->setData(dragObject(0), QClipboard::Clipboard);
......@@ -1527,9 +1521,7 @@ void Playlist::slotUpdateColumnWidths()
void Playlist::slotAddToUpcoming()
......@@ -1547,10 +1539,8 @@ void Playlist::slotShowRMBMenu(QListViewItem *item, const QPoint &point, int col
m_rmbMenu = new KPopupMenu(this);
m_rmbMenu->insertItem(SmallIconSet("player_play"), i18n("Play Next"),
this, SLOT(slotSetNext()));
m_rmbUpcomingID = m_rmbMenu->insertItem(SmallIcon("upcoming_playlist"),
i18n("Add to upcoming tracks"), this, SLOT(slotAddToUpcoming()));
m_rmbUpcomingID = m_rmbMenu->insertItem(SmallIcon("today"),
i18n("Add to Play Queue"), this, SLOT(slotAddToUpcoming()));
if(!readOnly()) {
......@@ -1601,12 +1591,6 @@ void Playlist::slotShowRMBMenu(QListViewItem *item, const QPoint &point, int col
i18n("Edit '%1'").arg(columnText(column)));
m_rmbMenu->setItemVisible(m_rmbEditID, showEdit);
m_rmbMenu->setItemVisible(m_rmbUpcomingID, m_upcomingPlaylist != 0);
if(this == m_upcomingPlaylist)
// Disable edit menu if only one file is selected, and it's read-only
......@@ -299,11 +299,6 @@ public slots:
void slotRemoveSelectedItems() { removeFromDisk(selectedItems()); };
* Set the first selected item to be the next item returned by nextItem().
void slotSetNext();
* The edit slots are required to use the canonical names so that they are
* detected by the application wide framework.
......@@ -575,7 +570,7 @@ private:
bool m_widthsDirty;
PlaylistItemList m_randomList;
// PlaylistItemList m_history;
// PlaylistItemList m_history;
static PlaylistItemList m_history;
PlaylistSearch m_search;
// PlaylistSearch m_albumSearch;
......@@ -127,10 +127,11 @@ PlaylistBox::PlaylistBox(QWidget *parent, QWidgetStack *playlistStack,
// We need to wait until after Collection List is created to set this up.
setSorting(-1); // Disable sorting for speed
......@@ -139,8 +140,6 @@ PlaylistBox::PlaylistBox(QWidget *parent, QWidgetStack *playlistStack,
connect(CollectionList::instance(), SIGNAL(signalNewTag(const QString &, unsigned)),
this, SLOT(slotAddItem(const QString &, unsigned)));
connect(CollectionList::instance(), SIGNAL(signalRemovedTag(const QString &, unsigned)),
......@@ -222,7 +221,7 @@ Playlist *PlaylistBox::currentPlaylist() const
void PlaylistBox::setupPlaylist(Playlist *playlist, const QString &iconName)
PlaylistCollection::setupPlaylist(playlist, iconName);
if(iconName == "upcoming_playlist") {
if(iconName == "today") {
kdDebug(65432) << "Setting up upcoming playlist after Collection List\n";
new Item(this, iconName, playlist->name(), playlist, m_playlistDict[CollectionList::instance()]);
......@@ -441,8 +441,7 @@ void PlaylistCollection::setUpcomingPlaylistEnabled(bool enable)
setupPlaylist(m_upcomingPlaylist, "upcoming_playlist");
setupPlaylist(m_upcomingPlaylist, "today");
else {
......@@ -673,8 +672,8 @@ PlaylistCollection::ActionHandler::ActionHandler(PlaylistCollection *collection)
historyAction->setCheckedState(i18n("Hide &History"));
KToggleAction *upcomingAction =
new KToggleAction(i18n("Show &Upcoming Playlist"), "upcoming_playlist", 0, actions(), "showUpcoming");
upcomingAction->setCheckedState(i18n("Hide &Upcoming Playlist"));
new KToggleAction(i18n("Show &Play Queue"), "today", 0, actions(), "showUpcoming");
upcomingAction->setCheckedState(i18n("Hide &Play Queue"));
connect(action<KToggleAction>("showHistory"), SIGNAL(toggled(bool)),
this, SLOT(slotSetHistoryPlaylistEnabled(bool)));
......@@ -26,12 +26,12 @@
using namespace ActionCollection;
UpcomingPlaylist::UpcomingPlaylist(PlaylistCollection *collection, int defaultSize, const QString &name) :
UpcomingPlaylist::UpcomingPlaylist(PlaylistCollection *collection, int defaultSize) :
Playlist(collection, true),
setName(i18n("Play Queue"));
......@@ -52,12 +52,8 @@ public:
* @see initialize
* @param collection The PlaylistCollection that owns this playlist.
* @param defaultSize The default number of tracks to place in the playlist.
* @param name The playlist name.
UpcomingPlaylist(PlaylistCollection *collection,
int defaultSize = 15,
const QString &name = i18n("Upcoming Tracks"));
UpcomingPlaylist(PlaylistCollection *collection, int defaultSize = 15);
* Destructor for the UpcomingPlaylist. This destructor will restore the
* iterator for the TrackSequenceManager, and if a song is playing when
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