Hide load play queue button if adapter doesn't support it
Related to #150
This commit is contained in:
@@ -192,11 +192,11 @@ class PlayerControls(Gtk.ActionBar):
|
|||||||
self.album_name.set_markup("")
|
self.album_name.set_markup("")
|
||||||
self.artist_name.set_markup("")
|
self.artist_name.set_markup("")
|
||||||
|
|
||||||
|
self.load_play_queue_button.set_sensitive(not self.offline_mode)
|
||||||
|
|
||||||
# Short circuit if no changes to the play queue
|
# Short circuit if no changes to the play queue
|
||||||
force |= self.offline_mode != app_config.offline_mode
|
force |= self.offline_mode != app_config.offline_mode
|
||||||
self.offline_mode = app_config.offline_mode
|
self.offline_mode = app_config.offline_mode
|
||||||
self.load_play_queue_button.set_sensitive(not self.offline_mode)
|
|
||||||
|
|
||||||
if not force and (
|
if not force and (
|
||||||
self.current_play_queue == app_config.state.play_queue
|
self.current_play_queue == app_config.state.play_queue
|
||||||
and self.current_playing_index == app_config.state.current_song_index
|
and self.current_playing_index == app_config.state.current_song_index
|
||||||
@@ -388,6 +388,10 @@ class PlayerControls(Gtk.ActionBar):
|
|||||||
self.play_queue_popover.popup()
|
self.play_queue_popover.popup()
|
||||||
self.play_queue_popover.show_all()
|
self.play_queue_popover.show_all()
|
||||||
|
|
||||||
|
# Hide the load play queue button if the adapter can't do that.
|
||||||
|
if not AdapterManager.can_get_play_queue():
|
||||||
|
self.load_play_queue_button.hide()
|
||||||
|
|
||||||
def on_song_activated(self, t: Any, idx: Gtk.TreePath, c: Any):
|
def on_song_activated(self, t: Any, idx: Gtk.TreePath, c: Any):
|
||||||
if not self.play_queue_store[idx[0]][0]:
|
if not self.play_queue_store[idx[0]][0]:
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user