Просмотр исходного кода

- added key shortcuts for Open Manual = F1 and for Open Online VideoHelp = F2

Marius Stanciu 7 лет назад
Родитель
Сommit
e19af486b3
4 измененных файлов с 26 добавлено и 6 удалено
  1. 13 2
      FlatCAMApp.py
  2. 3 3
      FlatCAMGUI.py
  3. 9 0
      ObjectCollection.py
  4. 1 1
      README.md

+ 13 - 2
FlatCAMApp.py

@@ -3757,6 +3757,14 @@ class App(QtCore.QObject):
 
 
             return
             return
         else:
         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
             if event.key == self.defaults['fit_key']:  # 1
                 self.on_zoom_fit(None)
                 self.on_zoom_fit(None)
                 return
                 return
@@ -3896,8 +3904,11 @@ class App(QtCore.QObject):
 <b>ALT+P:</b>    Paint Area Tool<br>
 <b>ALT+P:</b>    Paint Area Tool<br>
 <b>ALT+R:</b>    Transformation Tool<br>
 <b>ALT+R:</b>    Transformation Tool<br>
 <b>ALT+U:</b>    Cutout PCB Tool<br>
 <b>ALT+U:</b>    Cutout PCB Tool<br>
-<b>ALT+Z:</b>    Panelize PCB Tool<br>
-<b>Del:</b>      Delete Obj'''
+<br>
+<b>F1:</b>       Open Online Manual<br>
+<b>F2:</b>       Open Online Tutorials<br>
+<b>Del:</b>      Delete Obj
+'''
 
 
         helpbox = QtWidgets.QMessageBox()
         helpbox = QtWidgets.QMessageBox()
         helpbox.setText(msg)
         helpbox.setText(msg)

+ 3 - 3
FlatCAMGUI.py

@@ -336,10 +336,10 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
         self.menuhelp = self.menu.addMenu('&Help')
         self.menuhelp = self.menu.addMenu('&Help')
         self.menuhelp_about = self.menuhelp.addAction(QtGui.QIcon('share/tv16.png'), 'About FlatCAM')
         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_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.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 ###
         ### Project Tab Context menu ###

+ 9 - 0
ObjectCollection.py

@@ -12,6 +12,7 @@ import inspect  # TODO: Remove
 import FlatCAMApp
 import FlatCAMApp
 from PyQt5 import QtGui, QtCore, QtWidgets
 from PyQt5 import QtGui, QtCore, QtWidgets
 from PyQt5.QtCore import Qt
 from PyQt5.QtCore import Qt
+import webbrowser
 
 
 
 
 class KeySensitiveListView(QtWidgets.QTreeView):
 class KeySensitiveListView(QtWidgets.QTreeView):
@@ -345,6 +346,14 @@ class ObjectCollection(QtCore.QAbstractItemModel):
                 return
                 return
 
 
         else:
         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
             # Zoom Fit
             if key == QtCore.Qt.Key_1:
             if key == QtCore.Qt.Key_1:
                 self.app.on_zoom_fit(None)
                 self.app.on_zoom_fit(None)

+ 1 - 1
README.md

@@ -14,7 +14,7 @@ CAD program, and create G-Code for Isolation routing.
 - fixed the FlatCAMGerber.merge() function
 - 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
 - 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
 - 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
 27.01.2018