Check next track is readable
This commit is contained in:
parent
4f4e81ab75
commit
d157dbd7c0
@ -13,6 +13,7 @@ from PyQt5.QtWidgets import (
|
|||||||
QInputDialog,
|
QInputDialog,
|
||||||
QLabel,
|
QLabel,
|
||||||
QMainWindow,
|
QMainWindow,
|
||||||
|
QMessageBox,
|
||||||
)
|
)
|
||||||
|
|
||||||
import helpers
|
import helpers
|
||||||
@ -198,6 +199,11 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
self.playlist.set_selected_as_next()
|
self.playlist.set_selected_as_next()
|
||||||
self.update_headers()
|
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):
|
def test_function(self):
|
||||||
"Placeholder for test function"
|
"Placeholder for test function"
|
||||||
|
|
||||||
|
|||||||
@ -221,6 +221,11 @@ class Playlist(QTableWidget):
|
|||||||
if repaint:
|
if repaint:
|
||||||
self.repaint(clear_selection=False)
|
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):
|
def create_playlist(self, name):
|
||||||
"Create new playlist"
|
"Create new playlist"
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user