refreshes the table after deleting the file
This commit is contained in:
parent
5cceb7c77f
commit
47a0a52475
@ -41,7 +41,7 @@ class deletePopup(QMessageBox):
|
|||||||
|
|
||||||
|
|
||||||
class LibraryTableButtons(QWidget):
|
class LibraryTableButtons(QWidget):
|
||||||
def __init__(self, file, parent=None):
|
def __init__(self, file, table, type, parent=None):
|
||||||
super(LibraryTableButtons,self).__init__(parent)
|
super(LibraryTableButtons,self).__init__(parent)
|
||||||
|
|
||||||
def viewFile():
|
def viewFile():
|
||||||
@ -49,10 +49,10 @@ class LibraryTableButtons(QWidget):
|
|||||||
|
|
||||||
def deleteFile():
|
def deleteFile():
|
||||||
self.exPopup = deletePopup()
|
self.exPopup = deletePopup()
|
||||||
# self.exPopup.setGeometry(100, 200, 100, 100)
|
|
||||||
ret = self.exPopup.exec()
|
ret = self.exPopup.exec()
|
||||||
if ret == self.exPopup.Yes:
|
if ret == self.exPopup.Yes:
|
||||||
os.remove(file)
|
os.remove(file)
|
||||||
|
table.fillTable(type)
|
||||||
|
|
||||||
layout = QHBoxLayout()
|
layout = QHBoxLayout()
|
||||||
layout.setContentsMargins(0,0,0,0)
|
layout.setContentsMargins(0,0,0,0)
|
||||||
@ -73,6 +73,9 @@ class LibraryTable(QTableWidget):
|
|||||||
|
|
||||||
def __init__(self, type, parent=None):
|
def __init__(self, type, parent=None):
|
||||||
QTableWidget.__init__(self)
|
QTableWidget.__init__(self)
|
||||||
|
self.fillTable(type)
|
||||||
|
|
||||||
|
def fillTable(self, type):
|
||||||
self.setColumnCount(3)
|
self.setColumnCount(3)
|
||||||
|
|
||||||
if type == LIB_RAW:
|
if type == LIB_RAW:
|
||||||
@ -81,6 +84,7 @@ class LibraryTable(QTableWidget):
|
|||||||
else:
|
else:
|
||||||
self.setHorizontalHeaderLabels(['Creation date', 'Filename', 'Options'])
|
self.setHorizontalHeaderLabels(['Creation date', 'Filename', 'Options'])
|
||||||
filePath = outputFilePath
|
filePath = outputFilePath
|
||||||
|
|
||||||
self.horizontalHeader().setSectionResizeMode(0, QHeaderView.Stretch)
|
self.horizontalHeader().setSectionResizeMode(0, QHeaderView.Stretch)
|
||||||
self.horizontalHeader().setSectionResizeMode(1, QHeaderView.Stretch)
|
self.horizontalHeader().setSectionResizeMode(1, QHeaderView.Stretch)
|
||||||
self.horizontalHeader().setSectionResizeMode(2, QHeaderView.ResizeToContents)
|
self.horizontalHeader().setSectionResizeMode(2, QHeaderView.ResizeToContents)
|
||||||
@ -96,7 +100,7 @@ class LibraryTable(QTableWidget):
|
|||||||
for index, date in enumerate(dates):
|
for index, date in enumerate(dates):
|
||||||
self.setItem(index,0,date)
|
self.setItem(index,0,date)
|
||||||
self.setItem(index,1,names[index])
|
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):
|
class formatHelp(QLabel):
|
||||||
@ -152,13 +156,13 @@ class MainWindow(QMainWindow):
|
|||||||
|
|
||||||
# Show raw uploaded files
|
# Show raw uploaded files
|
||||||
def showInputLibrary(self):
|
def showInputLibrary(self):
|
||||||
libTable = LibraryTable(LIB_RAW)
|
self.libTable = LibraryTable(LIB_RAW)
|
||||||
self.setCentralWidget(libTable)
|
self.setCentralWidget(self.libTable)
|
||||||
|
|
||||||
# Show visualisations
|
# Show visualisations
|
||||||
def showVisualisationsLibrary(self):
|
def showVisualisationsLibrary(self):
|
||||||
libTable = LibraryTable(LIB_VIS)
|
self.libTable = LibraryTable(LIB_VIS)
|
||||||
self.setCentralWidget(libTable)
|
self.setCentralWidget(self.libTable)
|
||||||
|
|
||||||
def showUploadFile(self):
|
def showUploadFile(self):
|
||||||
dialog = QFileDialog(self)
|
dialog = QFileDialog(self)
|
||||||
|
Loading…
Reference in New Issue
Block a user