Clean up editing
No need to disable (and re-enable) play controls. Fixes #191
This commit is contained in:
parent
1b92b79cf0
commit
243bc765f9
@ -1222,12 +1222,6 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
self.txtSearch.setText("")
|
||||
self.txtSearch.setHidden(True)
|
||||
|
||||
def search_playlist_return(self) -> None:
|
||||
"""Initiate search when return pressed"""
|
||||
|
||||
self.active_tab().set_search(self.txtSearch.text())
|
||||
self.enable_play_next_controls()
|
||||
|
||||
def search_playlist_text_changed(self) -> None:
|
||||
"""
|
||||
Incremental search of playlist
|
||||
|
||||
@ -212,8 +212,6 @@ class PlaylistTab(QTableView):
|
||||
Override closeEditor to enable play controls and update display.
|
||||
"""
|
||||
|
||||
self.musicmuster.enable_play_next_controls()
|
||||
self.musicmuster.actionSetNext.setEnabled(True)
|
||||
self.musicmuster.action_Clear_selection.setEnabled(True)
|
||||
|
||||
super(PlaylistTab, self).closeEditor(editor, hint)
|
||||
@ -255,33 +253,6 @@ class PlaylistTab(QTableView):
|
||||
|
||||
event.accept()
|
||||
|
||||
@overload
|
||||
def edit(self, index: QModelIndex) -> None:
|
||||
...
|
||||
|
||||
@overload
|
||||
def edit(
|
||||
self,
|
||||
index: QModelIndex,
|
||||
trigger: QAbstractItemView.EditTrigger,
|
||||
event: Optional[QEvent]
|
||||
) -> bool:
|
||||
...
|
||||
|
||||
def edit(self, index, trigger, event):
|
||||
"""
|
||||
Override QAbstractItemView.edit to catch when editing starts
|
||||
|
||||
Editing only ever starts with a double click on a cell
|
||||
"""
|
||||
|
||||
# 'result' will only be true on double-click
|
||||
result = super().edit(index, trigger, event)
|
||||
if result:
|
||||
self.musicmuster.disable_play_next_controls()
|
||||
|
||||
return result
|
||||
|
||||
def mouseReleaseEvent(self, event):
|
||||
"""
|
||||
Enable dragging if rows are selected
|
||||
|
||||
Loading…
Reference in New Issue
Block a user