57 lines
2.1 KiB
Python
57 lines
2.1 KiB
Python
from PyQt6.QtWidgets import QDialog, QTableWidgetItem
|
|
from _Window_comparison_dialog import Ui_FileComparisonDialog
|
|
|
|
class DialogCompareImportedChecksums(QDialog, Ui_FileComparisonDialog):
|
|
def __init__(self,*args,**kwargs):
|
|
super(DialogCompareImportedChecksums,self).__init__(*args,**kwargs)
|
|
self.setupUi(self)
|
|
# self.import_dialog = UI_DialogImport()
|
|
# self.ui_import_dialog = Ui_DialogImport()
|
|
|
|
self.table_headers = ['Source File',
|
|
'Destination File',
|
|
'Source Hash',
|
|
'Destination Hash',
|
|
'Checksum Match']
|
|
|
|
def setup_compare_dialog(self):
|
|
self.set_table_headers()
|
|
self.tableWidget.setRowCount(0)
|
|
|
|
def is_shown(self):
|
|
return self.isVisible()
|
|
|
|
def open_dialog(self):
|
|
if self.is_shown() is False:
|
|
self.show()
|
|
else:
|
|
self.close_dialog()
|
|
|
|
def close_dialog(self):
|
|
if self.is_shown():
|
|
self.hide()
|
|
|
|
def set_label_path_file_source(self,value):
|
|
self.l_path_file_source.setText(value)
|
|
|
|
def set_label_path_file_dest(self,value):
|
|
self.l_path_file_dest.setText(value)
|
|
|
|
def set_label_hash_source(self,value):
|
|
self.l_hash_source.setText(value)
|
|
|
|
def set_label_hash_dest(self,value):
|
|
self.l_hash_dest.setText(value)
|
|
|
|
def set_table_headers(self):
|
|
self.tableWidget.setHorizontalHeaderLabels(self.table_headers)
|
|
|
|
def add_table_row(self,_dictionary):
|
|
row_count = self.tableWidget.rowCount()
|
|
self.tableWidget.insertRow(row_count)
|
|
self.tableWidget.setItem(row_count, 0, QTableWidgetItem(_dictionary['source_path_file']))
|
|
self.tableWidget.setItem(row_count, 1, QTableWidgetItem(_dictionary['dest_path_file']))
|
|
self.tableWidget.setItem(row_count, 2, QTableWidgetItem(_dictionary['source_path_hash']))
|
|
self.tableWidget.setItem(row_count, 3, QTableWidgetItem(_dictionary['dest_path_hash']))
|
|
self.tableWidget.setItem(row_count, 4, QTableWidgetItem(str(_dictionary['checksum_match'])))
|