Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Stop command to Control menu #4213

Merged
merged 1 commit into from Apr 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions quodlibet/qltk/quodlibetwindow.py
Expand Up @@ -424,6 +424,7 @@ def __init__(self, parent):
<menuitem action='Previous' always-show-image='true'/>
<menuitem action='PlayPause' always-show-image='true'/>
<menuitem action='Next' always-show-image='true'/>
<menuitem action='Stop' always-show-image='true'/>
<menuitem action='StopAfter' always-show-image='true'/>
</menu>

Expand Down Expand Up @@ -957,6 +958,11 @@ def add_top_level_items(ag):
act.connect('activate', self.__next_song)
ag.add_action_with_accel(act, "<Primary>period")

act = Action(name="Stop", label=_("Stop"),
icon_name=Icons.MEDIA_PLAYBACK_STOP)
act.connect('activate', self.__stop)
ag.add_action(act)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Should we add a keyboard shortcut?

Some suggestions: Ctrl+Shift+Space, Ctrl+Escape

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe yes. Not Ctrl+Escape I'd say, that's too weird and might do things in some WMs


act = ToggleAction(name="StopAfter", label=_("Stop After This Song"))
ag.add_action_with_accel(act, "<shift>space")

Expand Down Expand Up @@ -1212,6 +1218,9 @@ def __song_started(self, player, song):
def __play_pause(self, *args):
app.player.playpause()

def __stop(self, *args):
app.player.stop()

def __jump_to_current(self, explicit, songlist=None, force_scroll=False):
"""Select/scroll to the current playing song in the playlist.
If it can't be found tell the browser to properly fill the playlist
Expand Down