added popup confirmation #5

Merged
s416067 merged 2 commits from VIS-26 into master 2021-01-04 12:26:51 +01:00
Showing only changes of commit 36d5a30be0 - Show all commits

View File

@ -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)