finalcif 140__tar.gz → 142__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. {finalcif-140 → finalcif-142}/.gitignore +1 -0
  2. {finalcif-140 → finalcif-142}/PKG-INFO +1 -2
  3. finalcif-142/finalcif/__init__.py +2 -0
  4. {finalcif-140 → finalcif-142}/finalcif/appwindow.py +53 -40
  5. {finalcif-140 → finalcif-142}/finalcif/cif/cif_file_io.py +42 -14
  6. {finalcif-140 → finalcif-142}/finalcif/datafiles/p4p_reader.py +1 -1
  7. finalcif-142/finalcif/gui/block_combobox.py +35 -0
  8. {finalcif-140 → finalcif-142}/finalcif/gui/finalcif_gui_ui.py +8 -11
  9. {finalcif-140 → finalcif-142}/finalcif/gui/finalcif_gui_ui.ui +15 -11
  10. {finalcif-140 → finalcif-142}/finalcif/report/references.py +0 -1
  11. finalcif-142/finalcif/report/report_text.py +150 -0
  12. {finalcif-140 → finalcif-142}/finalcif/report/tables.py +0 -2
  13. {finalcif-140 → finalcif-142}/finalcif/report/templated_report.py +143 -19
  14. finalcif-142/finalcif/template/report_default.docx +0 -0
  15. finalcif-142/finalcif/template/template_text.docx +0 -0
  16. finalcif-142/finalcif/template/template_without_text.docx +0 -0
  17. {finalcif-140 → finalcif-142}/finalcif/template/templates.py +6 -1
  18. {finalcif-140 → finalcif-142}/finalcif/tools/misc.py +58 -4
  19. {finalcif-140 → finalcif-142}/finalcif/tools/options.py +17 -8
  20. {finalcif-140 → finalcif-142}/requirements.txt +0 -1
  21. finalcif-140/finalcif/__init__.py +0 -2
  22. finalcif-140/finalcif/report/report_text.py +0 -573
  23. finalcif-140/finalcif/template/template_text.docx +0 -0
  24. finalcif-140/finalcif/template/template_without_text.docx +0 -0
  25. {finalcif-140 → finalcif-142}/.gitattributes +0 -0
  26. {finalcif-140 → finalcif-142}/.run/Make Documentation MAC.run.xml +0 -0
  27. {finalcif-140 → finalcif-142}/.run/compile_ui_files.run.xml +0 -0
  28. {finalcif-140 → finalcif-142}/.run/make documentation Windows.run.xml +0 -0
  29. {finalcif-140 → finalcif-142}/CODE_OF_CONDUCT.md +0 -0
  30. {finalcif-140 → finalcif-142}/CONTRIBUTING.md +0 -0
  31. {finalcif-140 → finalcif-142}/Finalcif_installer_win.spec +0 -0
  32. {finalcif-140 → finalcif-142}/Finalcif_linux_onefile.spec +0 -0
  33. {finalcif-140 → finalcif-142}/Finalcif_mac.spec +0 -0
  34. {finalcif-140 → finalcif-142}/Hydrogen_solution_type.cif +0 -0
  35. {finalcif-140 → finalcif-142}/LICENSE +0 -0
  36. {finalcif-140 → finalcif-142}/README.md +0 -0
  37. {finalcif-140 → finalcif-142}/finalcif/app_path.py +0 -0
  38. {finalcif-140 → finalcif-142}/finalcif/cif/__init__.py +0 -0
  39. {finalcif-140 → finalcif-142}/finalcif/cif/all_cif_dicts.py +0 -0
  40. {finalcif-140 → finalcif-142}/finalcif/cif/atoms.py +0 -0
  41. {finalcif-140 → finalcif-142}/finalcif/cif/checkcif/__init__.py +0 -0
  42. {finalcif-140 → finalcif-142}/finalcif/cif/checkcif/checkcif.py +0 -0
  43. {finalcif-140 → finalcif-142}/finalcif/cif/cif_dict_foo.py +0 -0
  44. {finalcif-140 → finalcif-142}/finalcif/cif/cif_order.py +0 -0
  45. {finalcif-140 → finalcif-142}/finalcif/cif/cod/__init__.py +0 -0
  46. {finalcif-140 → finalcif-142}/finalcif/cif/cod/deposit.py +0 -0
  47. {finalcif-140 → finalcif-142}/finalcif/cif/cod/deposit_check.py +0 -0
  48. {finalcif-140 → finalcif-142}/finalcif/cif/cod/deposition_list.py +0 -0
  49. {finalcif-140 → finalcif-142}/finalcif/cif/cod/doi.py +0 -0
  50. {finalcif-140 → finalcif-142}/finalcif/cif/cod/upload.py +0 -0
  51. {finalcif-140 → finalcif-142}/finalcif/cif/cod/website_parser.py +0 -0
  52. {finalcif-140 → finalcif-142}/finalcif/cif/core_dict.py +0 -0
  53. {finalcif-140 → finalcif-142}/finalcif/cif/hkl.py +0 -0
  54. {finalcif-140 → finalcif-142}/finalcif/cif/modulation_dict.py +0 -0
  55. {finalcif-140 → finalcif-142}/finalcif/cif/powder_dict.py +0 -0
  56. {finalcif-140 → finalcif-142}/finalcif/cif/reference.py +0 -0
  57. {finalcif-140 → finalcif-142}/finalcif/cif/restraints_dict.py +0 -0
  58. {finalcif-140 → finalcif-142}/finalcif/cif/text.py +0 -0
  59. {finalcif-140 → finalcif-142}/finalcif/cif/twin_dict.py +0 -0
  60. {finalcif-140 → finalcif-142}/finalcif/datafiles/__init__.py +0 -0
  61. {finalcif-140 → finalcif-142}/finalcif/datafiles/bruker_data.py +0 -0
  62. {finalcif-140 → finalcif-142}/finalcif/datafiles/bruker_frame.py +0 -0
  63. {finalcif-140 → finalcif-142}/finalcif/datafiles/ccdc_mail.py +0 -0
  64. {finalcif-140 → finalcif-142}/finalcif/datafiles/data.py +0 -0
  65. {finalcif-140 → finalcif-142}/finalcif/datafiles/sadabs.py +0 -0
  66. {finalcif-140 → finalcif-142}/finalcif/datafiles/saint.py +0 -0
  67. {finalcif-140 → finalcif-142}/finalcif/datafiles/shelx_lst.py +0 -0
  68. {finalcif-140 → finalcif-142}/finalcif/datafiles/utils.py +0 -0
  69. {finalcif-140 → finalcif-142}/finalcif/displaymol/__init__.py +0 -0
  70. {finalcif-140 → finalcif-142}/finalcif/displaymol/molecule2D.py +0 -0
  71. {finalcif-140 → finalcif-142}/finalcif/displaymol/sdm.py +0 -0
  72. {finalcif-140 → finalcif-142}/finalcif/displaymol/vtk_molecule.py +0 -0
  73. {finalcif-140 → finalcif-142}/finalcif/equip_property/__init__.py +0 -0
  74. {finalcif-140 → finalcif-142}/finalcif/equip_property/author_loop_templates.py +0 -0
  75. {finalcif-140 → finalcif-142}/finalcif/equip_property/equipment.py +0 -0
  76. {finalcif-140 → finalcif-142}/finalcif/equip_property/properties.py +0 -0
  77. {finalcif-140 → finalcif-142}/finalcif/equip_property/tools.py +0 -0
  78. {finalcif-140 → finalcif-142}/finalcif/finalcif_start.py +0 -0
  79. {finalcif-140 → finalcif-142}/finalcif/gui/__init__.py +0 -0
  80. {finalcif-140 → finalcif-142}/finalcif/gui/combobox.py +0 -0
  81. {finalcif-140 → finalcif-142}/finalcif/gui/custom_classes.py +0 -0
  82. {finalcif-140 → finalcif-142}/finalcif/gui/dialogs.py +0 -0
  83. {finalcif-140 → finalcif-142}/finalcif/gui/edit_button.py +0 -0
  84. {finalcif-140 → finalcif-142}/finalcif/gui/equipmenttable.py +0 -0
  85. {finalcif-140 → finalcif-142}/finalcif/gui/file_editor.py +0 -0
  86. {finalcif-140 → finalcif-142}/finalcif/gui/import_selector.py +0 -0
  87. {finalcif-140 → finalcif-142}/finalcif/gui/import_selector_ui.py +0 -0
  88. {finalcif-140 → finalcif-142}/finalcif/gui/import_selector_ui.ui +0 -0
  89. {finalcif-140 → finalcif-142}/finalcif/gui/loop_creator.py +0 -0
  90. {finalcif-140 → finalcif-142}/finalcif/gui/loop_creator_ui.py +0 -0
  91. {finalcif-140 → finalcif-142}/finalcif/gui/loop_creator_ui.ui +0 -0
  92. {finalcif-140 → finalcif-142}/finalcif/gui/loops.py +0 -0
  93. {finalcif-140 → finalcif-142}/finalcif/gui/mainstackwidget.py +0 -0
  94. {finalcif-140 → finalcif-142}/finalcif/gui/mixins.py +0 -0
  95. {finalcif-140 → finalcif-142}/finalcif/gui/new_key_dialog.py +0 -0
  96. {finalcif-140 → finalcif-142}/finalcif/gui/new_key_dialog_ui.py +0 -0
  97. {finalcif-140 → finalcif-142}/finalcif/gui/new_key_dialog_ui.ui +0 -0
  98. {finalcif-140 → finalcif-142}/finalcif/gui/plaintextedit.py +0 -0
  99. {finalcif-140 → finalcif-142}/finalcif/gui/playground.py +0 -0
  100. {finalcif-140 → finalcif-142}/finalcif/gui/propertytable.py +0 -0
  101. {finalcif-140 → finalcif-142}/finalcif/gui/spell_check_edit.py +0 -0
  102. {finalcif-140 → finalcif-142}/finalcif/gui/text_templates_ui.py +0 -0
  103. {finalcif-140 → finalcif-142}/finalcif/gui/text_templates_ui.ui +0 -0
  104. {finalcif-140 → finalcif-142}/finalcif/gui/text_value_editor.py +0 -0
  105. {finalcif-140 → finalcif-142}/finalcif/gui/validators.py +0 -0
  106. {finalcif-140 → finalcif-142}/finalcif/gui/vrf_classes.py +0 -0
  107. {finalcif-140 → finalcif-142}/finalcif/icon/__init__.py +0 -0
  108. {finalcif-140 → finalcif-142}/finalcif/icon/finalcif.png +0 -0
  109. {finalcif-140 → finalcif-142}/finalcif/icon/finalcif2.ico +0 -0
  110. {finalcif-140 → finalcif-142}/finalcif/icon/finalcif2.png +0 -0
  111. {finalcif-140 → finalcif-142}/finalcif/icon/multitable.ico +0 -0
  112. {finalcif-140 → finalcif-142}/finalcif/icon/multitable.png +0 -0
  113. {finalcif-140 → finalcif-142}/finalcif/icon/multitable.xcf +0 -0
  114. {finalcif-140 → finalcif-142}/finalcif/report/__init__.py +0 -0
  115. {finalcif-140 → finalcif-142}/finalcif/report/archive_report.py +0 -0
  116. {finalcif-140 → finalcif-142}/finalcif/report/gui/__init__.py +0 -0
  117. {finalcif-140 → finalcif-142}/finalcif/report/gui/mainwindow.py +0 -0
  118. {finalcif-140 → finalcif-142}/finalcif/report/gui/mainwindow.ui +0 -0
  119. {finalcif-140 → finalcif-142}/finalcif/report/mtools.py +0 -0
  120. {finalcif-140 → finalcif-142}/finalcif/report/symm.py +0 -0
  121. {finalcif-140 → finalcif-142}/finalcif/template/__init__.py +0 -0
  122. {finalcif-140 → finalcif-142}/finalcif/template/bootstrap/bootstrap.min.css +0 -0
  123. {finalcif-140 → finalcif-142}/finalcif/template/machines/D8_VENTURE.cif +0 -0
  124. {finalcif-140 → finalcif-142}/finalcif/template/mathml2omml.xsl +0 -0
  125. {finalcif-140 → finalcif-142}/finalcif/template/report.tmpl +0 -0
  126. {finalcif-140 → finalcif-142}/finalcif/template/template1.docx +0 -0
  127. {finalcif-140 → finalcif-142}/finalcif/template/template_for_multitable.docx +0 -0
  128. {finalcif-140 → finalcif-142}/finalcif/template/xsl/convert.py +0 -0
  129. {finalcif-140 → finalcif-142}/finalcif/template/xsl/xmltohtml.xsl +0 -0
  130. {finalcif-140 → finalcif-142}/finalcif/tools/__init__.py +0 -0
  131. {finalcif-140 → finalcif-142}/finalcif/tools/chemparse.py +0 -0
  132. {finalcif-140 → finalcif-142}/finalcif/tools/download.py +0 -0
  133. {finalcif-140 → finalcif-142}/finalcif/tools/dsrmath.py +0 -0
  134. {finalcif-140 → finalcif-142}/finalcif/tools/platon.py +0 -0
  135. {finalcif-140 → finalcif-142}/finalcif/tools/pupdate.py +0 -0
  136. {finalcif-140 → finalcif-142}/finalcif/tools/settings.py +0 -0
  137. {finalcif-140 → finalcif-142}/finalcif/tools/shred.py +0 -0
  138. {finalcif-140 → finalcif-142}/finalcif/tools/space_groups.py +0 -0
  139. {finalcif-140 → finalcif-142}/finalcif/tools/spgr_format.py +0 -0
  140. {finalcif-140 → finalcif-142}/finalcif/tools/statusbar.py +0 -0
  141. {finalcif-140 → finalcif-142}/finalcif/tools/sumformula.py +0 -0
  142. {finalcif-140 → finalcif-142}/finalcif.exe +0 -0
  143. {finalcif-140 → finalcif-142}/install_requirements +0 -0
  144. {finalcif-140 → finalcif-142}/install_requirements.bat +0 -0
  145. {finalcif-140 → finalcif-142}/pyproject.toml +0 -0
  146. {finalcif-140 → finalcif-142}/requirements_devel.txt +0 -0
  147. {finalcif-140 → finalcif-142}/requirements_doku.txt +0 -0
  148. {finalcif-140 → finalcif-142}/run_finalcif +0 -0
  149. {finalcif-140 → finalcif-142}/run_finalcif.bat +0 -0
  150. {finalcif-140 → finalcif-142}/screenshots/finalcif_checkcif.png +0 -0
  151. {finalcif-140 → finalcif-142}/screenshots/finalcif_details.png +0 -0
  152. {finalcif-140 → finalcif-142}/screenshots/finalcif_loops.png +0 -0
  153. {finalcif-140 → finalcif-142}/screenshots/finalcif_loops2.png +0 -0
  154. {finalcif-140 → finalcif-142}/screenshots/finalcif_main.png +0 -0
  155. {finalcif-140 → finalcif-142}/screenshots/finalcif_report.png +0 -0
  156. {finalcif-140 → finalcif-142}/screenshots/finalcif_responses.png +0 -0
  157. {finalcif-140 → finalcif-142}/update.exe +0 -0
@@ -220,3 +220,4 @@ test-data/report_1000007-multi-finalcif.docx
220
220
  test.html
221
221
 
222
222
  work/~$test.docx
223
+ tests/examples/work/report_cu_BruecknerJK_153F40_0m-finalcif_pm.docx
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: finalcif
3
- Version: 140
3
+ Version: 142
4
4
  Summary: CIF file editor
5
5
  Project-URL: Homepage, https://dkratzert.de/finalcif.html
6
6
  Project-URL: Bug Tracker, https://github.com/dkratzert/FinalCif/issues
@@ -12,7 +12,6 @@ Classifier: Operating System :: OS Independent
12
12
  Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Topic :: Scientific/Engineering :: Chemistry
14
14
  Requires-Python: >=3.10
15
- Requires-Dist: altgraph
16
15
  Requires-Dist: certifi
17
16
  Requires-Dist: chardet
18
17
  Requires-Dist: crossrefapi
@@ -0,0 +1,2 @@
1
+
2
+ VERSION = 142
@@ -302,6 +302,7 @@ class AppWindow(QMainWindow):
302
302
  this method connects all signals to slots. Only a few mighjt be defined elsewere.
303
303
  """
304
304
  self.ui.datanameComboBox.currentIndexChanged.connect(self._load_block)
305
+ self.ui.datanameComboBox.delete_signal.connect(self._delete_current_block)
305
306
  ## main
306
307
  self.ui.BackPushButton.clicked.connect(self.back_to_main)
307
308
  self.ui.BackFromDepositPushButton.clicked.connect(self.back_to_main)
@@ -1102,7 +1103,10 @@ class AppWindow(QMainWindow):
1102
1103
  for index in range(self.ui.docxTemplatesListWidget.count()):
1103
1104
  item = self.ui.docxTemplatesListWidget.item(index)
1104
1105
  if item.checkState() == Qt.Checked:
1105
- return item.text()
1106
+ if self.templates.report_from_default_template():
1107
+ return 'finalcif/template/report_default.docx'
1108
+ else:
1109
+ return item.text()
1106
1110
 
1107
1111
  def make_report_tables(self) -> None:
1108
1112
  """
@@ -1121,36 +1125,32 @@ class AppWindow(QMainWindow):
1121
1125
  self.load_cif_file(self.cif.finalcif_file, block=current_block, load_changes=False)
1122
1126
  report_filename = self.cif.finalcif_file_prefixed(prefix='report_', suffix='-finalcif.docx')
1123
1127
  multi_table_document = self.cif.finalcif_file_prefixed(prefix='', suffix='-multitable.docx')
1128
+ self.cif.picometer = self.options.use_picometers
1124
1129
  # The picture after the header:
1125
1130
  if self.report_picture_path:
1126
1131
  picfile = self.report_picture_path
1127
1132
  else:
1128
1133
  picfile = self.cif.finalcif_file.with_suffix('.gif')
1129
1134
  try:
1130
- if self.report_without_template():
1131
- print('Report without templates')
1132
- make_report_from(options=self.options, cif=self.cif,
1133
- output_filename=str(report_filename), picfile=picfile)
1135
+ print('Report with templates')
1136
+ template_path = Path(self.get_checked_templates_list_text())
1137
+ ok = False
1138
+ if template_path.suffix in ('.docx',):
1139
+ t = TemplatedReport(format=ReportFormat.RICHTEXT, options=self.options, cif=self.cif)
1140
+ ok = t.make_templated_docx_report(output_filename=str(report_filename),
1141
+ picfile=picfile,
1142
+ template_path=Path(self.get_checked_templates_list_text()))
1134
1143
  if self.cif.is_multi_cif and self.cif.doc[0].name != 'global':
1135
1144
  make_multi_tables(cif=self.cif, output_filename=str(multi_table_document))
1136
- else:
1137
- print('Report with templates')
1138
- template_path = Path(self.get_checked_templates_list_text())
1139
- ok = False
1140
- if template_path.suffix in ('.docx',):
1141
- t = TemplatedReport(format=ReportFormat.RICHTEXT, options=self.options, cif=self.cif)
1142
- ok = t.make_templated_docx_report(output_filename=str(report_filename),
1143
- picfile=picfile,
1144
- template_path=Path(self.get_checked_templates_list_text()))
1145
- elif template_path.suffix in ('.html', '.tmpl'):
1146
- t = TemplatedReport(format=ReportFormat.HTML, options=self.options, cif=self.cif)
1147
- report_filename = report_filename.with_suffix('.html')
1148
- ok = t.make_templated_html_report(output_filename=str(report_filename),
1149
- picfile=picfile,
1150
- template_path=template_path.parent,
1151
- template_file=template_path.name)
1152
- if not ok:
1153
- return None
1145
+ elif template_path.suffix in ('.html', '.tmpl'):
1146
+ t = TemplatedReport(format=ReportFormat.HTML, options=self.options, cif=self.cif)
1147
+ report_filename = report_filename.with_suffix('.html')
1148
+ ok = t.make_templated_html_report(output_filename=str(report_filename),
1149
+ picfile=picfile,
1150
+ template_path=template_path.parent,
1151
+ template_file=template_path.name)
1152
+ if not ok:
1153
+ return None
1154
1154
  except FileNotFoundError as e:
1155
1155
  if DEBUG:
1156
1156
  raise
@@ -1170,11 +1170,6 @@ class AppWindow(QMainWindow):
1170
1170
  # Save report and other files to a zip file:
1171
1171
  self.zip_report(report_filename)
1172
1172
 
1173
- def report_without_template(self) -> bool:
1174
- """Check whether the report is generated from a template or hard-coded"""
1175
- return self.ui.docxTemplatesListWidget.item(0).checkState() == Qt.CheckState.Checked \
1176
- or not self.ui.docxTemplatesListWidget.currentItem()
1177
-
1178
1173
  def zip_report(self, report_filename: Path) -> None:
1179
1174
  from finalcif.report.archive_report import ArchiveReport
1180
1175
  zipfile = self.cif.finalcif_file.with_suffix('.zip')
@@ -1195,7 +1190,7 @@ class AppWindow(QMainWindow):
1195
1190
  arc.zip.write(filename=multitable, arcname=multitable.name)
1196
1191
 
1197
1192
  def open_report_document(self, report_filename: Path, multi_table_document: Path) -> None:
1198
- if self.cif.is_multi_cif and self.report_without_template():
1193
+ if self.cif.is_multi_cif:
1199
1194
  open_file(multi_table_document)
1200
1195
  open_file(report_filename)
1201
1196
 
@@ -1436,8 +1431,6 @@ class AppWindow(QMainWindow):
1436
1431
  Opens the cif file and fills information into the main table.
1437
1432
  """
1438
1433
  self.ui.datanameComboBox.blockSignals(True)
1439
- # Is also done in block load method
1440
- self._clear_state_before_block_load()
1441
1434
  if not filepath:
1442
1435
  filepath = Path(cif_file_open_dialog(last_dir=self.get_last_workdir()))
1443
1436
  if not filepath.is_file():
@@ -1463,7 +1456,11 @@ class AppWindow(QMainWindow):
1463
1456
  not_ok = e
1464
1457
  if not_ok:
1465
1458
  unable_to_open_message(self, filepath, not_ok)
1466
- return
1459
+ return None
1460
+ if not self.cif.is_valid_structure_cif:
1461
+ show_general_warning(self, "The CIF file you are about to open contains no structure.\n\n"
1462
+ "Use the Import button below to import metadata.")
1463
+ return None
1467
1464
  if not self.cif.chars_ok:
1468
1465
  self.warn_about_bad_cif()
1469
1466
  # Do this only when sure we can load the file:
@@ -1475,6 +1472,16 @@ class AppWindow(QMainWindow):
1475
1472
  self.ui.datanameComboBox.blockSignals(False)
1476
1473
  if self.cif.is_multi_cif:
1477
1474
  self._flash_block_combobox()
1475
+ # Enable to find widgets without parent:
1476
+ # QtCore.QTimer(self).singleShot(1000, self.find_widgets_without_parent)
1477
+
1478
+ def find_widgets_without_parent(self) -> None:
1479
+ print('Finding parents...')
1480
+ all_widgets = app.allWidgets()
1481
+ no_parent_widgets = [widget for widget in all_widgets if widget.parent is None]
1482
+ print(f"Found {len(no_parent_widgets)} widget(s) out of {len(all_widgets)} without parent:")
1483
+ for widget in no_parent_widgets:
1484
+ print(widget, widget.objectName())
1478
1485
 
1479
1486
  def _flash_block_combobox(self):
1480
1487
  orig_pal = self.ui.datanameComboBox.palette()
@@ -1566,6 +1573,11 @@ class AppWindow(QMainWindow):
1566
1573
  t = QtCore.QTimer(self)
1567
1574
  t.singleShot(1000, self.check_cecksums)
1568
1575
 
1576
+ def _delete_current_block(self, index):
1577
+ self.cif.delete_block(index)
1578
+ self.add_data_names_to_combobox()
1579
+ self.ui.datanameComboBox.setCurrentIndex(0)
1580
+
1569
1581
  def set_vertical_header_width(self):
1570
1582
  """
1571
1583
  Sets the width of the vertical header to the length of the longest string in the list.
@@ -1604,8 +1616,6 @@ class AppWindow(QMainWindow):
1604
1616
  self.ui.ShredCifButton.setDisabled(True)
1605
1617
 
1606
1618
  def append_cif(self, cif_file: Path):
1607
- self.cif.save()
1608
- self.load_cif_file(filepath=self.cif.finalcif_file, load_changes=False)
1609
1619
  if not cif_file:
1610
1620
  cif_file = self.get_file_from_dialog()
1611
1621
  if not cif_file:
@@ -1613,11 +1623,14 @@ class AppWindow(QMainWindow):
1613
1623
  cif2 = CifContainer(cif_file)
1614
1624
  if cif2.is_multi_cif:
1615
1625
  show_general_warning(self, 'Can add single data CIFs only!')
1626
+ return
1616
1627
  if cif2.block.name in [x.name for x in self.cif.doc]:
1617
1628
  show_general_warning(self, warn_text='Duplicate block',
1618
- info_text=f'Data block name "<b>{self.cif.block.name}</b>" '
1629
+ info_text=f'Data block name "<b>{cif2.block.name}</b>" '
1619
1630
  f'already present in current CIF!')
1620
1631
  return
1632
+ self.cif.save()
1633
+ self.load_cif_file(filepath=self.cif.finalcif_file, load_changes=False)
1621
1634
  self.cif.doc.add_copied_block(block=cif2.block, pos=-1)
1622
1635
  self.cif.save()
1623
1636
  self.load_cif_file(filepath=self.cif.fileobj, load_changes=False)
@@ -1808,11 +1821,11 @@ class AppWindow(QMainWindow):
1808
1821
  # Add the CCDC number in case we have a deposition mail lying around:
1809
1822
  self.add_ccdc_number()
1810
1823
  if self.cif.shx and self.cif.shx.abin and not self.cif['_platon_squeeze_void_probe_radius']:
1811
- show_general_warning(self, f"A SQUEEZE refinement was detected.\n"
1812
- f"Please import the "
1813
- f"corresponding .sqf file from PLATON and\n"
1814
- f"complete the _platon_squeeze_void_content information"
1815
- f"in the 'Platon SQUEEZE voids' loop.")
1824
+ show_general_warning(self, "A SQUEEZE refinement was detected.\n"
1825
+ "Please import the "
1826
+ "corresponding .sqf file from PLATON and\n"
1827
+ "complete the _platon_squeeze_void_content information"
1828
+ "in the 'Platon SQUEEZE voids' loop.")
1816
1829
  vheadlist = []
1817
1830
  for row_number in range(self.ui.cif_main_table.model().rowCount()):
1818
1831
  vheadlist.append(self.ui.cif_main_table.model().headerData(row_number, QtCore.Qt.Vertical))
@@ -20,7 +20,8 @@ from finalcif.cif.cif_order import order, special_keys
20
20
  from finalcif.cif.hkl import HKL, Limit
21
21
  from finalcif.cif.text import utf8_to_str, quote, retranslate_delimiter
22
22
  from finalcif.datafiles.utils import DSRFind
23
- from finalcif.tools.misc import essential_keys, non_centrosymm_keys, isnumeric, grouper, strip_finalcif_of_name
23
+ from finalcif.tools.misc import essential_keys, non_centrosymm_keys, isnumeric, grouper, strip_finalcif_of_name, \
24
+ _angstrom_to_x
24
25
 
25
26
 
26
27
  class GemmiError(Exception):
@@ -40,6 +41,7 @@ class CifContainer():
40
41
  new_block: Create a new block (new file) if a name is given. Otherwise, just
41
42
  the existing document is opened.
42
43
  """
44
+ self.picometer: bool = False
43
45
  self._hkl_file: str = ''
44
46
  self._abs_hkl_details: Dict[str, str] = {}
45
47
  if isinstance(file, str):
@@ -126,6 +128,10 @@ class CifContainer():
126
128
  self.current_block = self.block.name
127
129
  self._on_load()
128
130
 
131
+ def delete_block(self, index: int) -> None:
132
+ del self.doc[index]
133
+ self.block: gemmi.cif.Block = self.doc[0]
134
+
129
135
  def _on_load(self) -> None:
130
136
  # will not ok with non-ascii characters in the res file:
131
137
  self.chars_ok = True
@@ -142,6 +148,13 @@ class CifContainer():
142
148
  [x.upper() for x in self.block.find_loop('_atom_site_type_symbol')]))
143
149
  self.check_hkl_min_max()
144
150
 
151
+ @property
152
+ def is_valid_structure_cif(self):
153
+ """
154
+ Checkl wether this CIF contains a structure or just metadata.
155
+ """
156
+ return len(self.atomic_struct.sites) > 0 and self.cell.a
157
+
145
158
  @property
146
159
  def hkl_extra_info(self):
147
160
  if not self._abs_hkl_details:
@@ -661,10 +674,7 @@ class CifContainer():
661
674
  # Do not crash without symmops
662
675
  return False
663
676
  ops = gemmi.GroupOps([gemmi.Op(o) for o in self.symmops])
664
- try:
665
- return ops.is_centric()
666
- except AttributeError:
667
- return ops.is_centrosymmetric()
677
+ return ops.is_centrosymmetric()
668
678
 
669
679
  def atoms(self, without_h: bool = False) -> Generator:
670
680
  """
@@ -685,6 +695,8 @@ class CifContainer():
685
695
  u_eq):
686
696
  if without_h and self.ishydrogen(label):
687
697
  continue
698
+ if self.picometer:
699
+ u_eq = _angstrom_to_x(u_eq, factor=100 ** 2)
688
700
  # 0 1 2 3 4 5 6 7
689
701
  # yield label, type, x, y, z, part, occ, ueq
690
702
  yield atom(label=label, type=type, x=x, y=y, z=z, part=part, occ=occ, u_eq=u_eq)
@@ -717,6 +729,13 @@ class CifContainer():
717
729
  u12 = self.block.find_loop('_atom_site_aniso_U_12')
718
730
  adp = namedtuple('adp', ('label', 'U11', 'U22', 'U33', 'U23', 'U13', 'U12'))
719
731
  for label, u11, u22, u33, u23, u13, u12 in zip(labels, u11, u22, u33, u23, u13, u12):
732
+ if self.picometer:
733
+ u11 = _angstrom_to_x(u11, factor=100 ** 2)
734
+ u22 = _angstrom_to_x(u22, factor=100 ** 2)
735
+ u33 = _angstrom_to_x(u33, factor=100 ** 2)
736
+ u23 = _angstrom_to_x(u23, factor=100 ** 2)
737
+ u13 = _angstrom_to_x(u13, factor=100 ** 2)
738
+ u12 = _angstrom_to_x(u12, factor=100 ** 2)
720
739
  yield adp(label=label, U11=u11, U22=u22, U33=u33, U12=u12, U13=u13, U23=u23)
721
740
 
722
741
  @property
@@ -766,24 +785,29 @@ class CifContainer():
766
785
  publ_loop = self.block.find_loop('_geom_bond_publ_flag')
767
786
  bond = namedtuple('bond', ('label1', 'label2', 'dist', 'symm'))
768
787
  for label1, label2, dist, symm, publ in zip(label1, label2, dist, symm, publ_loop):
769
- if (without_h and (self.ishydrogen(label1) or self.ishydrogen(label2)) or self.yes_not_set(publ)):
788
+ if without_h and (self.ishydrogen(label1) or self.ishydrogen(label2)) or self.yes_not_set(publ):
770
789
  continue
771
790
  else:
791
+ if self.picometer:
792
+ dist = _angstrom_to_x(dist)
772
793
  yield bond(label1=label1, label2=label2, dist=dist, symm=self.checksymm(symm))
773
794
 
774
- def bond_dist(self, pair: str) -> Union[float, None]:
795
+ def bond_dist(self, pair: str) -> Union[str, None]:
775
796
  for p in self.bonds():
776
797
  if f'{p.label1}-{p.label2}' == pair:
777
- return p.dist
798
+ if self.picometer:
799
+ return _angstrom_to_x(p.dist)
800
+ else:
801
+ return p.dist
778
802
  return None
779
803
 
780
- def angle(self, atoms: str) -> Union[float, None]:
804
+ def angle(self, atoms: str) -> Union[str, None]:
781
805
  for p in self.angles():
782
806
  if f'{p.label1}-{p.label2}-{p.label3}' == atoms:
783
807
  return p.angle_val
784
808
  return None
785
809
 
786
- def torsion(self, atoms: str) -> Union[float, None]:
810
+ def torsion(self, atoms: str) -> Union[str, None]:
787
811
  for p in self.torsion_angles():
788
812
  if f'{p.label1}-{p.label2}-{p.label3}-{p.label4}' == atoms:
789
813
  return p.torsang
@@ -799,9 +823,9 @@ class CifContainer():
799
823
  publ_loop = self.block.find_loop('_geom_angle_publ_flag')
800
824
  angle = namedtuple('angle', ('label1', 'label2', 'label3', 'angle_val', 'symm1', 'symm2'))
801
825
  for label1, label2, label3, angle_val, symm1, symm2, publ in \
802
- zip(label1, label2, label3, angle_val, symm1, symm2, publ_loop):
826
+ zip(label1, label2, label3, angle_val, symm1, symm2, publ_loop):
803
827
  if (without_H and (self.ishydrogen(label1) or self.ishydrogen(label2) or
804
- self.ishydrogen(label3)) or (self.yes_not_set(publ))):
828
+ self.ishydrogen(label3)) or (self.yes_not_set(publ))):
805
829
  continue
806
830
  else:
807
831
  yield angle(label1=label1, label2=label2, label3=label3, angle_val=angle_val,
@@ -850,7 +874,7 @@ class CifContainer():
850
874
  symm3,
851
875
  symm4, publ_loop):
852
876
  if (without_h and (self.ishydrogen(label1) or self.ishydrogen(label2)
853
- or self.ishydrogen(label3) or self.ishydrogen(label3)) or self.yes_not_set(publ)):
877
+ or self.ishydrogen(label3) or self.ishydrogen(label3)) or self.yes_not_set(publ)):
854
878
  continue
855
879
  yield tors(label1=label1, label2=label2, label3=label3, label4=label4, torsang=torsang,
856
880
  symm1=self.checksymm(symm1),
@@ -871,9 +895,13 @@ class CifContainer():
871
895
  hydr = namedtuple('HydrogenBond', ('label_d', 'label_h', 'label_a', 'dist_dh', 'dist_ha', 'dist_da',
872
896
  'angle_dha', 'symm'))
873
897
  for label_d, label_h, label_a, dist_dh, dist_ha, dist_da, angle_dha, symm, publ in (
874
- zip(label_d, label_h, label_a, dist_dh, dist_ha, dist_da, angle_dha, symm, publ_loop)):
898
+ zip(label_d, label_h, label_a, dist_dh, dist_ha, dist_da, angle_dha, symm, publ_loop)):
875
899
  if self.yes_not_set(publ):
876
900
  continue
901
+ if self.picometer:
902
+ dist_dh = _angstrom_to_x(dist_dh)
903
+ dist_ha = _angstrom_to_x(dist_ha)
904
+ dist_da = _angstrom_to_x(dist_da)
877
905
  yield hydr(label_d, label_h, label_a, dist_dh, dist_ha, dist_da, angle_dha, self.checksymm(symm))
878
906
 
879
907
  def yes_not_set(self, publ: str):
@@ -104,7 +104,7 @@ class P4PFile():
104
104
  self.crystal_size = spline[1:4]
105
105
  try:
106
106
  # in Kelvin:
107
- self._temperature = float(spline[-1]) + 273.15
107
+ self._temperature = round(float(spline[-1]) + 273.15, 6)
108
108
  except ValueError:
109
109
  pass
110
110
 
@@ -0,0 +1,35 @@
1
+ from PyQt5 import QtWidgets, QtCore
2
+
3
+
4
+ class ComboBoxWithContextMenu(QtWidgets.QComboBox):
5
+ delete_signal = QtCore.pyqtSignal(int)
6
+
7
+ def __init__(self, parent=None):
8
+ super().__init__(parent)
9
+
10
+ def contextMenuEvent(self, event):
11
+ context_menu = QtWidgets.QMenu(self)
12
+ delete_action = context_menu.addAction(f"Delete block '{self.currentText()}'")
13
+ action = context_menu.exec_(self.mapToGlobal(event.pos()))
14
+ if action == delete_action and self.count() > 1:
15
+ self.delete_signal.emit(self.currentIndex())
16
+
17
+
18
+ def delete_block(index):
19
+ # For testing only
20
+ print(f"Block with index {index} was deleted.")
21
+
22
+
23
+ if __name__ == "__main__":
24
+ app = QtWidgets.QApplication([])
25
+ window = QtWidgets.QWidget()
26
+ layout = QtWidgets.QVBoxLayout(window)
27
+
28
+ combo_box = ComboBoxWithContextMenu()
29
+ combo_box.addItems(["Item 1", "Item 2", "Item 3"])
30
+ layout.addWidget(combo_box)
31
+
32
+ combo_box.delete_signal.connect(delete_block)
33
+
34
+ window.show()
35
+ app.exec_()
@@ -13,7 +13,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets
13
13
  class Ui_FinalCifWindow(object):
14
14
  def setupUi(self, FinalCifWindow):
15
15
  FinalCifWindow.setObjectName("FinalCifWindow")
16
- FinalCifWindow.resize(1596, 812)
16
+ FinalCifWindow.resize(1596, 860)
17
17
  self.Mainwidget = QtWidgets.QWidget(FinalCifWindow)
18
18
  self.Mainwidget.setObjectName("Mainwidget")
19
19
  self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.Mainwidget)
@@ -242,6 +242,9 @@ class Ui_FinalCifWindow(object):
242
242
  self.HAtomsCheckBox = QtWidgets.QCheckBox(self.groupBox_5)
243
243
  self.HAtomsCheckBox.setObjectName("HAtomsCheckBox")
244
244
  self.gridLayout_26.addWidget(self.HAtomsCheckBox, 1, 0, 1, 2)
245
+ self.UsePicometersCheckBox = QtWidgets.QCheckBox(self.groupBox_5)
246
+ self.UsePicometersCheckBox.setObjectName("UsePicometersCheckBox")
247
+ self.gridLayout_26.addWidget(self.UsePicometersCheckBox, 2, 1, 1, 1)
245
248
  self.verticalLayout_35.addLayout(self.gridLayout_26)
246
249
  self.groupBox_6 = QtWidgets.QGroupBox(self.groupBox_5)
247
250
  sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
@@ -551,7 +554,6 @@ class Ui_FinalCifWindow(object):
551
554
  font.setFamily("Courier New")
552
555
  font.setPointSize(11)
553
556
  font.setBold(True)
554
- font.setWeight(75)
555
557
  self.shelx_warn_TextEdit.setFont(font)
556
558
  self.shelx_warn_TextEdit.setUndoRedoEnabled(False)
557
559
  self.shelx_warn_TextEdit.setLineWrapMode(QtWidgets.QPlainTextEdit.NoWrap)
@@ -589,7 +591,6 @@ class Ui_FinalCifWindow(object):
589
591
  font = QtGui.QFont()
590
592
  font.setBold(False)
591
593
  font.setItalic(False)
592
- font.setWeight(50)
593
594
  self.wR2Label.setFont(font)
594
595
  self.wR2Label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
595
596
  self.wR2Label.setObjectName("wR2Label")
@@ -602,7 +603,6 @@ class Ui_FinalCifWindow(object):
602
603
  font = QtGui.QFont()
603
604
  font.setBold(False)
604
605
  font.setItalic(False)
605
- font.setWeight(50)
606
606
  self.r1Label.setFont(font)
607
607
  self.r1Label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
608
608
  self.r1Label.setObjectName("r1Label")
@@ -630,7 +630,6 @@ class Ui_FinalCifWindow(object):
630
630
  self.completeLabel = QtWidgets.QLabel(self.groupBox_3)
631
631
  font = QtGui.QFont()
632
632
  font.setBold(False)
633
- font.setWeight(50)
634
633
  self.completeLabel.setFont(font)
635
634
  self.completeLabel.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
636
635
  self.completeLabel.setObjectName("completeLabel")
@@ -678,7 +677,6 @@ class Ui_FinalCifWindow(object):
678
677
  self.dataReflnsLabel = QtWidgets.QLabel(self.groupBox_3)
679
678
  font = QtGui.QFont()
680
679
  font.setBold(False)
681
- font.setWeight(50)
682
680
  self.dataReflnsLabel.setFont(font)
683
681
  self.dataReflnsLabel.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
684
682
  self.dataReflnsLabel.setObjectName("dataReflnsLabel")
@@ -745,7 +743,6 @@ class Ui_FinalCifWindow(object):
745
743
  self.rintLabel = QtWidgets.QLabel(self.groupBox_3)
746
744
  font = QtGui.QFont()
747
745
  font.setBold(False)
748
- font.setWeight(50)
749
746
  self.rintLabel.setFont(font)
750
747
  self.rintLabel.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
751
748
  self.rintLabel.setObjectName("rintLabel")
@@ -757,7 +754,6 @@ class Ui_FinalCifWindow(object):
757
754
  self.rsigmaLabel = QtWidgets.QLabel(self.groupBox_3)
758
755
  font = QtGui.QFont()
759
756
  font.setBold(False)
760
- font.setWeight(50)
761
757
  self.rsigmaLabel.setFont(font)
762
758
  self.rsigmaLabel.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
763
759
  self.rsigmaLabel.setObjectName("rsigmaLabel")
@@ -793,7 +789,6 @@ class Ui_FinalCifWindow(object):
793
789
  self.dLabel = QtWidgets.QLabel(self.groupBox_3)
794
790
  font = QtGui.QFont()
795
791
  font.setBold(False)
796
- font.setWeight(50)
797
792
  self.dLabel.setFont(font)
798
793
  self.dLabel.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
799
794
  self.dLabel.setObjectName("dLabel")
@@ -1741,7 +1736,7 @@ class Ui_FinalCifWindow(object):
1741
1736
  self.verticalLayout_33.setObjectName("verticalLayout_33")
1742
1737
  self.MainStackedWidget.addWidget(self.page_textTemplate)
1743
1738
  self.gridLayout_6.addWidget(self.MainStackedWidget, 2, 0, 1, 13)
1744
- self.datanameComboBox = QtWidgets.QComboBox(self.CifDataItemsFrame)
1739
+ self.datanameComboBox = ComboBoxWithContextMenu(self.CifDataItemsFrame)
1745
1740
  self.datanameComboBox.setEditable(True)
1746
1741
  self.datanameComboBox.setMaxVisibleItems(20)
1747
1742
  self.datanameComboBox.setInsertPolicy(QtWidgets.QComboBox.InsertAtCurrent)
@@ -1971,7 +1966,7 @@ class Ui_FinalCifWindow(object):
1971
1966
  self.EquipmentTemplatesListWidget.setToolTip(_translate("FinalCifWindow", "<html><head/><body><p>Each entry can have a list of key/value pairs. For example a Diffractometer model can have a list of features.</p></body></html>"))
1972
1967
  self.NewEquipmentTemplateButton.setText(_translate("FinalCifWindow", "New Template"))
1973
1968
  self.EditEquipmentTemplateButton.setText(_translate("FinalCifWindow", "Edit Template"))
1974
- self.ImportEquipmentTemplateButton.setText(_translate("FinalCifWindow", "Import"))
1969
+ self.ImportEquipmentTemplateButton.setText(_translate("FinalCifWindow", "Import Template"))
1975
1970
  self.EquipmentEditTableWidget.setSortingEnabled(True)
1976
1971
  item = self.EquipmentEditTableWidget.horizontalHeaderItem(0)
1977
1972
  item.setText(_translate("FinalCifWindow", "key"))
@@ -1987,6 +1982,7 @@ class Ui_FinalCifWindow(object):
1987
1982
  self.ReportTextCheckBox.setText(_translate("FinalCifWindow", "No report text in structure report"))
1988
1983
  self.PictureWidthLabel.setText(_translate("FinalCifWindow", "Picture width [cm]"))
1989
1984
  self.HAtomsCheckBox.setText(_translate("FinalCifWindow", "No bonds and angles to hydrogen atoms"))
1985
+ self.UsePicometersCheckBox.setText(_translate("FinalCifWindow", "Use picometers"))
1990
1986
  self.groupBox_6.setTitle(_translate("FinalCifWindow", "Report Templates:"))
1991
1987
  __sortingEnabled = self.docxTemplatesListWidget.isSortingEnabled()
1992
1988
  self.docxTemplatesListWidget.setSortingEnabled(False)
@@ -2181,6 +2177,7 @@ class Ui_FinalCifWindow(object):
2181
2177
  self.SumFormMainLabel.setText(_translate("FinalCifWindow", "Sum Formula"))
2182
2178
  self.appendCifPushButton.setText(_translate("FinalCifWindow", "Append CIF"))
2183
2179
  from finalcif.displaymol.molecule2D import MoleculeWidget
2180
+ from finalcif.gui.block_combobox import ComboBoxWithContextMenu
2184
2181
  from finalcif.gui.custom_classes import MyCifTable
2185
2182
  from finalcif.gui.equipmenttable import MyEQTableWidget
2186
2183
  from finalcif.gui.file_editor import QCodeEditor
@@ -8,7 +8,7 @@
8
8
  <x>0</x>
9
9
  <y>0</y>
10
10
  <width>1596</width>
11
- <height>812</height>
11
+ <height>860</height>
12
12
  </rect>
13
13
  </property>
14
14
  <property name="windowTitle">
@@ -282,7 +282,7 @@
282
282
  <item>
283
283
  <widget class="QPushButton" name="ImportEquipmentTemplateButton">
284
284
  <property name="text">
285
- <string>Import</string>
285
+ <string>Import Template</string>
286
286
  </property>
287
287
  </widget>
288
288
  </item>
@@ -554,6 +554,13 @@
554
554
  </property>
555
555
  </widget>
556
556
  </item>
557
+ <item row="2" column="1">
558
+ <widget class="QCheckBox" name="UsePicometersCheckBox">
559
+ <property name="text">
560
+ <string>Use picometers</string>
561
+ </property>
562
+ </widget>
563
+ </item>
557
564
  </layout>
558
565
  </item>
559
566
  <item>
@@ -1357,7 +1364,6 @@
1357
1364
  <font>
1358
1365
  <family>Courier New</family>
1359
1366
  <pointsize>11</pointsize>
1360
- <weight>75</weight>
1361
1367
  <bold>true</bold>
1362
1368
  </font>
1363
1369
  </property>
@@ -1424,7 +1430,6 @@
1424
1430
  <widget class="QLabel" name="wR2Label">
1425
1431
  <property name="font">
1426
1432
  <font>
1427
- <weight>50</weight>
1428
1433
  <italic>false</italic>
1429
1434
  <bold>false</bold>
1430
1435
  </font>
@@ -1448,7 +1453,6 @@
1448
1453
  <widget class="QLabel" name="r1Label">
1449
1454
  <property name="font">
1450
1455
  <font>
1451
- <weight>50</weight>
1452
1456
  <italic>false</italic>
1453
1457
  <bold>false</bold>
1454
1458
  </font>
@@ -1506,7 +1510,6 @@
1506
1510
  <widget class="QLabel" name="completeLabel">
1507
1511
  <property name="font">
1508
1512
  <font>
1509
- <weight>50</weight>
1510
1513
  <bold>false</bold>
1511
1514
  </font>
1512
1515
  </property>
@@ -1622,7 +1625,6 @@
1622
1625
  <widget class="QLabel" name="dataReflnsLabel">
1623
1626
  <property name="font">
1624
1627
  <font>
1625
- <weight>50</weight>
1626
1628
  <bold>false</bold>
1627
1629
  </font>
1628
1630
  </property>
@@ -1770,7 +1772,6 @@
1770
1772
  <widget class="QLabel" name="rintLabel">
1771
1773
  <property name="font">
1772
1774
  <font>
1773
- <weight>50</weight>
1774
1775
  <bold>false</bold>
1775
1776
  </font>
1776
1777
  </property>
@@ -1793,7 +1794,6 @@
1793
1794
  <widget class="QLabel" name="rsigmaLabel">
1794
1795
  <property name="font">
1795
1796
  <font>
1796
- <weight>50</weight>
1797
1797
  <bold>false</bold>
1798
1798
  </font>
1799
1799
  </property>
@@ -1867,7 +1867,6 @@
1867
1867
  <widget class="QLabel" name="dLabel">
1868
1868
  <property name="font">
1869
1869
  <font>
1870
- <weight>50</weight>
1871
1870
  <bold>false</bold>
1872
1871
  </font>
1873
1872
  </property>
@@ -4082,7 +4081,7 @@ please add a publication author:</string>
4082
4081
  </widget>
4083
4082
  </item>
4084
4083
  <item row="0" column="1">
4085
- <widget class="QComboBox" name="datanameComboBox">
4084
+ <widget class="ComboBoxWithContextMenu" name="datanameComboBox">
4086
4085
  <property name="editable">
4087
4086
  <bool>true</bool>
4088
4087
  </property>
@@ -4294,6 +4293,11 @@ please add a publication author:</string>
4294
4293
  <extends>QPlainTextEdit</extends>
4295
4294
  <header>finalcif.gui.file_editor.h</header>
4296
4295
  </customwidget>
4296
+ <customwidget>
4297
+ <class>ComboBoxWithContextMenu</class>
4298
+ <extends>QComboBox</extends>
4299
+ <header>finalcif.gui.block_combobox.h</header>
4300
+ </customwidget>
4297
4301
  </customwidgets>
4298
4302
  <tabstops>
4299
4303
  <tabstop>publishedDepositionRadioButton</tabstop>
@@ -121,7 +121,6 @@ class ReferenceList():
121
121
  paragraph_reflist = document.add_paragraph('', template)
122
122
  paragraph_reflist.add_run(f'[{str(num)}] \t')
123
123
  ref.add_reference(paragraph_reflist)
124
- # paragraph_reflist.add_run('\n')
125
124
 
126
125
  def __repr__(self):
127
126
  return '\n'.join([f'[{num}] {x}' for num, x in enumerate(self._references)])