Skip to content

Commit

Permalink
Add Stop command to Control menu
Browse files Browse the repository at this point in the history
This adds a menu item to fully stop playback, which is currently only
available through the CLI, and some other integrations like MPRIS.
  • Loading branch information
toupeira committed Nov 29, 2022
1 parent 56c5484 commit 9679bde
Showing 1 changed file with 9 additions and 0 deletions.
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)

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

0 comments on commit 9679bde

Please sign in to comment.