From e19af486b370b19fc5f32edc4484164d2cc3a89c Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Mon, 28 Jan 2019 03:24:06 +0200 Subject: [PATCH] - added key shortcuts for Open Manual = F1 and for Open Online VideoHelp = F2 --- FlatCAMApp.py | 15 +++++++++++++-- FlatCAMGUI.py | 6 +++--- ObjectCollection.py | 9 +++++++++ README.md | 2 +- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/FlatCAMApp.py b/FlatCAMApp.py index e53d5d24..46bdfaa8 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -3757,6 +3757,14 @@ class App(QtCore.QObject): return else: + if event.key == 'F1': + webbrowser.open(self.manual_url) + return + + if event.key == 'F2': + webbrowser.open(self.video_url) + return + if event.key == self.defaults['fit_key']: # 1 self.on_zoom_fit(None) return @@ -3896,8 +3904,11 @@ class App(QtCore.QObject): ALT+P: Paint Area Tool
ALT+R: Transformation Tool
ALT+U: Cutout PCB Tool
-ALT+Z: Panelize PCB Tool
-Del: Delete Obj''' +
+F1: Open Online Manual
+F2: Open Online Tutorials
+Del: Delete Obj +''' helpbox = QtWidgets.QMessageBox() helpbox.setText(msg) diff --git a/FlatCAMGUI.py b/FlatCAMGUI.py index 6ad444ad..cba08277 100644 --- a/FlatCAMGUI.py +++ b/FlatCAMGUI.py @@ -336,10 +336,10 @@ class FlatCAMGUI(QtWidgets.QMainWindow): self.menuhelp = self.menu.addMenu('&Help') self.menuhelp_about = self.menuhelp.addAction(QtGui.QIcon('share/tv16.png'), 'About FlatCAM') self.menuhelp_home = self.menuhelp.addAction(QtGui.QIcon('share/home16.png'), 'Home') - self.menuhelp_manual = self.menuhelp.addAction(QtGui.QIcon('share/globe16.png'), 'Manual') + self.menuhelp_manual = self.menuhelp.addAction(QtGui.QIcon('share/globe16.png'), 'Manual\tF1') self.menuhelp.addSeparator() - self.menuhelp_shortcut_list = self.menuhelp.addAction(QtGui.QIcon('share/shortcuts24.png'), 'Shortcuts List') - self.menuhelp_videohelp = self.menuhelp.addAction(QtGui.QIcon('share/videohelp24.png'), 'See on YouTube') + self.menuhelp_shortcut_list = self.menuhelp.addAction(QtGui.QIcon('share/shortcuts24.png'), 'Shortcuts List\t`') + self.menuhelp_videohelp = self.menuhelp.addAction(QtGui.QIcon('share/videohelp24.png'), 'See on YouTube\tF2') ################################ ### Project Tab Context menu ### diff --git a/ObjectCollection.py b/ObjectCollection.py index 2db3610b..9c955b5a 100644 --- a/ObjectCollection.py +++ b/ObjectCollection.py @@ -12,6 +12,7 @@ import inspect # TODO: Remove import FlatCAMApp from PyQt5 import QtGui, QtCore, QtWidgets from PyQt5.QtCore import Qt +import webbrowser class KeySensitiveListView(QtWidgets.QTreeView): @@ -345,6 +346,14 @@ class ObjectCollection(QtCore.QAbstractItemModel): return else: + # Open Manual + if key == QtCore.Qt.Key_F1: + webbrowser.open(self.app.manual_url) + + # Open Video Help + if key == QtCore.Qt.Key_F2: + webbrowser.open(self.app.video_url) + # Zoom Fit if key == QtCore.Qt.Key_1: self.app.on_zoom_fit(None) diff --git a/README.md b/README.md index 77e2c457..23e17b88 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ CAD program, and create G-Code for Isolation routing. - fixed the FlatCAMGerber.merge() function - added a new menu entry for the Gerber Join function: Edit -> Conversions -> "Join Gerber(s) to Gerber" allowing joining Gerber objects into a final Gerber object - moved Paint Tool defaults from Geometry section to the Tools section in Edit -> Preferences - +- added key shortcuts for Open Manual = F1 and for Open Online VideoHelp = F2 27.01.2018