Commit ced3ffb6 authored by Michael Pyne's avatar Michael Pyne
Browse files

Reenable album random play in the user interface.

parent b1097f4e
...@@ -253,29 +253,29 @@ void JuK::setupActions() ...@@ -253,29 +253,29 @@ void JuK::setupActions()
// Setup the menu which handles the random play options. // Setup the menu which handles the random play options.
KActionMenu *actionMenu = collection->add<KActionMenu>("actionMenu"); KActionMenu *actionMenu = collection->add<KActionMenu>("actionMenu");
actionMenu->setText(i18n("&Random Play")); actionMenu->setText(i18n("&Random Play"));
actionMenu->setIcon(QIcon::fromTheme( QLatin1String( "media-playlist-shuffle" ))); actionMenu->setIcon(QIcon::fromTheme(QLatin1String("media-playlist-shuffle")));
actionMenu->setPopupMode(QToolButton::InstantPopup); actionMenu->setPopupMode(QToolButton::InstantPopup);
QActionGroup* randomPlayGroup = new QActionGroup(this); QActionGroup* randomPlayGroup = new QActionGroup(this);
QAction *act = collection->add<KToggleAction>("disableRandomPlay"); QAction *act = collection->add<KToggleAction>("disableRandomPlay");
act->setText(i18n("&Disable Random Play")); act->setText(i18n("&Disable Random Play"));
act->setIcon(QIcon::fromTheme( QLatin1String( "go-down" ))); act->setIcon(QIcon::fromTheme(QLatin1String("go-down")));
act->setActionGroup(randomPlayGroup); act->setActionGroup(randomPlayGroup);
actionMenu->addAction(act); actionMenu->addAction(act);
m_randomPlayAction = collection->add<KToggleAction>("randomPlay"); m_randomPlayAction = collection->add<KToggleAction>("randomPlay");
m_randomPlayAction->setText(i18n("Use &Random Play")); m_randomPlayAction->setText(i18n("Use &Random Play"));
m_randomPlayAction->setIcon(QIcon::fromTheme( QLatin1String( "media-playlist-shuffle" ))); m_randomPlayAction->setIcon(QIcon::fromTheme(QLatin1String("media-playlist-shuffle")));
m_randomPlayAction->setActionGroup(randomPlayGroup); m_randomPlayAction->setActionGroup(randomPlayGroup);
actionMenu->addAction(m_randomPlayAction); actionMenu->addAction(m_randomPlayAction);
act = collection->add<KToggleAction>("albumRandomPlay"); act = collection->add<KToggleAction>("albumRandomPlay");
act->setEnabled(false);
act->setText(i18n("Use &Album Random Play")); act->setText(i18n("Use &Album Random Play"));
act->setIcon(QIcon::fromTheme( QLatin1String( "media-playlist-shuffle" ))); act->setIcon(QIcon::fromTheme(QLatin1String("media-playlist-shuffle")));
act->setActionGroup(randomPlayGroup); act->setActionGroup(randomPlayGroup);
connect(act, SIGNAL(triggered(bool)), SLOT(slotCheckAlbumNextAction(bool))); connect(act, &QAction::toggled,
this, &JuK::slotCheckAlbumNextAction);
actionMenu->addAction(act); actionMenu->addAction(act);
act = collection->addAction("removeFromPlaylist", clear, SLOT(clear())); act = collection->addAction("removeFromPlaylist", clear, SLOT(clear()));
...@@ -654,13 +654,7 @@ void JuK::slotUndo() ...@@ -654,13 +654,7 @@ void JuK::slotUndo()
void JuK::slotCheckAlbumNextAction(bool albumRandomEnabled) void JuK::slotCheckAlbumNextAction(bool albumRandomEnabled)
{ {
// If album random play is enabled, then enable the Play Next Album action action("forwardAlbum")->setEnabled(m_player->playing() && albumRandomEnabled);
// unless we're not playing right now.
if(albumRandomEnabled && !m_player->playing())
albumRandomEnabled = false;
action("forwardAlbum")->setEnabled(albumRandomEnabled);
} }
// vim: set et sw=4 tw=0 sta: // vim: set et sw=4 tw=0 sta:
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