Skip to content

Commit

Permalink
Revert "Trying without QTimer"
Browse files Browse the repository at this point in the history
This reverts commit 5b8ee22.
  • Loading branch information
dkratzert committed Sep 21, 2023
1 parent 5b8ee22 commit 7db6f02
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions finalcif/appwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ def resizeEvent(self, a0: QtGui.QResizeEvent) -> None:
if left_frame <= 300:
left_frame = 300
self.ui.LeftFrame.setMinimumWidth(int(left_frame))
#QtCore.QTimer(self).singleShot(0, self.ui.cif_main_table.resizeRowsToContents)
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."""
Expand Down Expand Up @@ -1463,8 +1463,7 @@ def load_cif_file(self, filepath: Path, block=0, load_changes: bool = True) -> N
self.ui.datanameComboBox.blockSignals(False)
if self.cif.is_multi_cif:
# short after start, because window size is not finished
#QtCore.QTimer(self).singleShot(1000, self.ui.datanameComboBox.showPopup)
pass
QtCore.QTimer(self).singleShot(1000, self.ui.datanameComboBox.showPopup)

def add_data_names_to_combobox(self) -> None:
self.ui.datanameComboBox.clear()
Expand Down Expand Up @@ -1697,8 +1696,7 @@ def show_residuals(self) -> None:
if self.cif.res_file_data:
self.ui.shelx_TextEdit.setPlainText(cif.as_string(self.cif.res_file_data))
try:
#QtCore.QTimer(self).singleShot(0, self.view_molecule)
pass
QtCore.QTimer(self).singleShot(0, self.view_molecule)
except Exception:
print('Molecule view crashed!')

Expand Down Expand Up @@ -1846,7 +1844,7 @@ def fill_cif_table(self) -> None:
txt = 'FinalCif V{} by Daniel Kratzert, Freiburg {}, https://dkratzert.de/finalcif.html'
strval = txt.format(VERSION, datetime.now().year)
self.ui.cif_main_table.setText(key=key, column=Column.DATA, txt=strval)
#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()
Expand Down
2 changes: 1 addition & 1 deletion finalcif/equip_property/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def check_for_duplicates(self):
self.lb.setText(f'key {key} already exists')
self.lb.move(self.app.ui.cifKeywordLineEdit.mapToGlobal(QtCore.QPoint(15, 25)))
self.lb.show()
#QtCore.QTimer(self).singleShot(4000, self.lb.hide)
QtCore.QTimer(self).singleShot(4000, self.lb.hide)
else:
self.app.ui.SavePropertiesButton.setEnabled(True)
self.lb.hide()
Expand Down
2 changes: 1 addition & 1 deletion finalcif/tools/platon.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def run_process(self):
self.Z = ''
self.process = QtCore.QProcess()
self.output_widget.clear()
#QtCore.QTimer(self).singleShot(100, self._monitor_output_log)
QtCore.QTimer(self).singleShot(100, self._monitor_output_log)
# self.process.readyReadStandardOutput.connect(self.on_ready_read)
self.process.finished.connect(self._onfinished)
self.process.setWorkingDirectory(str(self.cif_file.parent))
Expand Down

0 comments on commit 7db6f02

Please sign in to comment.