Merge pull request 'added popup confirmation' (#5) from VIS-26 into master
Reviewed-on: #5
This commit is contained in:
commit
cbd200ea98
@ -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,7 +39,11 @@ class LibraryTableButtons(QWidget):
|
|||||||
os.startfile(filePath + '\\' + filename)
|
os.startfile(filePath + '\\' + filename)
|
||||||
|
|
||||||
def deleteFile():
|
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 = QHBoxLayout()
|
||||||
layout.setContentsMargins(0,0,0,0)
|
layout.setContentsMargins(0,0,0,0)
|
||||||
|
Loading…
Reference in New Issue
Block a user