diff --git a/FlatCAMApp.py b/FlatCAMApp.py index 7820de11..fea642b7 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -1020,12 +1020,13 @@ class App(QtCore.QObject): self.ui.menuoptions_transform_flipy.triggered.connect(self.on_flipy) - self.ui.menuviewdisableall.triggered.connect(lambda: self.disable_plots(self.collection.get_list())) - self.ui.menuviewdisableother.triggered.connect(lambda: self.disable_plots(self.collection.get_non_selected())) - self.ui.menuviewenable.triggered.connect(lambda: self.enable_plots(self.collection.get_list())) + self.ui.menuviewdisableall.triggered.connect(self.disable_all_plots) + self.ui.menuviewdisableother.triggered.connect(self.disable_other_plots) + self.ui.menuviewenable.triggered.connect(self.enable_all_plots) self.ui.menuview_zoom_fit.triggered.connect(self.on_zoom_fit) self.ui.menuview_zoom_in.triggered.connect(lambda: self.plotcanvas.zoom(1 / 1.5)) self.ui.menuview_zoom_out.triggered.connect(lambda: self.plotcanvas.zoom(1.5)) + self.ui.menuview_toggle_fscreen.triggered.connect(self.on_fullscreen) self.ui.menuview_toggle_grid.triggered.connect(self.on_toggle_grid) self.ui.menuview_toggle_axis.triggered.connect(self.on_toggle_axis) self.ui.menuview_toggle_workspace.triggered.connect(self.on_workspace_menu) @@ -1314,6 +1315,9 @@ class App(QtCore.QObject): # Variable to hold the status of the axis self.toggle_axis = True + # Variable to store the status of the fullscreen event + self.toggle_fscreen = False + self.cursor = None # Variable to store the GCODE that was edited @@ -2737,6 +2741,17 @@ class App(QtCore.QObject): # app restart section pass + def on_fullscreen(self): + if self.toggle_fscreen is False: + for tb in self.ui.findChildren(QtWidgets.QToolBar): + tb.setVisible(False) + self.ui.notebook.setVisible(False) + self.toggle_fscreen = True + else: + self.restore_toolbar_view() + self.ui.notebook.setVisible(True) + self.toggle_fscreen = False + def on_toggle_axis(self): if self.toggle_axis is False: self.plotcanvas.v_line.set_data(color=(0.70, 0.3, 0.3, 1.0)) @@ -3674,17 +3689,7 @@ class App(QtCore.QObject): if index.internalPointer().parent_item != self.collection.root_item: self.ui.notebook.setCurrentWidget(self.ui.selected_tab) - def on_zoom_fit(self, event): - """ - Callback for zoom-out request. This can be either from the corresponding - toolbar button or the '1' key when the canvas is focused. Calls ``self.adjust_axes()`` - with axes limits from the geometry bounds of all objects. - :param event: Ignored. - :return: None - """ - - self.plotcanvas.fit_view() def grid_status(self): if self.ui.grid_snap_btn.isChecked(): @@ -3739,6 +3744,16 @@ class App(QtCore.QObject): return elif self.key_modifiers == QtCore.Qt.AltModifier: # place holder for further shortcut key + + if event.key == '1': + self.enable_all_plots() + + if event.key == '2': + self.disable_all_plots() + + if event.key == '3': + self.disable_other_plots() + if event.key == 'C': self.calculator_tool.run() @@ -3763,6 +3778,9 @@ class App(QtCore.QObject): if event.key == 'Z': self.panelize_tool.run() + if event.key == 'F10': + self.on_fullscreen() + elif self.key_modifiers == QtCore.Qt.ShiftModifier: # place holder for further shortcut key @@ -3946,6 +3964,7 @@ class App(QtCore.QObject): ALT+P: Paint Area Tool
ALT+R: Transformation Tool
ALT+U: Cutout PCB Tool
+ALT+F10: Toggle Full Screen

F1: Open Online Manual
F2: Open Online Tutorials
@@ -6170,6 +6189,30 @@ class App(QtCore.QObject): "info" ) + def on_zoom_fit(self, event): + """ + Callback for zoom-out request. This can be either from the corresponding + toolbar button or the '1' key when the canvas is focused. Calls ``self.adjust_axes()`` + with axes limits from the geometry bounds of all objects. + + :param event: Ignored. + :return: None + """ + + self.plotcanvas.fit_view() + + def disable_all_plots(self): + self.disable_plots(self.collection.get_list()) + self.inform.emit("[success]All plots disabled.") + + def disable_other_plots(self): + self.disable_plots(self.collection.get_non_selected()) + self.inform.emit("[success]All non selected plots disabled.") + + def enable_all_plots(self): + self.enable_plots(self.collection.get_list()) + self.inform.emit("[success]All plots enabled.") + # TODO: FIX THIS ''' By default this is not threaded diff --git a/FlatCAMGUI.py b/FlatCAMGUI.py index 0562af8f..78294652 100644 --- a/FlatCAMGUI.py +++ b/FlatCAMGUI.py @@ -254,17 +254,21 @@ class FlatCAMGUI(QtWidgets.QMainWindow): ### View ### self.menuview = self.menu.addMenu('&View') - self.menuviewenable = self.menuview.addAction(QtGui.QIcon('share/replot16.png'), 'Enable all plots') + self.menuviewenable = self.menuview.addAction(QtGui.QIcon('share/replot16.png'), 'Enable all plots\tALT+1') self.menuviewdisableall = self.menuview.addAction(QtGui.QIcon('share/clear_plot16.png'), - 'Disable all plots') + 'Disable all plots\tALT+2') self.menuviewdisableother = self.menuview.addAction(QtGui.QIcon('share/clear_plot16.png'), - 'Disable non-selected') + 'Disable non-selected\tALT+3') # Separator self.menuview.addSeparator() self.menuview_zoom_fit = self.menuview.addAction(QtGui.QIcon('share/zoom_fit32.png'), "&Zoom Fit\t1") self.menuview_zoom_in = self.menuview.addAction(QtGui.QIcon('share/zoom_in32.png'), "&Zoom In\t2") self.menuview_zoom_out = self.menuview.addAction(QtGui.QIcon('share/zoom_out32.png'), "&Zoom Out\t3") + self.menuview.addSeparator() + self.menuview_toggle_fscreen = self.menuview.addAction( + QtGui.QIcon('share/fscreen32.png'), "&Toggle FullScreen\tALT+F10") + self.menuview.addSeparator() self.menuview_toggle_grid = self.menuview.addAction(QtGui.QIcon('share/grid32.png'), "&Toggle Grid\tG") self.menuview_toggle_axis = self.menuview.addAction(QtGui.QIcon('share/axis32.png'), "&Toggle Axis\tSHIFT+G") @@ -1801,7 +1805,8 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI): self.optimization_time_label.setToolTip( "When OR-Tools Metaheuristic (MH) is enabled there is a\n" "maximum threshold for how much time is spent doing the\n" - "path optimization. This max duration is set here." + "path optimization. This max duration is set here.\n" + "In seconds." ) @@ -1976,7 +1981,8 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): fplungelabel.setToolTip( "By checking this, the vertical move from\n" "Z_Toolchange to Z_move is done with G0,\n" - "meaning the fastest speed available." + "meaning the fastest speed available.\n" + "WARNING: the move is done at Toolchange X,Y coords." ) self.fplunge_cb = FCCheckBox() grid2.addWidget(fplungelabel, 13, 0) @@ -2283,7 +2289,8 @@ class GeometryOptPrefGroupUI(OptionsGroupUI): fplungelabel.setToolTip( "By checking this, the vertical move from\n" "Z_Toolchange to Z_move is done with G0,\n" - "meaning the fastest speed available." + "meaning the fastest speed available.\n" + "WARNING: the move is done at Toolchange X,Y coords." ) self.fplunge_cb = FCCheckBox() grid1.addWidget(fplungelabel, 17, 0) diff --git a/ObjectCollection.py b/ObjectCollection.py index 9c955b5a..29bf7e14 100644 --- a/ObjectCollection.py +++ b/ObjectCollection.py @@ -325,6 +325,18 @@ class ObjectCollection(QtCore.QAbstractItemModel): self.app.on_skewy() return elif modifiers == QtCore.Qt.AltModifier: + # Eanble all plots + if key == Qt.Key_1: + self.app.enable_all_plots() + + # Disable all plots + if key == Qt.Key_2: + self.app.disable_all_plots() + + # Disable all other plots + if key == Qt.Key_3: + self.app.disable_other_plots() + # 2-Sided PCB Tool if key == QtCore.Qt.Key_D: self.app.dblsidedtool.run() diff --git a/README.md b/README.md index baf2230d..4e3a6107 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ CAD program, and create G-Code for Isolation routing. 31.01.2019 - added a parameter ('Fast plunge' in Edit -> Preferences -> Geometry Options and Excellon Options) to control if the fast move to Z_move is done or not +- added new function to toggle fullscreen status in Menu -> View -> Toggle Full Screen. Shortcut key: Alt+F10 +- added key shortcuts for Enable Plots, Disable Plots and Disable other plots functions (Alt+1, Alt+2, Alt+3) 30.01.2019 diff --git a/share/fscreen32.png b/share/fscreen32.png new file mode 100644 index 00000000..061b8fd6 Binary files /dev/null and b/share/fscreen32.png differ