diff --git a/app/musicmuster.py b/app/musicmuster.py index 0127189..b469850 100755 --- a/app/musicmuster.py +++ b/app/musicmuster.py @@ -13,6 +13,7 @@ from PyQt5.QtWidgets import ( QInputDialog, QLabel, QMainWindow, + QMessageBox, ) import helpers @@ -198,6 +199,11 @@ class Window(QMainWindow, Ui_MainWindow): self.playlist.set_selected_as_next() self.update_headers() + def show_warning(self, title, msg): + "Display a warning to user" + + QMessageBox.warning(None, title, msg, buttons=QMessageBox.Cancel) + def test_function(self): "Placeholder for test function" diff --git a/app/playlists.py b/app/playlists.py index 80a26ca..d6ea416 100644 --- a/app/playlists.py +++ b/app/playlists.py @@ -221,6 +221,11 @@ class Playlist(QTableWidget): if repaint: self.repaint(clear_selection=False) + def can_read_track(self, track): + "Check track file is readable" + + return os.access(track.path, os.R_OK) + def create_playlist(self, name): "Create new playlist"