diff --git a/win_venv/main.py b/win_venv/main.py index 9053a95..c73fea9 100644 --- a/win_venv/main.py +++ b/win_venv/main.py @@ -41,7 +41,7 @@ class deletePopup(QMessageBox): class LibraryTableButtons(QWidget): - def __init__(self, file, parent=None): + def __init__(self, file, table, type, parent=None): super(LibraryTableButtons,self).__init__(parent) def viewFile(): @@ -49,10 +49,10 @@ class LibraryTableButtons(QWidget): def deleteFile(): self.exPopup = deletePopup() - # self.exPopup.setGeometry(100, 200, 100, 100) ret = self.exPopup.exec() if ret == self.exPopup.Yes: os.remove(file) + table.fillTable(type) layout = QHBoxLayout() layout.setContentsMargins(0,0,0,0) @@ -73,6 +73,9 @@ class LibraryTable(QTableWidget): def __init__(self, type, parent=None): QTableWidget.__init__(self) + self.fillTable(type) + + def fillTable(self, type): self.setColumnCount(3) if type == LIB_RAW: @@ -81,6 +84,7 @@ class LibraryTable(QTableWidget): else: self.setHorizontalHeaderLabels(['Creation date', 'Filename', 'Options']) filePath = outputFilePath + self.horizontalHeader().setSectionResizeMode(0, QHeaderView.Stretch) self.horizontalHeader().setSectionResizeMode(1, QHeaderView.Stretch) self.horizontalHeader().setSectionResizeMode(2, QHeaderView.ResizeToContents) @@ -96,7 +100,7 @@ class LibraryTable(QTableWidget): for index, date in enumerate(dates): self.setItem(index,0,date) self.setItem(index,1,names[index]) - self.setCellWidget(index,2,LibraryTableButtons(filePath + '\\' + names[index].text())) + self.setCellWidget(index,2,LibraryTableButtons(filePath + '\\' + names[index].text(), self, type)) class formatHelp(QLabel):