diff --git a/FlatCAMObj.py b/FlatCAMObj.py index ed31bb98..68edd0a2 100644 --- a/FlatCAMObj.py +++ b/FlatCAMObj.py @@ -233,7 +233,10 @@ class FlatCAMObj(QtCore.QObject): # self.ui.scale_entry.returnPressed.connect(self.on_scale_button_click) except Exception as e: self.app.log.debug("FlatCAMObj.build_ui() --> Nothing to remove: %s" % str(e)) + self.app.ui.selected_scroll_area.setWidget(self.ui) + # self.ui.setMinimumWidth(100) + # self.ui.setMaximumWidth(self.app.ui.selected_tab.sizeHint().width()) self.muted_ui = False @@ -4076,6 +4079,8 @@ class FlatCAMGeometry(FlatCAMObj, Geometry): self.outline_color = self.app.defaults['geometry_plot_line'] self.alpha_level = 'FF' + self.param_fields = {} + # Attributes to be included in serialization # Always append to it because it carries contents # from predecessors. @@ -4244,6 +4249,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry): assert isinstance(self.ui, GeometryObjectUI), \ "Expected a GeometryObjectUI, got %s" % type(self.ui) + self.units = self.app.defaults['units'].upper() self.units_found = self.app.defaults['units'] @@ -4277,6 +4283,24 @@ class FlatCAMGeometry(FlatCAMObj, Geometry): "cnctooldia": self.ui.addtool_entry }) + self.param_fields.update({ + "vtipdia": self.ui.tipdia_entry, + "vtipangle": self.ui.tipangle_entry, + "cutz": self.ui.cutz_entry, + "depthperpass": self.ui.maxdepth_entry, + "multidepth": self.ui.mpass_cb, + "travelz": self.ui.travelz_entry, + "feedrate": self.ui.cncfeedrate_entry, + "feedrate_z": self.ui.feedrate_z_entry, + "feedrate_rapid": self.ui.feedrate_rapid_entry, + "extracut": self.ui.extracut_cb, + "extracut_length": self.ui.e_cut_entry, + "spindlespeed": self.ui.cncspindlespeed_entry, + "dwelltime": self.ui.dwelltime_entry, + "dwell": self.ui.dwell_cb, + "pdepth": self.ui.pdepth_entry, + "pfeedrate": self.ui.feedrate_probe_entry, + }) # Fill form fields only on object create self.to_form() @@ -4486,8 +4510,8 @@ class FlatCAMGeometry(FlatCAMObj, Geometry): def ui_connect(self): # on any change to the widgets that matter it will be called self.gui_form_to_storage which will save the # changes in geometry UI - for i in range(self.ui.grid3.count()): - current_widget = self.ui.grid3.itemAt(i).widget() + for i in self.param_fields: + current_widget = self.param_fields[i] if isinstance(current_widget, FCCheckBox): current_widget.stateChanged.connect(self.gui_form_to_storage) elif isinstance(current_widget, FCComboBox): @@ -4527,27 +4551,28 @@ class FlatCAMGeometry(FlatCAMObj, Geometry): # on any change to the widgets that matter it will be called self.gui_form_to_storage which will save the # changes in geometry UI - for i in range(self.ui.grid3.count()): - current_widget = self.ui.grid3.itemAt(i).widget() + for i in self.param_fields: + # current_widget = self.ui.grid3.itemAt(i).widget() + current_widget = self.param_fields[i] if isinstance(current_widget, FCCheckBox): try: - self.ui.grid3.itemAt(i).widget().stateChanged.disconnect(self.gui_form_to_storage) + current_widget.stateChanged.disconnect(self.gui_form_to_storage) except (TypeError, AttributeError): pass elif isinstance(current_widget, FCComboBox): try: - self.ui.grid3.itemAt(i).widget().currentIndexChanged.disconnect(self.gui_form_to_storage) + current_widget.currentIndexChanged.disconnect(self.gui_form_to_storage) except (TypeError, AttributeError): pass elif isinstance(current_widget, LengthEntry) or isinstance(current_widget, IntEntry) or \ isinstance(current_widget, FCEntry) or isinstance(current_widget, FloatEntry): try: - self.ui.grid3.itemAt(i).widget().editingFinished.disconnect(self.gui_form_to_storage) + current_widget.editingFinished.disconnect(self.gui_form_to_storage) except (TypeError, AttributeError): pass elif isinstance(current_widget, FCSpinner) or isinstance(current_widget, FCDoubleSpinner): try: - self.ui.grid3.itemAt(i).widget().returnPressed.disconnect(self.gui_form_to_storage) + current_widget.returnPressed.disconnect(self.gui_form_to_storage) except TypeError: pass diff --git a/README.md b/README.md index aa96371a..95a692dc 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ CAD program, and create G-Code for Isolation routing. - fixed a bug in extension detection for Gerber files that allowed in the filtered list files that extension *.gb* - added a processEvents method in the Gerber parser parse_lines() method - fixed issue #386 - multiple Cut operation on a edited object created a crash due of the bounds() method - +- some changes in the Geometry UI 4.04.2020 diff --git a/flatcamGUI/FlatCAMGUI.py b/flatcamGUI/FlatCAMGUI.py index 35b9ae2a..9fdd90fd 100644 --- a/flatcamGUI/FlatCAMGUI.py +++ b/flatcamGUI/FlatCAMGUI.py @@ -1112,10 +1112,13 @@ class FlatCAMGUI(QtWidgets.QMainWindow): # ########################## SELECTED Tab # ############################## # ######################################################################## self.selected_tab = QtWidgets.QWidget() + # self.selected_tab.setMinimumWidth(270) self.selected_tab.setObjectName("selected_tab") self.selected_tab_layout = QtWidgets.QVBoxLayout(self.selected_tab) self.selected_tab_layout.setContentsMargins(2, 2, 2, 2) + self.selected_scroll_area = VerticalScrollArea() + # self.selected_scroll_area.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents) self.selected_tab_layout.addWidget(self.selected_scroll_area) self.notebook.addTab(self.selected_tab, _("Selected")) @@ -1128,6 +1131,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow): self.tool_tab_layout.setContentsMargins(2, 2, 2, 2) self.notebook.addTab(self.tool_tab, _("Tool")) self.tool_scroll_area = VerticalScrollArea() + # self.tool_scroll_area.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents) self.tool_tab_layout.addWidget(self.tool_scroll_area) # ######################################################################## diff --git a/flatcamGUI/GUIElements.py b/flatcamGUI/GUIElements.py index f851d16e..4965b954 100644 --- a/flatcamGUI/GUIElements.py +++ b/flatcamGUI/GUIElements.py @@ -898,6 +898,10 @@ class FCDoubleSpinner(QtWidgets.QDoubleSpinBox): self.setRange(min_val, max_val) + # def sizeHint(self): + # default_hint_size = super(FCDoubleSpinner, self).sizeHint() + # return QtCore.QSize(EDIT_SIZE_HINT, default_hint_size.height()) + class FCCheckBox(QtWidgets.QCheckBox): def __init__(self, label='', parent=None): @@ -2076,7 +2080,7 @@ class FCDetachableTab2(FCDetachableTab): class VerticalScrollArea(QtWidgets.QScrollArea): """ This widget extends QtGui.QScrollArea to make a vertical-only - scroll area that also expands horizontally to accomodate + scroll area that also expands horizontally to accommodate its contents. """ def __init__(self, parent=None): diff --git a/flatcamGUI/ObjectUI.py b/flatcamGUI/ObjectUI.py index 39de3558..3b91514c 100644 --- a/flatcamGUI/ObjectUI.py +++ b/flatcamGUI/ObjectUI.py @@ -37,7 +37,7 @@ class ObjectUI(QtWidgets.QWidget): def __init__(self, app, icon_file='share/flatcam_icon32.png', title=_('FlatCAM Object'), parent=None, common=True): QtWidgets.QWidget.__init__(self, parent=parent) - + self.app = app self.decimals = app.decimals @@ -1427,6 +1427,7 @@ class GeometryObjectUI(ObjectUI): # ## Object name self.name_hlay = QtWidgets.QHBoxLayout() self.custom_box.addLayout(self.name_hlay) + name_label = QtWidgets.QLabel("%s:" % _("Name")) self.name_entry = FCEntry() self.name_entry.setFocusPolicy(QtCore.Qt.StrongFocus) @@ -1438,12 +1439,25 @@ class GeometryObjectUI(ObjectUI): self.geo_tools_frame = QtWidgets.QFrame() self.geo_tools_frame.setContentsMargins(0, 0, 0, 0) self.custom_box.addWidget(self.geo_tools_frame) + self.geo_tools_box = QtWidgets.QVBoxLayout() self.geo_tools_box.setContentsMargins(0, 0, 0, 0) self.geo_tools_frame.setLayout(self.geo_tools_box) - hlay_plot = QtWidgets.QHBoxLayout() - self.geo_tools_box.addLayout(hlay_plot) + # ************************************************************************ + # ************** TABLE BOX FRAME ***************************************** + # ************************************************************************ + self.geo_table_frame = QtWidgets.QFrame() + self.geo_table_frame.setContentsMargins(0, 0, 0, 0) + self.geo_tools_box.addWidget(self.geo_table_frame) + self.geo_table_box = QtWidgets.QVBoxLayout() + self.geo_table_box.setContentsMargins(0, 0, 0, 0) + self.geo_table_frame.setLayout(self.geo_table_box) + + grid0 = QtWidgets.QGridLayout() + self.geo_table_box.addLayout(grid0) + grid0.setColumnStretch(0, 0) + grid0.setColumnStretch(1, 1) # ### Tools #### self.tools_table_label = QtWidgets.QLabel('%s:' % _('Tools Table')) @@ -1461,7 +1475,7 @@ class GeometryObjectUI(ObjectUI): "grayed out and Cut Z is automatically calculated from the newly \n" "showed UI form entries named V-Tip Dia and V-Tip Angle.") ) - hlay_plot.addWidget(self.tools_table_label) + grid0.addWidget(self.tools_table_label, 0, 0) # Plot CB # self.plot_cb = QtWidgets.QCheckBox('Plot') @@ -1470,11 +1484,10 @@ class GeometryObjectUI(ObjectUI): _("Plot (show) this object.") ) self.plot_cb.setLayoutDirection(QtCore.Qt.RightToLeft) - hlay_plot.addStretch() - hlay_plot.addWidget(self.plot_cb) + grid0.addWidget(self.plot_cb, 0, 1) self.geo_tools_table = FCTable() - self.geo_tools_box.addWidget(self.geo_tools_table) + grid0.addWidget(self.geo_tools_table, 1, 0, 1, 2) self.geo_tools_table.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents) self.geo_tools_table.setColumnCount(7) @@ -1535,10 +1548,10 @@ class GeometryObjectUI(ObjectUI): # self.geo_tools_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) # Tool Offset - self.grid1 = QtWidgets.QGridLayout() - self.geo_tools_box.addLayout(self.grid1) - self.grid1.setColumnStretch(0, 0) - self.grid1.setColumnStretch(1, 1) + grid1 = QtWidgets.QGridLayout() + self.geo_table_box.addLayout(grid1) + grid1.setColumnStretch(0, 0) + grid1.setColumnStretch(1, 1) self.tool_offset_lbl = QtWidgets.QLabel('%s:' % _('Tool Offset')) self.tool_offset_lbl.setToolTip( @@ -1554,16 +1567,16 @@ class GeometryObjectUI(ObjectUI): self.tool_offset_entry.set_range(-9999.9999, 9999.9999) self.tool_offset_entry.setSingleStep(0.1) - self.grid1.addWidget(self.tool_offset_lbl, 0, 0) - self.grid1.addWidget(self.tool_offset_entry, 0, 1, 1, 2) + grid1.addWidget(self.tool_offset_lbl, 0, 0) + grid1.addWidget(self.tool_offset_entry, 0, 1) separator_line = QtWidgets.QFrame() separator_line.setFrameShape(QtWidgets.QFrame.HLine) separator_line.setFrameShadow(QtWidgets.QFrame.Sunken) - self.grid1.addWidget(separator_line, 1, 0, 1, 3) + grid1.addWidget(separator_line, 1, 0, 1, 2) self.tool_sel_label = QtWidgets.QLabel('%s' % _("New Tool")) - self.grid1.addWidget(self.tool_sel_label, 2, 0, 1, 3) + grid1.addWidget(self.tool_sel_label, 2, 0, 1, 2) self.addtool_entry_lbl = QtWidgets.QLabel('%s:' % _('Tool Dia')) self.addtool_entry_lbl.setToolTip( @@ -1574,30 +1587,30 @@ class GeometryObjectUI(ObjectUI): self.addtool_entry.set_range(0.00001, 9999.9999) self.addtool_entry.setSingleStep(0.1) + grid1.addWidget(self.addtool_entry_lbl, 3, 0) + grid1.addWidget(self.addtool_entry, 3, 1) + self.addtool_btn = QtWidgets.QPushButton(_('Add')) self.addtool_btn.setToolTip( _("Add a new tool to the Tool Table\n" "with the specified diameter.") ) - - self.grid1.addWidget(self.addtool_entry_lbl, 3, 0) - self.grid1.addWidget(self.addtool_entry, 3, 1) - self.grid1.addWidget(self.addtool_btn, 3, 2) + grid1.addWidget(self.addtool_btn, 4, 0, 1, 2) self.addtool_from_db_btn = QtWidgets.QPushButton(_('Add from DB')) self.addtool_from_db_btn.setToolTip( _("Add a new tool to the Tool Table\n" "from the Tool DataBase.") ) - self.grid1.addWidget(self.addtool_from_db_btn, 4, 0, 1, 3) + grid1.addWidget(self.addtool_from_db_btn, 7, 0, 1, 2) separator_line = QtWidgets.QFrame() separator_line.setFrameShape(QtWidgets.QFrame.HLine) separator_line.setFrameShadow(QtWidgets.QFrame.Sunken) - self.grid1.addWidget(separator_line, 5, 0, 1, 3) + grid1.addWidget(separator_line, 9, 0, 1, 2) grid2 = QtWidgets.QGridLayout() - self.geo_tools_box.addLayout(grid2) + self.geo_table_box.addLayout(grid2) self.copytool_btn = QtWidgets.QPushButton(_('Copy')) self.copytool_btn.setToolTip( @@ -1614,17 +1627,33 @@ class GeometryObjectUI(ObjectUI): grid2.addWidget(self.copytool_btn, 0, 0) grid2.addWidget(self.deltool_btn, 0, 1) - self.empty_label = QtWidgets.QLabel('') - self.geo_tools_box.addWidget(self.empty_label) + self.geo_table_box.addWidget(QtWidgets.QLabel('')) # ########################################################### # ############# Create CNC Job ############################## # ########################################################### + self.geo_param_frame = QtWidgets.QFrame() + self.geo_param_frame.setContentsMargins(0, 0, 0, 0) + self.geo_tools_box.addWidget(self.geo_param_frame) + + self.geo_param_box = QtWidgets.QVBoxLayout() + self.geo_param_box.setContentsMargins(0, 0, 0, 0) + self.geo_param_frame.setLayout(self.geo_param_box) + separator_line = QtWidgets.QFrame() separator_line.setFrameShape(QtWidgets.QFrame.HLine) separator_line.setFrameShadow(QtWidgets.QFrame.Sunken) - self.geo_tools_box.addWidget(separator_line) + self.geo_param_box.addWidget(separator_line) + + # ################################################################# + # ################# GRID LAYOUT 3 ############################### + # ################################################################# + + grid3 = QtWidgets.QGridLayout() + grid3.setColumnStretch(0, 0) + grid3.setColumnStretch(1, 1) + self.geo_param_box.addLayout(grid3) # ### Tools Data ## ## self.tool_data_label = QtWidgets.QLabel( @@ -1635,24 +1664,7 @@ class GeometryObjectUI(ObjectUI): "Each tool store it's own set of such data." ) ) - self.geo_tools_box.addWidget(self.tool_data_label) - - self.geo_param_frame = QtWidgets.QFrame() - self.geo_param_frame.setContentsMargins(0, 0, 0, 0) - self.geo_tools_box.addWidget(self.geo_param_frame) - - self.geo_param_box = QtWidgets.QVBoxLayout() - self.geo_param_box.setContentsMargins(0, 0, 0, 0) - self.geo_param_frame.setLayout(self.geo_param_box) - - # ################################################################# - # ################# GRID LAYOUT 3 ############################### - # ################################################################# - - self.grid3 = QtWidgets.QGridLayout() - self.grid3.setColumnStretch(0, 0) - self.grid3.setColumnStretch(1, 1) - self.geo_param_box.addLayout(self.grid3) + grid3.addWidget(self.tool_data_label, 0, 0, 1, 2) # Tip Dia self.tipdialabel = QtWidgets.QLabel('%s:' % _('V-Tip Dia')) @@ -1666,8 +1678,8 @@ class GeometryObjectUI(ObjectUI): self.tipdia_entry.set_range(0.00001, 9999.9999) self.tipdia_entry.setSingleStep(0.1) - self.grid3.addWidget(self.tipdialabel, 1, 0) - self.grid3.addWidget(self.tipdia_entry, 1, 1) + grid3.addWidget(self.tipdialabel, 1, 0) + grid3.addWidget(self.tipdia_entry, 1, 1) # Tip Angle self.tipanglelabel = QtWidgets.QLabel('%s:' % _('V-Tip Angle')) @@ -1682,8 +1694,8 @@ class GeometryObjectUI(ObjectUI): self.tipangle_entry.set_range(1.0, 180.0) self.tipangle_entry.setSingleStep(1) - self.grid3.addWidget(self.tipanglelabel, 2, 0) - self.grid3.addWidget(self.tipangle_entry, 2, 1) + grid3.addWidget(self.tipanglelabel, 2, 0) + grid3.addWidget(self.tipangle_entry, 2, 1) # Cut Z self.cutzlabel = QtWidgets.QLabel('%s:' % _('Cut Z')) @@ -1703,8 +1715,8 @@ class GeometryObjectUI(ObjectUI): self.cutz_entry.setSingleStep(0.1) - self.grid3.addWidget(self.cutzlabel, 3, 0) - self.grid3.addWidget(self.cutz_entry, 3, 1) + grid3.addWidget(self.cutzlabel, 3, 0) + grid3.addWidget(self.cutz_entry, 3, 1) # Multi-pass self.mpass_cb = FCCheckBox('%s:' % _("Multi-Depth")) @@ -1729,8 +1741,8 @@ class GeometryObjectUI(ObjectUI): ) self.ois_mpass_geo = OptionalInputSection(self.mpass_cb, [self.maxdepth_entry]) - self.grid3.addWidget(self.mpass_cb, 4, 0) - self.grid3.addWidget(self.maxdepth_entry, 4, 1) + grid3.addWidget(self.mpass_cb, 4, 0) + grid3.addWidget(self.maxdepth_entry, 4, 1) # Travel Z self.travelzlabel = QtWidgets.QLabel('%s:' % _('Travel Z')) @@ -1748,8 +1760,8 @@ class GeometryObjectUI(ObjectUI): self.travelz_entry.setSingleStep(0.1) - self.grid3.addWidget(self.travelzlabel, 5, 0) - self.grid3.addWidget(self.travelz_entry, 5, 1) + grid3.addWidget(self.travelzlabel, 5, 0) + grid3.addWidget(self.travelz_entry, 5, 1) # Feedrate X-Y self.frlabel = QtWidgets.QLabel('%s:' % _('Feedrate X-Y')) @@ -1762,8 +1774,8 @@ class GeometryObjectUI(ObjectUI): self.cncfeedrate_entry.set_range(0, 99999.9999) self.cncfeedrate_entry.setSingleStep(0.1) - self.grid3.addWidget(self.frlabel, 10, 0) - self.grid3.addWidget(self.cncfeedrate_entry, 10, 1) + grid3.addWidget(self.frlabel, 10, 0) + grid3.addWidget(self.cncfeedrate_entry, 10, 1) # Feedrate Z (Plunge) self.frzlabel = QtWidgets.QLabel('%s:' % _('Feedrate Z')) @@ -1777,8 +1789,8 @@ class GeometryObjectUI(ObjectUI): self.feedrate_z_entry.set_range(0, 99999.9999) self.feedrate_z_entry.setSingleStep(0.1) - self.grid3.addWidget(self.frzlabel, 11, 0) - self.grid3.addWidget(self.feedrate_z_entry, 11, 1) + grid3.addWidget(self.frzlabel, 11, 0) + grid3.addWidget(self.feedrate_z_entry, 11, 1) # Feedrate rapids self.fr_rapidlabel = QtWidgets.QLabel('%s:' % _('Feedrate Rapids')) @@ -1794,8 +1806,8 @@ class GeometryObjectUI(ObjectUI): self.feedrate_rapid_entry.set_range(0, 99999.9999) self.feedrate_rapid_entry.setSingleStep(0.1) - self.grid3.addWidget(self.fr_rapidlabel, 12, 0) - self.grid3.addWidget(self.feedrate_rapid_entry, 12, 1) + grid3.addWidget(self.fr_rapidlabel, 12, 0) + grid3.addWidget(self.feedrate_rapid_entry, 12, 1) # default values is to hide self.fr_rapidlabel.hide() self.feedrate_rapid_entry.hide() @@ -1820,8 +1832,8 @@ class GeometryObjectUI(ObjectUI): "meet with last cut, we generate an\n" "extended cut over the first cut section.") ) - self.grid3.addWidget(self.extracut_cb, 13, 0) - self.grid3.addWidget(self.e_cut_entry, 13, 1) + grid3.addWidget(self.extracut_cb, 13, 0) + grid3.addWidget(self.e_cut_entry, 13, 1) # Spindlespeed self.spindle_label = QtWidgets.QLabel('%s:' % _('Spindle speed')) @@ -1836,8 +1848,8 @@ class GeometryObjectUI(ObjectUI): self.cncspindlespeed_entry.set_range(0, 1000000) self.cncspindlespeed_entry.set_step(100) - self.grid3.addWidget(self.spindle_label, 14, 0) - self.grid3.addWidget(self.cncspindlespeed_entry, 14, 1) + grid3.addWidget(self.spindle_label, 14, 0) + grid3.addWidget(self.cncspindlespeed_entry, 14, 1) # Dwell self.dwell_cb = FCCheckBox('%s:' % _('Dwell')) @@ -1857,8 +1869,8 @@ class GeometryObjectUI(ObjectUI): ) self.ois_dwell_geo = OptionalInputSection(self.dwell_cb, [self.dwelltime_entry]) - self.grid3.addWidget(self.dwell_cb, 15, 0) - self.grid3.addWidget(self.dwelltime_entry, 15, 1) + grid3.addWidget(self.dwell_cb, 15, 0) + grid3.addWidget(self.dwelltime_entry, 15, 1) # Probe depth self.pdepth_label = QtWidgets.QLabel('%s:' % _("Probe Z depth")) @@ -1871,8 +1883,8 @@ class GeometryObjectUI(ObjectUI): self.pdepth_entry.set_range(-9999.9999, 9999.9999) self.pdepth_entry.setSingleStep(0.1) - self.grid3.addWidget(self.pdepth_label, 17, 0) - self.grid3.addWidget(self.pdepth_entry, 17, 1) + grid3.addWidget(self.pdepth_label, 17, 0) + grid3.addWidget(self.pdepth_entry, 17, 1) self.pdepth_label.hide() self.pdepth_entry.setVisible(False) @@ -1887,8 +1899,8 @@ class GeometryObjectUI(ObjectUI): self.feedrate_probe_entry.set_range(0.0, 9999.9999) self.feedrate_probe_entry.setSingleStep(0.1) - self.grid3.addWidget(self.feedrate_probe_label, 18, 0) - self.grid3.addWidget(self.feedrate_probe_entry, 18, 1) + grid3.addWidget(self.feedrate_probe_label, 18, 0) + grid3.addWidget(self.feedrate_probe_entry, 18, 1) self.feedrate_probe_label.hide() self.feedrate_probe_entry.setVisible(False) @@ -1897,34 +1909,34 @@ class GeometryObjectUI(ObjectUI): # ################# GRID LAYOUT 4 ############################### # ################################################################# - self.grid4 = QtWidgets.QGridLayout() - self.grid4.setColumnStretch(0, 0) - self.grid4.setColumnStretch(1, 1) - self.geo_param_box.addLayout(self.grid4) + grid4 = QtWidgets.QGridLayout() + grid4.setColumnStretch(0, 0) + grid4.setColumnStretch(1, 1) + self.geo_param_box.addLayout(grid4) separator_line2 = QtWidgets.QFrame() separator_line2.setFrameShape(QtWidgets.QFrame.HLine) separator_line2.setFrameShadow(QtWidgets.QFrame.Sunken) - self.grid4.addWidget(separator_line2, 0, 0, 1, 2) + grid4.addWidget(separator_line2, 0, 0, 1, 2) self.apply_param_to_all = FCButton(_("Apply parameters to all tools")) self.apply_param_to_all.setToolTip( _("The parameters in the current form will be applied\n" "on all the tools from the Tool Table.") ) - self.grid4.addWidget(self.apply_param_to_all, 1, 0, 1, 2) + grid4.addWidget(self.apply_param_to_all, 1, 0, 1, 2) separator_line2 = QtWidgets.QFrame() separator_line2.setFrameShape(QtWidgets.QFrame.HLine) separator_line2.setFrameShadow(QtWidgets.QFrame.Sunken) - self.grid4.addWidget(separator_line2, 2, 0, 1, 2) + grid4.addWidget(separator_line2, 2, 0, 1, 2) # General Parameters self.gen_param_label = QtWidgets.QLabel('%s' % _("Common Parameters")) self.gen_param_label.setToolTip( _("Parameters that are common for all tools.") ) - self.grid4.addWidget(self.gen_param_label, 3, 0, 1, 2) + grid4.addWidget(self.gen_param_label, 3, 0, 1, 2) # Tool change Z self.toolchangeg_cb = FCCheckBox('%s:' % _("Tool change Z")) @@ -1951,8 +1963,8 @@ class GeometryObjectUI(ObjectUI): self.toolchangez_entry.setSingleStep(0.1) self.ois_tcz_geo = OptionalInputSection(self.toolchangeg_cb, [self.toolchangez_entry]) - self.grid4.addWidget(self.toolchangeg_cb, 6, 0) - self.grid4.addWidget(self.toolchangez_entry, 6, 1) + grid4.addWidget(self.toolchangeg_cb, 6, 0) + grid4.addWidget(self.toolchangez_entry, 6, 1) # The Z value for the start move # startzlabel = QtWidgets.QLabel('Start move Z:') @@ -1961,9 +1973,9 @@ class GeometryObjectUI(ObjectUI): # "Delete the value if you don't need this feature." # # ) - # self.grid3.addWidget(startzlabel, 8, 0) + # grid3.addWidget(startzlabel, 8, 0) # self.gstartz_entry = FloatEntry() - # self.grid3.addWidget(self.gstartz_entry, 8, 1) + # grid3.addWidget(self.gstartz_entry, 8, 1) # The Z value for the end move self.endz_label = QtWidgets.QLabel('%s:' % _('End move Z')) @@ -1981,8 +1993,8 @@ class GeometryObjectUI(ObjectUI): self.endz_entry.setSingleStep(0.1) - self.grid4.addWidget(self.endz_label, 9, 0) - self.grid4.addWidget(self.endz_entry, 9, 1) + grid4.addWidget(self.endz_label, 9, 0) + grid4.addWidget(self.endz_entry, 9, 1) # End Move X,Y endmove_xy_label = QtWidgets.QLabel('%s:' % _('End move X,Y')) @@ -1993,8 +2005,8 @@ class GeometryObjectUI(ObjectUI): ) self.endxy_entry = FCEntry() - self.grid4.addWidget(endmove_xy_label, 10, 0) - self.grid4.addWidget(self.endxy_entry, 10, 1) + grid4.addWidget(endmove_xy_label, 10, 0) + grid4.addWidget(self.endxy_entry, 10, 1) # preprocessor selection pp_label = QtWidgets.QLabel('%s:' % _("Preprocessor")) @@ -2005,17 +2017,17 @@ class GeometryObjectUI(ObjectUI): self.pp_geometry_name_cb = FCComboBox() self.pp_geometry_name_cb.setFocusPolicy(QtCore.Qt.StrongFocus) - self.grid4.addWidget(pp_label, 11, 0) - self.grid4.addWidget(self.pp_geometry_name_cb, 11, 1) + grid4.addWidget(pp_label, 11, 0) + grid4.addWidget(self.pp_geometry_name_cb, 11, 1) - self.grid4.addWidget(QtWidgets.QLabel(''), 12, 0, 1, 2) + grid4.addWidget(QtWidgets.QLabel(''), 12, 0, 1, 2) warning_lbl = QtWidgets.QLabel( _( "Add / Select at least one tool in the tool-table.\n" "Click the # header to select all, or Ctrl + LMB\n" "for custom selection of tools." )) - self.grid4.addWidget(warning_lbl, 13, 0, 1, 2) + grid4.addWidget(warning_lbl, 13, 0, 1, 2) # Button self.generate_cnc_button = QtWidgets.QPushButton(_('Generate CNCJob object')) @@ -2028,9 +2040,9 @@ class GeometryObjectUI(ObjectUI): font-weight: bold; } """) - self.grid4.addWidget(self.generate_cnc_button, 14, 0, 1, 2) + grid4.addWidget(self.generate_cnc_button, 14, 0, 1, 2) - self.grid4.addWidget(QtWidgets.QLabel(''), 15, 0, 1, 2) + grid4.addWidget(QtWidgets.QLabel(''), 15, 0, 1, 2) # ############## # Paint area ## @@ -2039,7 +2051,7 @@ class GeometryObjectUI(ObjectUI): self.tools_label.setToolTip( _("Launch Paint Tool in Tools Tab.") ) - self.grid4.addWidget(self.tools_label, 16, 0, 1, 2) + grid4.addWidget(self.tools_label, 16, 0, 1, 2) # Paint Button self.paint_tool_button = QtWidgets.QPushButton(_('Paint Tool')) @@ -2057,7 +2069,7 @@ class GeometryObjectUI(ObjectUI): font-weight: bold; } """) - self.grid4.addWidget(self.paint_tool_button, 17, 0, 1, 2) + grid4.addWidget(self.paint_tool_button, 17, 0, 1, 2) # NCC Tool self.generate_ncc_button = QtWidgets.QPushButton(_('NCC Tool')) @@ -2071,7 +2083,7 @@ class GeometryObjectUI(ObjectUI): font-weight: bold; } """) - self.grid4.addWidget(self.generate_ncc_button, 18, 0, 1, 2) + grid4.addWidget(self.generate_ncc_button, 18, 0, 1, 2) class CNCObjectUI(ObjectUI):