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

- added shortcut key 'J' (jump to location) in Editors and added an icon to the dialog popup window

Marius Stanciu 7 лет назад
Родитель
Сommit
098de7f030
4 измененных файлов с 28 добавлено и 4 удалено
  1. 3 1
      FlatCAMApp.py
  2. 17 1
      FlatCAMGUI.py
  3. 3 2
      GUIElements.py
  4. 5 0
      README.md

+ 3 - 1
FlatCAMApp.py

@@ -3670,7 +3670,9 @@ class App(QtCore.QObject):
         """
         self.report_usage("on_jump_to()")
 
-        dia_box = Dialog_box(title="Jump to Coordinates", label="Enter the coordinates in format X,Y:")
+        dia_box = Dialog_box(title="Jump to ...",
+                             label="Enter the coordinates in format X,Y:",
+                             icon=QtGui.QIcon('share/jump_to16.png'))
 
         if dia_box.ok is True:
             try:

+ 17 - 1
FlatCAMGUI.py

@@ -1047,6 +1047,10 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
 			<td height="20"><strong>I</strong></td>
 			<td>&nbsp;Paint Tool</td>
 		</tr>
+		<tr height="20">
+			<td height="20"><strong>J</strong></td>
+			<td>&nbsp;Jump to Location (x, y)</td>
+		</tr>
 		<tr height="20">
 			<td height="20"><strong>K</strong></td>
 			<td>&nbsp;Toggle Corner Snap</td>
@@ -1068,7 +1072,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
 			<td>&nbsp;Draw a Path</td>
 		</tr>
 		<tr height="20">
-			<td height="20">R</td>
+			<td height="20"><strong>R</strong></td>
 			<td>&nbsp;Draw Rectangle</td>
 		</tr>
 		<tr height="20">
@@ -1134,6 +1138,10 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
 			<td height="20"><strong>D</strong></td>
 			<td>&nbsp;Add Drill</td>
 		</tr>
+		<tr height="20">
+			<td height="20"><strong>J</strong></td>
+			<td>&nbsp;Jump to Location (x, y)</td>
+		</tr>
 		<tr height="20">
 			<td height="20"><strong>M</strong></td>
 			<td>&nbsp;Move Drill(s)</td>
@@ -1940,6 +1948,10 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
                 if key == QtCore.Qt.Key_I or key == 'I':
                     self.app.geo_editor.select_tool('paint')
 
+                # Jump to coords
+                if key == QtCore.Qt.Key_J or key == 'J':
+                    self.app.on_jump_to()
+
                 # Corner Snap
                 if key == QtCore.Qt.Key_K or key == 'K':
                     self.app.geo_editor.on_corner_snap()
@@ -2162,6 +2174,10 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
                     self.app.ui.grid_snap_btn.trigger()
                     return
 
+                # Jump to coords
+                if key == QtCore.Qt.Key_J or key == 'J':
+                    self.app.on_jump_to()
+
                 # Corner Snap
                 if key == QtCore.Qt.Key_K or key == 'K':
                     self.app.exc_editor.launched_from_shortcuts = True

+ 3 - 2
GUIElements.py

@@ -1212,7 +1212,7 @@ class FCDoubleSpinner(QtWidgets.QDoubleSpinBox):
 
 
 class Dialog_box(QtWidgets.QWidget):
-    def __init__(self, title=None, label=None):
+    def __init__(self, title=None, label=None, icon=None):
         """
 
         :param title: string with the window title
@@ -1223,7 +1223,8 @@ class Dialog_box(QtWidgets.QWidget):
         self.ok = False
 
         dialog_box = QtWidgets.QInputDialog()
-        dialog_box.setFixedWidth(270)
+        dialog_box.setFixedWidth(290)
+        self.setWindowIcon(icon)
 
         self.location, self.ok = dialog_box.getText(self, title, label)
 

+ 5 - 0
README.md

@@ -9,6 +9,10 @@ CAD program, and create G-Code for Isolation routing.
 
 =================================================
 
+15.02.2019
+
+- 
+
 14.02.2019
 
 - added total travel distance for CNCJob object created from Excellon Object in the CNCJob Selected tab
@@ -17,6 +21,7 @@ CAD program, and create G-Code for Isolation routing.
 - updated the function for the project context menu 'Generate CNC' menu entry (Action) to use the modernized function FlatCAMObj.FlatCAMGeometry.on_generatecnc_button_click()
 - when linked, the grid snap on Y will copy the value in grid snap on X in real time
 - in Gerber aperture table now the values are displayed in the current units set in FlatCAM
+- added shortcut key 'J' (jump to location) in Editors and added an icon to the dialog popup window
 
 13.02.2019