def __init__(self, name, session, nrg_fr, thermo_co, size, *args, **kwargs): super().__init__(*args, **kwargs) self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.session = session self.nrg_fr = nrg_fr self.thermo_co = thermo_co layout = QGridLayout(self) layout.setContentsMargins(0, 0, 0, 0) layout.setRowStretch(0, 1) frame = QGroupBox(name) frame.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) frame_layout = QGridLayout(frame) frame_layout.setContentsMargins(0, 0, 0, 0) frame_layout.setRowStretch(0, 1) self.tree = QTreeWidget() self.tree.setColumnCount(3) self.tree.setHeaderLabels(["energy", "frequencies", "remove"]) self.tree.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.tree.setColumnWidth(0, size[0]) self.tree.setColumnWidth(1, size[1]) self.tree.resizeColumnToContents(2) root_item = self.tree.invisibleRootItem() plus = QTreeWidgetItem(root_item) plus_button = QPushButton("add molecule") plus_button.setFlat(True) plus_button.clicked.connect(self.add_mol_group) plus_button2 = QPushButton("") plus_button2.setFlat(True) plus_button2.clicked.connect(self.add_mol_group) self.tree.setItemWidget(plus, 0, plus_button) self.tree.setItemWidget(plus, 1, plus_button2) self.tree.insertTopLevelItem(1, plus) self.add_mol_group() frame_layout.addWidget(self.tree) layout.addWidget(frame)
def _build_ui(self): #each group has an empty widget at the bottom so they resize the way I want while also having the #labels where I want them layout = QGridLayout() self.tab_widget = QTabWidget() layout.addWidget(self.tab_widget) #layout for absolute thermo stuff absolute_widget = QWidget() absolute_layout = QGridLayout(absolute_widget) #box for sp sp_area_widget = QGroupBox("Single-point") sp_layout = QFormLayout(sp_area_widget) self.sp_selector = FilereaderComboBox(self.session, otherItems=['energy']) self.sp_selector.currentIndexChanged.connect(self.set_sp) sp_layout.addRow(self.sp_selector) self.sp_table = QTableWidget() self.sp_table.setColumnCount(3) self.sp_table.setShowGrid(False) self.sp_table.horizontalHeader().hide() self.sp_table.verticalHeader().hide() self.sp_table.setFrameShape(QTableWidget.NoFrame) self.sp_table.setSelectionMode(QTableWidget.NoSelection) self.sp_table.insertRow(0) sp_layout.addRow(self.sp_table) #box for thermo therm_area_widget = QGroupBox("Thermal corrections") thermo_layout = QFormLayout(therm_area_widget) self.thermo_selector = FilereaderComboBox(self.session, otherItems=['frequency']) self.thermo_selector.currentIndexChanged.connect(self.set_thermo_mdl) thermo_layout.addRow(self.thermo_selector) self.temperature_line = QDoubleSpinBox() self.temperature_line.setMaximum(2**31 - 1) self.temperature_line.setValue(298.15) self.temperature_line.setSingleStep(10) self.temperature_line.setSuffix(" K") self.temperature_line.setMinimum(0) self.temperature_line.valueChanged.connect(self.set_thermo) thermo_layout.addRow("T =", self.temperature_line) self.v0_edit = QDoubleSpinBox() self.v0_edit.setMaximum(4000) self.v0_edit.setValue(self.settings.w0) self.v0_edit.setSingleStep(25) self.v0_edit.setSuffix(" cm\u207b\u00b9") self.v0_edit.valueChanged.connect(self.set_thermo) self.v0_edit.setMinimum(0) self.v0_edit.setToolTip( "frequency parameter for quasi treatments of entropy") thermo_layout.addRow("𝜔<sub>0</sub> =", self.v0_edit) self.thermo_table = QTableWidget() self.thermo_table.setColumnCount(3) self.thermo_table.setShowGrid(False) self.thermo_table.horizontalHeader().hide() self.thermo_table.verticalHeader().hide() self.thermo_table.setFrameShape(QTableWidget.NoFrame) self.thermo_table.setSelectionMode(QTableWidget.NoSelection) thermo_layout.addRow(self.thermo_table) # for for total sum_area_widget = QGroupBox("Thermochemistry") sum_layout = QFormLayout(sum_area_widget) self.sum_table = QTableWidget() self.sum_table.setColumnCount(3) self.sum_table.setShowGrid(False) self.sum_table.horizontalHeader().hide() self.sum_table.verticalHeader().hide() self.sum_table.setFrameShape(QTableWidget.NoFrame) self.sum_table.setSelectionMode(QTableWidget.NoSelection) sum_layout.addRow(self.sum_table) splitter = QSplitter(Qt.Horizontal) splitter.setChildrenCollapsible(False) splitter.addWidget(sp_area_widget) splitter.addWidget(therm_area_widget) splitter.addWidget(sum_area_widget) absolute_layout.addWidget(splitter) self.status = QStatusBar() self.status.setSizeGripEnabled(False) self.status.setStyleSheet("color: red") absolute_layout.addWidget(self.status, 1, 0, 1, 1, Qt.AlignTop) self.tab_widget.addTab(absolute_widget, "absolute") relative_widget = QWidget() relative_layout = QGridLayout(relative_widget) size = [self.settings.ref_col_1, self.settings.ref_col_2] self.ref_group = ThermoGroup("reference group", self.session, self.nrg_fr, self.thermo_co, size) self.ref_group.changes.connect(self.calc_relative_thermo) relative_layout.addWidget(self.ref_group, 0, 0, 1, 3, Qt.AlignTop) size = [self.settings.other_col_1, self.settings.other_col_2] self.other_group = ThermoGroup("other group", self.session, self.nrg_fr, self.thermo_co, size) self.other_group.changes.connect(self.calc_relative_thermo) relative_layout.addWidget(self.other_group, 0, 3, 1, 3, Qt.AlignTop) self.relative_temperature = QDoubleSpinBox() self.relative_temperature.setMaximum(2**31 - 1) self.relative_temperature.setValue(self.settings.rel_temp) self.relative_temperature.setSingleStep(10) self.relative_temperature.setSuffix(" K") self.relative_temperature.setMinimum(0) self.relative_temperature.valueChanged.connect( self.calc_relative_thermo) relative_layout.addWidget(QLabel("T ="), 1, 0, 1, 1, Qt.AlignRight | Qt.AlignVCenter) relative_layout.addWidget(self.relative_temperature, 1, 1, 1, 5, Qt.AlignLeft | Qt.AlignVCenter) self.relative_v0 = QDoubleSpinBox() self.relative_v0.setMaximum(2**31 - 1) self.relative_v0.setValue(self.settings.w0) self.relative_v0.setSingleStep(25) self.relative_v0.setSuffix(" cm\u207b\u00b9") self.relative_v0.setMinimum(0) self.relative_v0.setToolTip( "frequency parameter for quasi treatments of entropy") self.relative_v0.valueChanged.connect(self.calc_relative_thermo) relative_layout.addWidget(QLabel("𝜔<sub>0</sub> ="), 2, 0, 1, 1, Qt.AlignRight | Qt.AlignVCenter) relative_layout.addWidget(self.relative_v0, 2, 1, 1, 5, Qt.AlignLeft | Qt.AlignVCenter) relative_layout.addWidget( QLabel("Boltzmann-weighted relative energies in kcal/mol:"), 3, 0, 1, 6, Qt.AlignVCenter | Qt.AlignLeft) self.relative_table = QTextBrowser() self.relative_table.setMaximumHeight( 4 * self.relative_table.fontMetrics().boundingRect("Q").height()) relative_layout.addWidget(self.relative_table, 4, 0, 1, 6, Qt.AlignTop) relative_layout.setRowStretch(0, 1) relative_layout.setRowStretch(1, 0) relative_layout.setRowStretch(2, 0) relative_layout.setRowStretch(3, 0) relative_layout.setRowStretch(4, 0) self.tab_widget.addTab(relative_widget, "relative") #menu stuff menu = QMenuBar() export = menu.addMenu("&Export") copy = QAction("&Copy CSV to clipboard", self.tool_window.ui_area) copy.triggered.connect(self.copy_csv) shortcut = QKeySequence(Qt.CTRL + Qt.Key_C) copy.setShortcut(shortcut) export.addAction(copy) self.copy = copy save = QAction("&Save CSV...", self.tool_window.ui_area) save.triggered.connect(self.save_csv) #this shortcut interferes with main window's save shortcut #I've tried different shortcut contexts to no avail #thanks Qt... #shortcut = QKeySequence(Qt.CTRL + Qt.Key_S) #save.setShortcut(shortcut) #save.setShortcutContext(Qt.WidgetShortcut) export.addAction(save) delimiter = export.addMenu("Delimiter") comma = QAction("comma", self.tool_window.ui_area, checkable=True) comma.setChecked(self.settings.delimiter == "comma") comma.triggered.connect(lambda *args, delim="comma": self.settings. __setattr__("delimiter", delim)) delimiter.addAction(comma) tab = QAction("tab", self.tool_window.ui_area, checkable=True) tab.setChecked(self.settings.delimiter == "tab") tab.triggered.connect(lambda *args, delim="tab": self.settings. __setattr__("delimiter", delim)) delimiter.addAction(tab) space = QAction("space", self.tool_window.ui_area, checkable=True) space.setChecked(self.settings.delimiter == "space") space.triggered.connect(lambda *args, delim="space": self.settings. __setattr__("delimiter", delim)) delimiter.addAction(space) semicolon = QAction("semicolon", self.tool_window.ui_area, checkable=True) semicolon.setChecked(self.settings.delimiter == "semicolon") semicolon.triggered.connect(lambda *args, delim="semicolon": self. settings.__setattr__("delimiter", delim)) delimiter.addAction(semicolon) add_header = QAction("&Include CSV header", self.tool_window.ui_area, checkable=True) add_header.setChecked(self.settings.include_header) add_header.triggered.connect(self.header_check) export.addAction(add_header) comma.triggered.connect( lambda *args, action=tab: action.setChecked(False)) comma.triggered.connect( lambda *args, action=space: action.setChecked(False)) comma.triggered.connect( lambda *args, action=semicolon: action.setChecked(False)) tab.triggered.connect( lambda *args, action=comma: action.setChecked(False)) tab.triggered.connect( lambda *args, action=space: action.setChecked(False)) tab.triggered.connect( lambda *args, action=semicolon: action.setChecked(False)) space.triggered.connect( lambda *args, action=comma: action.setChecked(False)) space.triggered.connect( lambda *args, action=tab: action.setChecked(False)) space.triggered.connect( lambda *args, action=semicolon: action.setChecked(False)) semicolon.triggered.connect( lambda *args, action=comma: action.setChecked(False)) semicolon.triggered.connect( lambda *args, action=tab: action.setChecked(False)) semicolon.triggered.connect( lambda *args, action=space: action.setChecked(False)) menu.setNativeMenuBar(False) self._menu = menu layout.setMenuBar(menu) menu.setVisible(True) self.tool_window.ui_area.setLayout(layout) self.tool_window.manage(None)
def _build_ui(self): layout = QGridLayout() layout.addWidget(QLabel("center of rotation:"), 0, 0, 1, 1, Qt.AlignLeft | Qt.AlignVCenter) self.cor_button = QComboBox() self.cor_button.addItems( ["automatic", "select atoms", "view's center of rotation"]) layout.addWidget(self.cor_button, 0, 1, 1, 1, Qt.AlignTop) self.set_cor_selection = QPushButton("set selection") self.cor_button.currentTextChanged.connect( lambda t, widget=self.set_cor_selection: widget.setEnabled( t == "select atoms")) self.set_cor_selection.clicked.connect(self.manual_cor) layout.addWidget(self.set_cor_selection, 0, 2, 1, 1, Qt.AlignTop) self.set_cor_selection.setEnabled(False) layout.addWidget(QLabel("rotation vector:"), 1, 0, 1, 1, Qt.AlignLeft | Qt.AlignVCenter) self.vector_option = QComboBox() self.vector_option.addItems([ "axis", "view axis", "bond", "perpendicular to plane", "centroid of atoms", "custom" ]) layout.addWidget(self.vector_option, 1, 1, 1, 1, Qt.AlignVCenter) vector = QWidget() vector.setToolTip("vector will be normalized before rotating") vector_layout = QHBoxLayout(vector) vector_layout.setContentsMargins(0, 0, 0, 0) self.vector_x = QDoubleSpinBox() self.vector_y = QDoubleSpinBox() self.vector_z = QDoubleSpinBox() self.vector_z.setValue(1.0) for c, t in zip([self.vector_x, self.vector_y, self.vector_z], [" x", " y", " z"]): c.setSingleStep(0.01) c.setRange(-100, 100) # c.setSuffix(t) c.valueChanged.connect(self.show_rot_vec) vector_layout.addWidget(c) layout.addWidget(vector, 1, 2, 1, 1, Qt.AlignTop) vector.setVisible(self.vector_option.currentText() == "custom") self.vector_option.currentTextChanged.connect( lambda text, widget=vector: widget.setVisible(text == "custom")) self.view_axis = QComboBox() self.view_axis.addItems(["z", "y", "x"]) layout.addWidget(self.view_axis, 1, 2, 1, 1, Qt.AlignTop) self.view_axis.setVisible( self.vector_option.currentText() == "view axis") self.vector_option.currentTextChanged.connect( lambda text, widget=self.view_axis: widget.setVisible(text == "view axis")) self.axis = QComboBox() self.axis.addItems(["z", "y", "x"]) layout.addWidget(self.axis, 1, 2, 1, 1, Qt.AlignTop) self.axis.setVisible(self.vector_option.currentText() == "axis") self.vector_option.currentTextChanged.connect( lambda text, widget=self.axis: widget.setVisible(text == "axis")) self.bond_button = QPushButton("set selected bond") self.bond_button.clicked.connect(self.set_bonds) layout.addWidget(self.bond_button, 1, 2, 1, 1, Qt.AlignTop) self.bond_button.setVisible(self.vector_option.currentText() == "bond") self.vector_option.currentTextChanged.connect( lambda text, widget=self.bond_button: widget.setVisible(text == "bond")) self.perp_button = QPushButton("set selected atoms") self.perp_button.clicked.connect(self.set_perpendicular) layout.addWidget(self.perp_button, 1, 2, 1, 1, Qt.AlignTop) self.perp_button.setVisible( self.vector_option.currentText() == "perpendicular to plane") self.vector_option.currentTextChanged.connect( lambda text, widget=self.perp_button: widget.setVisible( text == "perpendicular to plane")) self.group_button = QPushButton("set selected atoms") self.group_button.clicked.connect(self.set_group) layout.addWidget(self.group_button, 1, 2, 1, 1, Qt.AlignTop) self.group_button.setVisible( self.vector_option.currentText() == "centroid of atoms") self.vector_option.currentTextChanged.connect( lambda text, widget=self.group_button: widget.setVisible( text == "centroid of atoms")) layout.addWidget(QLabel("angle:"), 2, 0, 1, 1, Qt.AlignLeft | Qt.AlignVCenter) self.angle = QDoubleSpinBox() self.angle.setRange(-360, 360) self.angle.setSingleStep(5) self.angle.setSuffix("°") layout.addWidget(self.angle, 2, 1, 1, 1, Qt.AlignLeft | Qt.AlignVCenter) layout.addWidget(QLabel("preview rotation axis:"), 3, 0, 1, 1, Qt.AlignLeft | Qt.AlignVCenter) self.display_rot_vec = QCheckBox() self.display_rot_vec.setCheckState(Qt.Checked) self.display_rot_vec.stateChanged.connect(self.show_rot_vec) layout.addWidget(self.display_rot_vec, 3, 1, 1, 1, Qt.AlignLeft | Qt.AlignVCenter) rotate_button = QPushButton("rotate selected atoms") rotate_button.clicked.connect(self.do_rotate) layout.addWidget(rotate_button, 4, 0, 1, 3, Qt.AlignTop) self.rotate_button = rotate_button self.status_bar = QStatusBar() self.status_bar.setSizeGripEnabled(False) layout.addWidget(self.status_bar, 5, 0, 1, 3, Qt.AlignTop) self.vector_option.currentTextChanged.connect(self.show_auto_status) self.cor_button.currentIndexChanged.connect( lambda *args: self.show_auto_status("select atoms")) self.cor_button.currentIndexChanged.connect(self.show_rot_vec) self.set_cor_selection.clicked.connect(self.show_rot_vec) self.vector_option.currentIndexChanged.connect(self.show_rot_vec) self.axis.currentIndexChanged.connect(self.show_rot_vec) self.view_axis.currentIndexChanged.connect(self.show_rot_vec) self.bond_button.clicked.connect(self.show_rot_vec) self.perp_button.clicked.connect(self.show_rot_vec) self.group_button.clicked.connect(self.show_rot_vec) layout.setRowStretch(0, 0) layout.setRowStretch(1, 0) layout.setRowStretch(2, 0) layout.setRowStretch(3, 0) layout.setRowStretch(4, 0) layout.setRowStretch(5, 1) layout.setColumnStretch(0, 0) layout.setColumnStretch(1, 1) layout.setColumnStretch(2, 1) self.tool_window.ui_area.setLayout(layout) self.tool_window.manage(None)
def _build_ui(self): layout = QGridLayout() layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(0) self.tree = QTreeWidget() self.tree.setSelectionMode(QTreeWidget.ExtendedSelection) self.tree.setHeaderLabels([ "name", "status", "server", "prioritize", "kill", "delete", "browse" ]) self.tree.setUniformRowHeights(True) self.tree.setColumnWidth(0, 150) layout.addWidget(self.tree, 0, 0, 6, 1, Qt.AlignTop) row = 0 pause_button = QPushButton( "pause new jobs" if not self.session.seqcrow_job_manager.paused else "resume jobs") pause_button.setCheckable(True) pause_button.clicked.connect(lambda check: pause_button.setText( "pause new jobs" if not check else "resume jobs")) pause_button.setChecked(self.session.seqcrow_job_manager.paused) pause_button.clicked.connect(self.pause_queue) layout.addWidget(pause_button, row, 1, 1, 1, Qt.AlignTop) row += 1 open_button = QPushButton("open structure") open_button.clicked.connect(self.open_jobs) layout.addWidget(open_button, row, 1, 1, 1, Qt.AlignTop) row += 1 log_button = QPushButton("log") log_button.clicked.connect(self.open_log) layout.addWidget(log_button, row, 1, 1, 1, Qt.AlignTop) row += 1 output_button = QPushButton("raw output") output_button.clicked.connect(self.open_output) layout.addWidget(output_button, row, 1, 1, 1, Qt.AlignTop) row += 1 refresh_button = QToolButton() refresh_button.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.MinimumExpanding) refresh_button.setToolButtonStyle(Qt.ToolButtonTextBesideIcon) refresh_button.setIcon( QIcon(refresh_button.style().standardIcon( QStyle.SP_BrowserReload))) refresh_button.setText('check jobs') refresh_button.clicked.connect( lambda *args: self.session.seqcrow_job_manager.triggers. activate_trigger(JOB_QUEUED, "refresh")) layout.addWidget(refresh_button, row, 1, 1, 1, Qt.AlignTop) row += 1 for i in range(0, row - 1): layout.setRowStretch(i, 0) layout.setRowStretch(row - 1, 1) layout.setColumnStretch(0, 1) layout.setColumnStretch(1, 0) self.tool_window.ui_area.setLayout(layout) self.tool_window.manage(None)
def __init__(self, *args, initial_elements=[], select_multiple=True, **kwargs): super().__init__(*args, **kwargs) layout = QGridLayout(self) layout.setContentsMargins(0, 0, 0, 0) self._elements = {ele: ElementButton(ele) for ele in ELEMENTS if not any(ele == x for x in ['Bq', 'X'])} for ele in self._elements.keys(): self._elements[ele].setTristate(False) if select_multiple: self._elements[ele].stateChanged.connect(lambda state, ele=ele: self.elementSelectionChanged.emit()) else: self._elements[ele].stateChanged.connect(lambda state, ele=ele: self._single_ele_clicked(state, ele)) elements_widget = QWidget() elements_layout = QGridLayout(elements_widget) elements_layout.setContentsMargins(0, 0, 0, 0) elements_layout.addWidget(self._elements['H'], 0, 0, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['He'], 0, 17, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Li'], 1, 0, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Be'], 1, 1, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['B'], 1, 12, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['C'], 1, 13, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['N'], 1, 14, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['O'], 1, 15, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['F'], 1, 16, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Ne'], 1, 17, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Na'], 2, 0, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Mg'], 2, 1, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Al'], 2, 12, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Si'], 2, 13, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['P'], 2, 14, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['S'], 2, 15, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Cl'], 2, 16, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Ar'], 2, 17, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['K'], 3, 0, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Ca'], 3, 1, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Sc'], 3, 2, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Ti'], 3, 3, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['V'], 3, 4, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Cr'], 3, 5, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Mn'], 3, 6, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Fe'], 3, 7, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Co'], 3, 8, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Ni'], 3, 9, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Cu'], 3, 10, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Zn'], 3, 11, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Ga'], 3, 12, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Ge'], 3, 13, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['As'], 3, 14, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Se'], 3, 15, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Br'], 3, 16, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Kr'], 3, 17, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Rb'], 4, 0, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Sr'], 4, 1, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Y'], 4, 2, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Zr'], 4, 3, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Nb'], 4, 4, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Mo'], 4, 5, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Tc'], 4, 6, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Ru'], 4, 7, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Rh'], 4, 8, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Pd'], 4, 9, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Ag'], 4, 10, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Cd'], 4, 11, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['In'], 4, 12, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Sn'], 4, 13, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Sb'], 4, 14, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Te'], 4, 15, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['I'], 4, 16, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Xe'], 4, 17, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Cs'], 5, 0, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Ba'], 5, 1, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Hf'], 5, 3, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Ta'], 5, 4, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['W'], 5, 5, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Re'], 5, 6, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Os'], 5, 7, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Ir'], 5, 8, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Pt'], 5, 9, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Au'], 5, 10, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Hg'], 5, 11, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Tl'], 5, 12, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Pb'], 5, 13, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Bi'], 5, 14, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Po'], 5, 15, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['At'], 5, 16, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Rn'], 5, 17, Qt.AlignLeft | Qt.AlignTop) if 'Fr' in ELEMENTS: elements_layout.addWidget(self._elements['Fr'], 6, 0, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Ra'], 6, 1, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Rf'], 6, 3, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Db'], 6, 4, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Sg'], 6, 5, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Bh'], 6, 6, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Hs'], 6, 7, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Mt'], 6, 8, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Ds'], 6, 9, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Rg'], 6, 10, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Cn'], 6, 11, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Nh'], 6, 12, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Fl'], 6, 13, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Mc'], 6, 14, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Lv'], 6, 15, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Ts'], 6, 16, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Og'], 6, 17, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['La'], 7, 2, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Ce'], 7, 3, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Pr'], 7, 4, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Nd'], 7, 5, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Pm'], 7, 6, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Sm'], 7, 7, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Eu'], 7, 8, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Gd'], 7, 9, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Tb'], 7, 10, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Dy'], 7, 11, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Ho'], 7, 12, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Er'], 7, 13, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Tm'], 7, 14, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Yb'], 7, 15, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Lu'], 7, 16, Qt.AlignLeft | Qt.AlignTop) if 'Ac' in ELEMENTS: elements_layout.addWidget(self._elements['Ac'], 8, 2, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Th'], 8, 3, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Pa'], 8, 4, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['U'], 8, 5, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Np'], 8, 6, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Pu'], 8, 7, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Am'], 8, 8, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Cm'], 8, 9, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Bk'], 8, 10, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Cf'], 8, 11, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Es'], 8, 12, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Fm'], 8, 13, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Md'], 8, 14, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['No'], 8, 15, Qt.AlignLeft | Qt.AlignTop) elements_layout.addWidget(self._elements['Lr'], 8, 16, Qt.AlignLeft | Qt.AlignTop) if select_multiple: organic_button = QPushButton("organic chemists'") organic_button.setCheckable(True) organic_button.clicked.connect(self._select_ochem) #layout.addWidget(organic_button, 9, col, Qt.AlignTop) z_lt_37_button = QPushButton("H-Kr") z_lt_37_button.setCheckable(True) z_lt_37_button.clicked.connect(self._select_z_lt_37) layout.addWidget(z_lt_37_button, 9, 0, Qt.AlignTop) z_ge_37_button = QPushButton("row 5+") z_ge_37_button.setCheckable(True) z_ge_37_button.clicked.connect(self._select_z_ge_37) layout.addWidget(z_ge_37_button, 9, 1, Qt.AlignTop) z_le_86_button = QPushButton("H-Rn") z_le_86_button.setCheckable(True) z_le_86_button.clicked.connect(self._select_z_le_86) layout.addWidget(z_le_86_button, 9, 2, Qt.AlignTop) tm_button = QPushButton("transition metals") tm_button.setCheckable(True) tm_button.clicked.connect(self._select_tm) layout.addWidget(tm_button, 9, 3, Qt.AlignTop) all_button = QPushButton("all") all_button.clicked.connect(self._select_all) all_button.clicked.connect(lambda *args: organic_button.setChecked(False)) all_button.clicked.connect(lambda *args: tm_button.setChecked(False)) all_button.clicked.connect(lambda *args: organic_button.setChecked(False)) all_button.clicked.connect(lambda *args: z_lt_37_button.setChecked(False)) all_button.clicked.connect(lambda *args: z_ge_37_button.setChecked(False)) all_button.clicked.connect(lambda *args: z_le_86_button.setChecked(False)) layout.addWidget(all_button, 10, 0, Qt.AlignTop) invert = QPushButton("invert") invert.clicked.connect(self._invert) invert.clicked.connect(lambda *args: organic_button.setChecked(False)) invert.clicked.connect(lambda *args: tm_button.setChecked(False)) invert.clicked.connect(lambda *args: organic_button.setChecked(False)) invert.clicked.connect(lambda *args: z_lt_37_button.setChecked(False)) invert.clicked.connect(lambda *args: z_ge_37_button.setChecked(False)) invert.clicked.connect(lambda *args: z_le_86_button.setChecked(False)) layout.addWidget(invert, 10, 2, Qt.AlignTop) clear = QPushButton("clear") clear.clicked.connect(self._clear) clear.clicked.connect(lambda *args: organic_button.setChecked(False)) clear.clicked.connect(lambda *args: tm_button.setChecked(False)) clear.clicked.connect(lambda *args: organic_button.setChecked(False)) clear.clicked.connect(lambda *args: z_lt_37_button.setChecked(False)) clear.clicked.connect(lambda *args: z_ge_37_button.setChecked(False)) clear.clicked.connect(lambda *args: z_le_86_button.setChecked(False)) layout.addWidget(clear, 10, 1, Qt.AlignTop) reset = QPushButton("reset") reset.clicked.connect(self._reset) reset.clicked.connect(lambda *args: organic_button.setChecked(False)) reset.clicked.connect(lambda *args: tm_button.setChecked(False)) reset.clicked.connect(lambda *args: organic_button.setChecked(False)) reset.clicked.connect(lambda *args: z_lt_37_button.setChecked(False)) reset.clicked.connect(lambda *args: z_ge_37_button.setChecked(False)) reset.clicked.connect(lambda *args: z_le_86_button.setChecked(False)) layout.addWidget(reset, 10, 3, Qt.AlignTop) layout.addWidget(elements_widget, 0, 0, 7, 4, Qt.AlignLeft | Qt.AlignTop) self.setSelectedElements(initial_elements) self._initial_elements = initial_elements layout.setRowStretch(0, 0) layout.setRowStretch(1, 0) layout.setRowStretch(2, 0) layout.setRowStretch(3, 0) layout.setRowStretch(4, 0) layout.setRowStretch(5, 0) layout.setRowStretch(6, 0) layout.setRowStretch(7, 0) layout.setRowStretch(8, 0) layout.setRowStretch(9, 0) layout.setRowStretch(10, 1) layout.setColumnStretch(0, 0) layout.setColumnStretch(1, 1) layout.setColumnStretch(2, 1) layout.setColumnStretch(3, 1) else: layout.addWidget(elements_widget) if len(initial_elements) > 0: self.setSelectedElements([initial_elements[0]]) self._initial_elements = [initial_elements[0]]
def _build_ui(self): layout = QGridLayout() self.alchemy_tabs = QTabWidget() #substitute substitute_tab = QWidget() substitute_layout = QGridLayout(substitute_tab) sublabel = QLabel("substituent name:") substitute_layout.addWidget(sublabel, 0, 0, Qt.AlignVCenter) self.subname = QLineEdit() # self.subname.setText("Et") sub_completer = NameCompleter(Substituent.list(), self.subname) self.subname.setCompleter(sub_completer) self.subname.setToolTip("name of substituent in the AaronTools library or your personal library\nseparate names with commas and uncheck 'modify selected structure' to create several structures") substitute_layout.addWidget(self.subname, 0, 1, Qt.AlignVCenter) open_sub_lib = QPushButton("from library...") open_sub_lib.clicked.connect(self.open_sub_selector) substitute_layout.addWidget(open_sub_lib, 0, 2, Qt.AlignTop) substitute_layout.addWidget(QLabel("modify selected structure:"), 1, 0, 1, 1, Qt.AlignVCenter) self.close_previous_sub = QCheckBox() self.close_previous_sub.setToolTip("checked: selected structure will be modified\nunchecked: new model will be created for the modified structure") self.close_previous_sub.setChecked(self.settings.modify) self.close_previous_sub.stateChanged.connect(self.close_previous_change) substitute_layout.addWidget(self.close_previous_sub, 1, 1, 1, 2, Qt.AlignTop) substitute_layout.addWidget(QLabel("relax substituent:"), 2, 0, 1, 1, Qt.AlignVCenter) self.minimize = QCheckBox() self.minimize.setToolTip("spin the added substituents to try to minimize the LJ potential energy") self.minimize.setChecked(self.settings.minimize) substitute_layout.addWidget(self.minimize, 2, 1, 1, 1, Qt.AlignTop) substitute_layout.addWidget(QLabel("guess previous substituent:"), 3, 0, 1, 1, Qt.AlignVCenter) self.guess_old = QCheckBox() self.guess_old.setToolTip("checked: leave the longest connected fragment in the residue\nunchecked: previous substituent must be selected") self.guess_old.setChecked(self.settings.guess) self.guess_old.stateChanged.connect(lambda state, settings=self.settings: settings.__setattr__("guess", True if state == Qt.Checked else False)) substitute_layout.addWidget(self.guess_old, 3, 1, 1, 2, Qt.AlignTop) substitute_layout.addWidget(QLabel("new residue:"), 5, 0, 1, 1, Qt.AlignVCenter) self.new_residue = QCheckBox() self.new_residue.setToolTip("put the new substituent in its own residue instead\nof adding it to the residue of the old substituent") self.new_residue.setChecked(self.settings.new_residue) self.new_residue.stateChanged.connect(lambda state, settings=self.settings: settings.__setattr__("new_residue", True if state == Qt.Checked else False)) substitute_layout.addWidget(self.new_residue, 5, 1, 1, 2, Qt.AlignTop) substitute_layout.addWidget(QLabel("use distance names:"), 4, 0, 1, 1, Qt.AlignVCenter) self.use_greek = QCheckBox() self.use_greek.setChecked(self.settings.use_greek) self.use_greek.setToolTip("indicate distance from point of attachment with atom name") substitute_layout.addWidget(self.use_greek, 4, 1, 1, 1, Qt.AlignTop) substitute_layout.addWidget(QLabel("change residue name:"), 6, 0, 1, 1, Qt.AlignVCenter) self.new_sub_name = QLineEdit() self.new_sub_name.setToolTip("change name of modified residues") self.new_sub_name.setPlaceholderText("leave blank to keep current") substitute_layout.addWidget(self.new_sub_name, 6, 1, 1, 2, Qt.AlignTop) substitute_button = QPushButton("substitute current selection") substitute_button.clicked.connect(self.do_substitute) substitute_layout.addWidget(substitute_button, 7, 0, 1, 3, Qt.AlignTop) self.substitute_button = substitute_button substitute_layout.setRowStretch(0, 0) substitute_layout.setRowStretch(1, 0) substitute_layout.setRowStretch(2, 0) substitute_layout.setRowStretch(3, 0) substitute_layout.setRowStretch(4, 0) substitute_layout.setRowStretch(5, 0) substitute_layout.setRowStretch(6, 0) substitute_layout.setRowStretch(7, 1) #map ligand maplig_tab = QWidget() maplig_layout = QGridLayout(maplig_tab) liglabel = QLabel("ligand name:") maplig_layout.addWidget(liglabel, 0, 0, Qt.AlignVCenter) self.ligname = QLineEdit() lig_completer = NameCompleter(Component.list(), self.ligname) self.ligname.setCompleter(lig_completer) self.ligname.setToolTip("name of ligand in the AaronTools library or your personal library\nseparate names with commas and uncheck 'modify selected structure' to create several structures") maplig_layout.addWidget(self.ligname, 0, 1, Qt.AlignVCenter) open_lig_lib = QPushButton("from library...") open_lig_lib.clicked.connect(self.open_lig_selector) maplig_layout.addWidget(open_lig_lib, 0, 2, Qt.AlignTop) maplig_layout.addWidget(QLabel("modify selected structure:"), 1, 0, 1, 1, Qt.AlignVCenter) self.close_previous_lig = QCheckBox() self.close_previous_lig.setToolTip("checked: selected structure will be modified\nunchecked: new model will be created for the modified structure") self.close_previous_lig.setChecked(self.settings.modify) self.close_previous_lig.stateChanged.connect(self.close_previous_change) maplig_layout.addWidget(self.close_previous_lig, 1, 1, 1, 2, Qt.AlignTop) maplig_button = QPushButton("swap ligand with selected coordinating atoms") maplig_button.clicked.connect(self.do_maplig) maplig_layout.addWidget(maplig_button, 2, 0, 1, 3, Qt.AlignTop) self.maplig_button = maplig_button start_structure_button = QPushButton("place in:") self.lig_model_selector = ModelComboBox(self.session, addNew=True) start_structure_button.clicked.connect(self.do_new_lig) maplig_layout.addWidget(start_structure_button, 3, 0, 1, 1, Qt.AlignTop) maplig_layout.addWidget(self.lig_model_selector, 3, 1, 1, 2, Qt.AlignTop) maplig_layout.setRowStretch(0, 0) maplig_layout.setRowStretch(1, 0) maplig_layout.setRowStretch(2, 0) maplig_layout.setRowStretch(3, 1) #close ring closering_tab = QWidget() closering_layout = QGridLayout(closering_tab) ringlabel = QLabel("ring name:") closering_layout.addWidget(ringlabel, 0, 0, Qt.AlignVCenter) self.ringname = QLineEdit() ring_completer = NameCompleter(Ring.list(), self.ringname) self.ringname.setCompleter(ring_completer) self.ringname.setToolTip("name of ring in the AaronTools library or your personal library\nseparate names with commas and uncheck 'modify selected structure' to create several structures") closering_layout.addWidget(self.ringname, 0, 1, Qt.AlignVCenter) open_ring_lib = QPushButton("from library...") open_ring_lib.clicked.connect(self.open_ring_selector) closering_layout.addWidget(open_ring_lib, 0, 2, Qt.AlignTop) closering_layout.addWidget(QLabel("modify selected structure:"), 1, 0, 1, 1, Qt.AlignVCenter) self.close_previous_ring = QCheckBox() self.close_previous_ring.setToolTip("checked: selected structure will be modified\nunchecked: new model will be created for the modified structure") self.close_previous_ring.setChecked(self.settings.modify) self.close_previous_ring.stateChanged.connect(self.close_previous_change) closering_layout.addWidget(self.close_previous_ring, 1, 1, 1, 2, Qt.AlignTop) closering_layout.addWidget(QLabel("try multiple:"), 2, 0, 1, 1, Qt.AlignVCenter) self.minimize_ring = QCheckBox() self.minimize_ring.setToolTip("try to use other versions of this ring in the library to find the one that fits best") self.minimize_ring.setChecked(self.settings.minimize_ring) closering_layout.addWidget(self.minimize_ring, 2, 1, 1, 2, Qt.AlignTop) closering_layout.addWidget(QLabel("new residue name:"), 3, 0, 1, 1, Qt.AlignVCenter) self.new_ring_name = QLineEdit() self.new_ring_name.setToolTip("change name of modified residues") self.new_ring_name.setPlaceholderText("leave blank to keep current") closering_layout.addWidget(self.new_ring_name, 3, 1, 1, 2, Qt.AlignTop) closering_button = QPushButton("put a ring on current selection") closering_button.clicked.connect(self.do_fusering) closering_layout.addWidget(closering_button, 4, 0, 1, 3, Qt.AlignTop) self.closering_button = closering_button start_structure_button = QPushButton("place in:") self.ring_model_selector = ModelComboBox(self.session, addNew=True) start_structure_button.clicked.connect(self.do_new_ring) closering_layout.addWidget(start_structure_button, 5, 0, 1, 1, Qt.AlignTop) closering_layout.addWidget(self.ring_model_selector, 5, 1, 1, 2, Qt.AlignTop) closering_layout.setRowStretch(0, 0) closering_layout.setRowStretch(1, 0) closering_layout.setRowStretch(2, 0) closering_layout.setRowStretch(3, 0) closering_layout.setRowStretch(4, 0) closering_layout.setRowStretch(5, 1) #change element changeelement_tab = QWidget() changeelement_layout = QFormLayout(changeelement_tab) self.element = ElementButton("C", single_state=True) self.element.clicked.connect(self.open_ptable) changeelement_layout.addRow("element:", self.element) self.vsepr = QComboBox() self.vsepr.addItems([ "do not change", # 0 "linear (1 bond)", # 1 "linear (2 bonds)", # 2 "trigonal planar (2 bonds)", # 3 "tetrahedral (2 bonds)", # 4 "trigonal planar", # 5 "tetrahedral (3 bonds)", # 6 "T-shaped", # 7 "trigonal pyramidal", # 8 "tetrahedral", # 9 "sawhorse", #10 "seesaw", #11 "square planar", #12 "trigonal bipyramidal", #13 "square pyramidal", #14 "pentagonal", #15 "octahedral", #16 "hexagonal", #17 "trigonal prismatic", #18 "pentagonal pyramidal", #19 "capped octahedral", #20 "capped trigonal prismatic", #21 "heptagonal", #22 "hexagonal pyramidal", #23 "pentagonal bipyramidal", #24 "biaugmented trigonal prismatic", #25 "cubic", #26 "elongated trigonal bipyramidal", #27 "hexagonal bipyramidal", #28 "heptagonal pyramidal", #29 "octagonal", #30 "square antiprismatic", #31 "trigonal dodecahedral", #32 "capped cube", #33 "capped square antiprismatic", #34 "enneagonal", #35 "heptagonal bipyramidal", #36 "hula-hoop", #37 "triangular cupola", #38 "tridiminished icosahedral", #39 "muffin", #40 "octagonal pyramidal", #41 "tricapped trigonal prismatic", #42 ]) self.vsepr.setCurrentIndex(9) self.vsepr.insertSeparator(33) self.vsepr.insertSeparator(25) self.vsepr.insertSeparator(20) self.vsepr.insertSeparator(16) self.vsepr.insertSeparator(13) self.vsepr.insertSeparator(8) self.vsepr.insertSeparator(5) self.vsepr.insertSeparator(2) self.vsepr.insertSeparator(1) self.vsepr.insertSeparator(0) changeelement_layout.addRow("geometry:", self.vsepr) self.change_bonds = QCheckBox() self.change_bonds.setChecked(self.settings.change_bonds) changeelement_layout.addRow("adjust bond lengths:", self.change_bonds) change_element_button = QPushButton("change selected elements") change_element_button.clicked.connect(self.do_change_element) changeelement_layout.addRow(change_element_button) self.change_element_button = change_element_button start_structure_button = QPushButton("place in:") self.model_selector = ModelComboBox(self.session, addNew=True) start_structure_button.clicked.connect(self.do_new_atom) changeelement_layout.addRow(start_structure_button, self.model_selector) delete_atoms_button = QPushButton("delete selected atoms") delete_atoms_button.clicked.connect(self.delete_atoms) changeelement_layout.addRow(delete_atoms_button) self.alchemy_tabs.addTab(substitute_tab, "substitute") self.alchemy_tabs.addTab(maplig_tab, "swap ligand") self.alchemy_tabs.addTab(closering_tab, "fuse ring") self.alchemy_tabs.addTab(changeelement_tab, "change element") layout.addWidget(self.alchemy_tabs) self.tool_window.ui_area.setLayout(layout) self.tool_window.manage(None)