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 True if tab closed else False.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return False
|
# Don't close current track playlist
|
||||||
# TODO Reimplement without ussing self.current_track.playlist_tab
|
current_track_playlist_id = track_sequence.now.playlist_id
|
||||||
# # Don't close current track playlist
|
closing_tab_playlist_id = self.tabPlaylist.widget(tab_index).playlist_id
|
||||||
# if self.tabPlaylist.widget(tab_index) == (self.current_track.playlist_tab):
|
if current_track_playlist_id:
|
||||||
# self.statusbar.showMessage("Can't close current track playlist", 5000)
|
if closing_tab_playlist_id == current_track_playlist_id:
|
||||||
# return False
|
self.statusbar.showMessage("Can't close current track playlist", 5000)
|
||||||
|
return False
|
||||||
|
|
||||||
# # Attempt to close next track playlist
|
# Record playlist as closed and update remaining playlist tabs
|
||||||
# if self.tabPlaylist.widget(tab_index) == self.next_track.playlist_tab:
|
with Session() as session:
|
||||||
# self.next_track.playlist_tab.clear_next()
|
playlist = session.get(Playlists, closing_tab_playlist_id)
|
||||||
|
if playlist:
|
||||||
|
playlist.close(session)
|
||||||
|
|
||||||
# # Record playlist as closed and update remaining playlist tabs
|
# Close playlist and remove tab
|
||||||
# with Session() as session:
|
self.tabPlaylist.widget(tab_index).close()
|
||||||
# playlist_id = self.tabPlaylist.widget(tab_index).playlist_id
|
self.tabPlaylist.removeTab(tab_index)
|
||||||
# playlist = session.get(Playlists, playlist_id)
|
|
||||||
# if playlist:
|
|
||||||
# playlist.close(session)
|
|
||||||
|
|
||||||
# # Close playlist and remove tab
|
return True
|
||||||
# self.tabPlaylist.widget(tab_index).close()
|
|
||||||
# self.tabPlaylist.removeTab(tab_index)
|
|
||||||
|
|
||||||
# return True
|
|
||||||
|
|
||||||
def connect_signals_slots(self) -> None:
|
def connect_signals_slots(self) -> None:
|
||||||
self.action_About.triggered.connect(self.about)
|
self.action_About.triggered.connect(self.about)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user