From 8f3d4e4685a09c4b4dafa659bb18a5f9b7592fe5 Mon Sep 17 00:00:00 2001 From: Daniel Kratzert Date: Thu, 28 Sep 2023 23:02:34 +0200 Subject: [PATCH] Display the hkl loop --- finalcif/appwindow.py | 16 ++++++++++------ finalcif/tools/misc.py | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/finalcif/appwindow.py b/finalcif/appwindow.py index 14e4d244..1b0056f2 100644 --- a/finalcif/appwindow.py +++ b/finalcif/appwindow.py @@ -618,7 +618,8 @@ def resizeEvent(self, a0: QtGui.QResizeEvent) -> None: if left_frame <= 300: left_frame = 300 self.ui.LeftFrame.setMinimumWidth(int(left_frame)) - threading.Thread(target=self.ui.cif_main_table.resizeRowsToContents).start() + # threading.Thread(target=self.ui.cif_main_table.resizeRowsToContents).start() + QtCore.QTimer(self).singleShot(0, self.ui.cif_main_table.resizeRowsToContents) def moveEvent(self, a0: QtGui.QMoveEvent) -> None: """Is called when the main window moves.""" @@ -1038,7 +1039,7 @@ def set_checkcif_output_font(self, ccpe: 'QPlainTextEdit') -> None: font = doc.defaultFont() font.setFamily("Courier New") font.setStyleHint(QtGui.QFont.Monospace) - #app.processEvents() + # app.processEvents() font.setPointSize(14) doc.setDefaultFont(font) @@ -1385,6 +1386,9 @@ def import_loops(self, imp_cif: 'CifContainer'): if self.ui.importOnlyNewDataCheckBox.isChecked() and self.cif.block.find(loop.tags): # Import only new loops continue + # TODO: Make this work: + #if loop.tags[0] in do_not_loop_import: + # continue new_loop = self.cif.block.init_loop('', loop.tags) for row in imp_cif.block.find(loop.tags): new_loop.add_row(row) @@ -1843,7 +1847,7 @@ def fill_cif_table(self) -> None: self.add_row(key, value) if key == '_audit_creation_method': self.add_audit_creation_method(key) - #QtCore.QTimer(self).singleShot(200, self.ui.cif_main_table.resizeRowsToContents) + # QtCore.QTimer(self).singleShot(200, self.ui.cif_main_table.resizeRowsToContents) # print(key, value) if not self.cif.test_res_checksum(): show_res_checksum_warning(parent=self) @@ -1873,13 +1877,13 @@ def add_loops_tables(self) -> None: """ Generates a list of tables containing the cif loops. """ - do_not_display = ('_diffrn_refln_index_h') + #do_not_display = ('_diffrn_refln_index_h') for num, loop in enumerate(self.cif.loops): tags = loop.tags if not tags or len(tags) < 1: continue - if tags[0] in do_not_display: - continue + #if tags[0] in do_not_display: + # continue self.new_loop_tab(loop, num, tags) if self.cif.res_file_data: self.add_res_file_to_loops() diff --git a/finalcif/tools/misc.py b/finalcif/tools/misc.py index c1e40cb8..0f02ecf2 100644 --- a/finalcif/tools/misc.py +++ b/finalcif/tools/misc.py @@ -491,6 +491,7 @@ def make_numbered(items): '_exptl_oxdiff_crystal_face_indexfrac_h': 'Crystal Faces Fractional', '_platon_squeeze_void_nr' : 'Platon SQUEEZE Voids', '_smtbx_masks_void_nr' : 'smtbx Solvent Mask', + '_refln_index_h' : 'hkl file', } """