- refactored some methods from App class and moved them to plotcanvas (plotcanvaslegacy) class

- added an label with icon in the status bar, clicking it will toggle (show status) of the X-Y axis on cavnas
- optimized the UI, added to status bar an icon to toggle the axis
This commit is contained in:
Marius Stanciu
2020-05-29 18:39:19 +03:00
committed by Marius
parent 15ec620cae
commit ffa063286f
18 changed files with 356 additions and 281 deletions

View File

@@ -2830,7 +2830,7 @@ class FlatCAMExcEditor(QtCore.QObject):
self.app.ui.exc_edit_toolbar.setDisabled(False)
self.app.ui.exc_edit_toolbar.setVisible(True)
# self.app.ui.snap_toolbar.setDisabled(False)
# self.app.ui.status_toolbar.setDisabled(False)
# start with GRID toolbar activated
if self.app.ui.grid_snap_btn.isChecked() is False:

View File

@@ -3665,7 +3665,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
self.app.ui.geo_edit_toolbar.setDisabled(False)
self.app.ui.geo_edit_toolbar.setVisible(True)
self.app.ui.snap_toolbar.setDisabled(False)
self.app.ui.status_toolbar.setDisabled(False)
self.app.ui.popmenu_disable.setVisible(False)
self.app.ui.cmenu_newmenu.menuAction().setVisible(False)
@@ -4135,11 +4135,11 @@ class FlatCAMGeoEditor(QtCore.QObject):
# make sure that the cursor shape is enabled/disabled, too
if self.options['grid_snap'] is True:
self.app.inform.emit(_("Grid snap enabled."))
self.app.inform[str, bool].emit(_("Grid Snap enabled."), False)
self.app.app_cursor.enabled = True
else:
self.app.app_cursor.enabled = False
self.app.inform.emit(_("Grid snap disabled."))
self.app.inform[str, bool].emit(_("Grid Snap disabled."), False)
def on_canvas_click(self, event):
"""

View File

@@ -3703,7 +3703,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
self.app.ui.grb_edit_toolbar.setDisabled(False)
self.app.ui.grb_edit_toolbar.setVisible(True)
# self.app.ui.snap_toolbar.setDisabled(False)
# self.app.ui.status_toolbar.setDisabled(False)
# start with GRID toolbar activated
if self.app.ui.grid_snap_btn.isChecked() is False:

View File

@@ -214,10 +214,10 @@ class TextEditor(QtWidgets.QWidget):
filename = str(FCFileSaveDialog.get_saved_filename(
caption=_("Export Code ..."),
directory=self.app.defaults["global_last_folder"] + '/' + str(obj_name),
filter=_filter_
ext_filter=_filter_
)[0])
except TypeError:
filename = str(FCFileSaveDialog.get_saved_filename(caption=_("Export Code ..."), filter=_filter_)[0])
filename = str(FCFileSaveDialog.get_saved_filename(caption=_("Export Code ..."), ext_filter=_filter_)[0])
if filename == "":
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))