Merge pull request 'added popup confirmation' (#5) from VIS-26 into master

Reviewed-on: #5
This commit is contained in:
Helena Gałązka 2021-01-04 12:26:50 +01:00
commit cbd200ea98

View File

@ -17,6 +17,10 @@ def files(path):
if os.path.isfile(os.path.join(path, file)): if os.path.isfile(os.path.join(path, file)):
yield 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): def save_input(oldpath):
# make timestampt the filename, so it wouln't overwrite # make timestampt the filename, so it wouln't overwrite
@ -35,6 +39,10 @@ class LibraryTableButtons(QWidget):
os.startfile(filePath + '\\' + filename) os.startfile(filePath + '\\' + filename)
def deleteFile(): def deleteFile():
self.exPopup = deletePopup()
self.exPopup.setGeometry(100, 200, 100, 100)
# self.exPopup.show()
if self.exPopup.Yes:
os.remove(filePath + '\\' + filename) os.remove(filePath + '\\' + filename)
layout = QHBoxLayout() layout = QHBoxLayout()