added popup confirmation #5
@ -17,6 +17,10 @@ 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)
|
||||
|
||||
def save_input(oldpath):
|
||||
# make timestampt the filename, so it wouln't overwrite
|
||||
@ -35,6 +39,10 @@ class LibraryTableButtons(QWidget):
|
||||
os.startfile(filePath + '\\' + filename)
|
||||
|
||||
def deleteFile():
|
||||
self.exPopup = deletePopup()
|
||||
self.exPopup.setGeometry(100, 200, 100, 100)
|
||||
# self.exPopup.show()
|
||||
if self.exPopup.Yes:
|
||||
os.remove(filePath + '\\' + filename)
|
||||
|
||||
layout = QHBoxLayout()
|
||||
|
Loading…
Reference in New Issue
Block a user