deleting the file #4

Merged
s416067 merged 2 commits from VIS-24 into master 2021-01-04 12:24:22 +01:00
2 changed files with 7 additions and 1 deletions
Showing only changes of commit f75fb1f333 - Show all commits

View File

@ -22,6 +22,9 @@ class LibraryTableButtons(QWidget):
def viewFile():
os.startfile(filePath + '\\' + filename)
def deleteFile():
os.remove(filePath + '\\' + filename)
layout = QHBoxLayout()
layout.setContentsMargins(0,0,0,0)
layout.setSpacing(0)
@ -29,7 +32,10 @@ class LibraryTableButtons(QWidget):
view_btn = QPushButton('View')
view_btn.clicked.connect(viewFile)
layout.addWidget(view_btn)
layout.addWidget(QPushButton('Delete'))
delete_btn = QPushButton('Delete')
delete_btn.clicked.connect(deleteFile)
layout.addWidget(delete_btn)
self.setLayout(layout)