From d1780acad98ac414f0f5ff5fd60d6752a05a3372 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Thu, 31 Jan 2019 15:29:05 +0200 Subject: [PATCH] - 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) --- FlatCAMApp.py | 69 +++++++++++++++++++++++++++++++++++--------- FlatCAMGUI.py | 19 ++++++++---- ObjectCollection.py | 12 ++++++++ README.md | 2 ++ share/fscreen32.png | Bin 0 -> 4965 bytes 5 files changed, 83 insertions(+), 19 deletions(-) create mode 100644 share/fscreen32.png 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 0000000000000000000000000000000000000000..061b8fd6e40461718ab1753d8d45f11959a59168 GIT binary patch literal 4965 zcmeHLYgAKL7QVqK6I*3XI<^&gwBrg|Nkc^=B8FhK6EH&6PURIq1&KVYViYhul8#GV zDuOMNh$7JnGo2y^NsB>wq_%<@$kkL}Vhcf;n5KZiBoY%s?wos1y4tQa^QZHpf67`c z&e?ZAzWtqj&OV2u8{;^0X8X=Y5M)kF^t#Om;su6Y$RB2bKeodAPVk2$*vxqwxvcRs zfeD$vCUy;iT&Z}$wQVMtQ}#qB3J_%OSNJcfd-taq2tswntXuQf!qoA8(gzD-n%}uM zq?4WN9V;$-$%5`%78OJM|Y%Zb|=L`PZ?bT#vaU#QZ_c z$$c$68sJj7S%M7DkMDHt-o%)5v#*(qRP0p3$vg!a2~J{Q$)~t$^ZMu{75|K9VxW_v zwD}JGCp_O{4SWhx+E)lChk;h?s6libELc)AIqK?THTJSWyK(sria2guioFRU?o?Be z6rP)n8+Xx3cfT}X%W!co6&ZMJ!C3fM1IGWhKsgG=k1QyFcZg2fGmn8);FU3bi;5V5 z`f8wl7X=^U7?_;+P)kEJHw~S5*zfTVa~aq(ysW~xh~HT?b_E{?@+sof|8tW5GOkn9021FSyNgB@KDr^F9MRYqJLdT*q!xxyVVL33pNu3P7J8TL_qs zkH7BPt<}rQ0AWE>Wi&+D`p6)vboWBH@qnN4&!kwav!D`RpNwE2Fx|lgSD~N*2n;{q z0y`8`G?Al@9LAxQ-3F;{Z{{R=4L<Kx(&9#5vj5KwR_;5w}P}LoU~k18D5s z5LyJFWX=iPYc=$$2MZ|3X~%8OL7SOeq~<*AgM8c`J!4eHy zu-B){A(D6nS#_n=C0gIfhhh9dm<d?2~cTiA|uO=dX3mnJ|77@?68fG2==wtHSXpAfidJN+t#T9DofJqQb zK=A*NhSZK&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