Code cleanup
This commit is contained in:
parent
f143bd7fe9
commit
871598efe6
@ -95,25 +95,6 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
def set_main_window_size(self) -> None:
|
def set_main_window_size(self) -> None:
|
||||||
"""Set size of window from database"""
|
"""Set size of window from database"""
|
||||||
|
|
||||||
def add_file(self):
|
|
||||||
dlg = QFileDialog()
|
|
||||||
dlg.setFileMode(QFileDialog.ExistingFiles)
|
|
||||||
dlg.setViewMode(QFileDialog.Detail)
|
|
||||||
dlg.setDirectory(Config.ROOT)
|
|
||||||
dlg.setNameFilter("Music files (*.flac *.mp3)")
|
|
||||||
|
|
||||||
if dlg.exec_():
|
|
||||||
with Session() as session:
|
|
||||||
for fname in dlg.selectedFiles():
|
|
||||||
track = create_track_from_file(session, fname)
|
|
||||||
# Add to playlist on screen
|
|
||||||
# If we don't specify "repaint=False", playlist will
|
|
||||||
# also be saved to database
|
|
||||||
self.visible_playlist_tab().insert_track(session, track)
|
|
||||||
|
|
||||||
def set_main_window_size(self):
|
|
||||||
"Set size of window from database"
|
|
||||||
|
|
||||||
with Session() as session:
|
with Session() as session:
|
||||||
record = Settings.get_int_settings(session, "mainwindow_x")
|
record = Settings.get_int_settings(session, "mainwindow_x")
|
||||||
x = record.f_int or 1
|
x = record.f_int or 1
|
||||||
@ -647,9 +628,6 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
dlg = DbDialog(self, session)
|
dlg = DbDialog(self, session)
|
||||||
dlg.exec()
|
dlg.exec()
|
||||||
|
|
||||||
def open_playlist(self) -> None:
|
|
||||||
"""Select and activate existing playlist"""
|
|
||||||
|
|
||||||
def search_playlist(self):
|
def search_playlist(self):
|
||||||
self.txtSearch.setHidden(False)
|
self.txtSearch.setHidden(False)
|
||||||
self.txtSearch.setFocus()
|
self.txtSearch.setFocus()
|
||||||
|
|||||||
@ -876,6 +876,7 @@ class PlaylistTab(QTableWidget):
|
|||||||
|
|
||||||
def _context_menu(self, pos): # review
|
def _context_menu(self, pos): # review
|
||||||
|
|
||||||
|
assert self.menu
|
||||||
self.menu.exec_(self.mapToGlobal(pos))
|
self.menu.exec_(self.mapToGlobal(pos))
|
||||||
|
|
||||||
def _copy_path(self, row: int) -> None:
|
def _copy_path(self, row: int) -> None:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user