Source code for cosedaUI.mainwindow_sections.imports
from cosedaUI.importers import ImportEMDWindow
from cosedaUI.importers import ImportH5Window
from cosedaUI.importers import ImportMRCWindow
from cosedaUI.importers import ImportTiffWindow
[docs]
class ImportMixin:
[docs]
def open_import_tiff_window(self):
# Prevent multiple instances
if hasattr(self, 'import_tiff_window') and self.import_tiff_window.isVisible():
self.import_tiff_window.raise_()
self.import_tiff_window.activateWindow()
else:
self.import_tiff_window = ImportTiffWindow(parent=self)
self.import_tiff_window.show()
[docs]
def open_import_mrc_window(self):
# Prevent multiple instances
if hasattr(self, 'import_mrc_window') and self.import_mrc_window.isVisible():
self.import_mrc_window.raise_()
self.import_mrc_window.activateWindow()
else:
self.import_mrc_window = ImportMRCWindow(parent=self)
self.import_mrc_window.show()
[docs]
def open_import_emd_window(self):
self.import_emd_window = ImportEMDWindow(parent=self)
self.import_emd_window.show()
[docs]
def open_import_h5_window(self):
# Prevent multiple instances
if hasattr(self, 'import_h5_window') and self.import_h5_window.isVisible():
self.import_h5_window.raise_()
self.import_h5_window.activateWindow()
else:
self.import_h5_window = ImportH5Window(parent=self)
self.import_h5_window.show()