- changed the icons for the grid snap in the status bar

- moved some of the methods from FlatCAMApp.App to flatcamGUI.FlatCAMGUI class
This commit is contained in:
Marius Stanciu
2020-05-02 00:09:48 +03:00
committed by Marius
parent f4617034af
commit bdf2192d00
8 changed files with 33 additions and 30 deletions

View File

@@ -506,7 +506,6 @@ class App(QtCore.QObject):
QtCore.QObject.__init__(self)
self.ui = FlatCAMGUI(self)
self.on_grid_snap_triggered(state=True)
theme_settings = QtCore.QSettings("Open Source", "FlatCAM")
if theme_settings.contains("theme"):
@@ -1074,9 +1073,6 @@ class App(QtCore.QObject):
# signal emitted when a tab is closed in the Plot Area
self.ui.plot_tab_area.tab_closed_signal.connect(self.on_plot_area_tab_closed)
self.ui.grid_snap_btn.triggered.connect(self.on_grid_snap_triggered)
self.ui.snap_infobar_label.clicked.connect(self.on_grid_icon_snap_clicked)
# signal to close the application
self.close_app_signal.connect(self.kill_app)
# ################################# FINISHED CONNECTING SIGNALS #############################################
@@ -4634,7 +4630,7 @@ class App(QtCore.QObject):
self.defaults.report_usage("on_toggle_grid()")
self.ui.grid_snap_btn.trigger()
self.on_grid_snap_triggered(state=True)
self.ui.on_grid_snap_triggered(state=True)
def on_toggle_grid_lines(self):
self.defaults.report_usage("on_toggle_grd_lines()")
@@ -10622,29 +10618,6 @@ class App(QtCore.QObject):
update_colors=(new_color, new_line_color)
)
def on_grid_snap_triggered(self, state):
"""
:param state: A parameter with the state of the grid, boolean
:return:
"""
if state:
self.ui.snap_infobar_label.setPixmap(QtGui.QPixmap(self.resource_location + '/snap_filled_16.png'))
else:
self.ui.snap_infobar_label.setPixmap(QtGui.QPixmap(self.resource_location + '/snap_16.png'))
self.ui.snap_infobar_label.clicked_state = state
def on_grid_icon_snap_clicked(self):
"""
Slot called by clicking a GUI element, in this case a FCLabel
:return:
"""
if isinstance(self.sender(), FCLabel):
self.ui.grid_snap_btn.trigger()
def generate_cnc_job(self, objects):
"""
Slot that will be called by clicking an entry in the contextual menu generated in the Project Tab tree