added popup confirmation #5
@ -15,6 +15,11 @@ def files(path):
|
||||
if os.path.isfile(os.path.join(path, file)):
|
||||
yield file
|
||||
|
||||
class deletePopup(QMessageBox):
|
||||
def __init__(self, parent=None):
|
||||
super(deletePopup,self).__init__(parent)
|
||||
self.question(self,'', "Are you sure you want to delete the file?", self.Yes | self.No)
|
||||
|
||||
class LibraryTableButtons(QWidget):
|
||||
def __init__(self, filename, parent=None):
|
||||
super(LibraryTableButtons,self).__init__(parent)
|
||||
@ -23,7 +28,11 @@ class LibraryTableButtons(QWidget):
|
||||
os.startfile(filePath + '\\' + filename)
|
||||
|
||||
def deleteFile():
|
||||
os.remove(filePath + '\\' + filename)
|
||||
self.exPopup = deletePopup()
|
||||
self.exPopup.setGeometry(100, 200, 100, 100)
|
||||
# self.exPopup.show()
|
||||
if self.exPopup.Yes:
|
||||
os.remove(filePath + '\\' + filename)
|
||||
|
||||
layout = QHBoxLayout()
|
||||
layout.setContentsMargins(0,0,0,0)
|
||||
|
Loading…
Reference in New Issue
Block a user