Merge pull request 'VIS-37' (#8) from VIS-37 into master

Reviewed-on: #8
This commit is contained in:
Helena Gałązka 2021-01-11 16:25:46 +01:00
commit 0dd70ee9b7

View File

@ -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):