WIP V3: fixup closing tabs
This commit is contained in:
parent
be7071aae0
commit
e37f62fe87
@ -463,29 +463,25 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
Return True if tab closed else False.
|
||||
"""
|
||||
|
||||
return False
|
||||
# TODO Reimplement without ussing self.current_track.playlist_tab
|
||||
# # Don't close current track playlist
|
||||
# if self.tabPlaylist.widget(tab_index) == (self.current_track.playlist_tab):
|
||||
# self.statusbar.showMessage("Can't close current track playlist", 5000)
|
||||
# return False
|
||||
# Don't close current track playlist
|
||||
current_track_playlist_id = track_sequence.now.playlist_id
|
||||
closing_tab_playlist_id = self.tabPlaylist.widget(tab_index).playlist_id
|
||||
if current_track_playlist_id:
|
||||
if closing_tab_playlist_id == current_track_playlist_id:
|
||||
self.statusbar.showMessage("Can't close current track playlist", 5000)
|
||||
return False
|
||||
|
||||
# # Attempt to close next track playlist
|
||||
# if self.tabPlaylist.widget(tab_index) == self.next_track.playlist_tab:
|
||||
# self.next_track.playlist_tab.clear_next()
|
||||
# Record playlist as closed and update remaining playlist tabs
|
||||
with Session() as session:
|
||||
playlist = session.get(Playlists, closing_tab_playlist_id)
|
||||
if playlist:
|
||||
playlist.close(session)
|
||||
|
||||
# # Record playlist as closed and update remaining playlist tabs
|
||||
# with Session() as session:
|
||||
# playlist_id = self.tabPlaylist.widget(tab_index).playlist_id
|
||||
# playlist = session.get(Playlists, playlist_id)
|
||||
# if playlist:
|
||||
# playlist.close(session)
|
||||
# Close playlist and remove tab
|
||||
self.tabPlaylist.widget(tab_index).close()
|
||||
self.tabPlaylist.removeTab(tab_index)
|
||||
|
||||
# # Close playlist and remove tab
|
||||
# self.tabPlaylist.widget(tab_index).close()
|
||||
# self.tabPlaylist.removeTab(tab_index)
|
||||
|
||||
# return True
|
||||
return True
|
||||
|
||||
def connect_signals_slots(self) -> None:
|
||||
self.action_About.triggered.connect(self.about)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user