Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
JuK
Commits
04b631c3
Commit
04b631c3
authored
Mar 22, 2021
by
Michael Pyne
Browse files
Reenable album random play in the user interface.
(cherry picked from commit
ced3ffb6
)
parent
e8e5ef92
Changes
1
Hide whitespace changes
Inline
Side-by-side
juk.cpp
View file @
04b631c3
...
...
@@ -259,29 +259,29 @@ void JuK::setupActions()
// Setup the menu which handles the random play options.
KActionMenu
*
actionMenu
=
collection
->
add
<
KActionMenu
>
(
"actionMenu"
);
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
);
QActionGroup
*
randomPlayGroup
=
new
QActionGroup
(
this
);
QAction
*
act
=
collection
->
add
<
KToggleAction
>
(
"disableRandomPlay"
);
act
->
setText
(
i18n
(
"&Disable Random Play"
));
act
->
setIcon
(
QIcon
::
fromTheme
(
QLatin1String
(
"go-down"
)));
act
->
setIcon
(
QIcon
::
fromTheme
(
QLatin1String
(
"go-down"
)));
act
->
setActionGroup
(
randomPlayGroup
);
actionMenu
->
addAction
(
act
);
m_randomPlayAction
=
collection
->
add
<
KToggleAction
>
(
"randomPlay"
);
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
);
actionMenu
->
addAction
(
m_randomPlayAction
);
act
=
collection
->
add
<
KToggleAction
>
(
"albumRandomPlay"
);
act
->
setEnabled
(
false
);
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
);
connect
(
act
,
SIGNAL
(
triggered
(
bool
)),
SLOT
(
slotCheckAlbumNextAction
(
bool
)));
connect
(
act
,
&
QAction
::
toggled
,
this
,
&
JuK
::
slotCheckAlbumNextAction
);
actionMenu
->
addAction
(
act
);
act
=
collection
->
addAction
(
"removeFromPlaylist"
,
clear
,
SLOT
(
clear
()));
...
...
@@ -660,13 +660,7 @@ void JuK::slotUndo()
void
JuK
::
slotCheckAlbumNextAction
(
bool
albumRandomEnabled
)
{
// If album random play is enabled, then enable the Play Next Album action
// unless we're not playing right now.
if
(
albumRandomEnabled
&&
!
m_player
->
playing
())
albumRandomEnabled
=
false
;
action
(
"forwardAlbum"
)
->
setEnabled
(
albumRandomEnabled
);
action
(
"forwardAlbum"
)
->
setEnabled
(
m_player
->
playing
()
&&
albumRandomEnabled
);
}
// vim: set et sw=4 tw=0 sta:
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment