Explorar o código

Merged in marius_stanciu/flatcam_mpl/TCL_edit_focus (pull request #93)

TCL edit focus
Marius Stanciu %!s(int64=7) %!d(string=hai) anos
pai
achega
4bacc22b1f
Modificáronse 2 ficheiros con 7 adicións e 5 borrados
  1. 5 5
      camlib.py
  2. 2 0
      termwidget.py

+ 5 - 5
camlib.py

@@ -2970,7 +2970,7 @@ class CNCjob(Geometry):
         log.debug("Creating CNC Job from Excellon...")
 
         # Tools
-        
+
         # Sort tools by diameter. items() -> [('name', diameter), ...]
         sorted_tools = sorted(exobj.tools.items(), key=lambda tl: tl[1])
 
@@ -2983,7 +2983,7 @@ class CNCjob(Geometry):
 
             # Create a sorted list of selected tools from the sorted_tools list
             tools = [i for i, j in sorted_tools for k in selected_tools if i == k]
-            log.debug("Tools selected and sorted are: %s" % str(tools)) 
+            log.debug("Tools selected and sorted are: %s" % str(tools))
 
         # Points (Group by tool)
         points = {}
@@ -2994,7 +2994,7 @@ class CNCjob(Geometry):
                 except KeyError:
                     points[drill['tool']] = [drill['point']]
 
-        #log.debug("Found %d drills." % len(points))
+        # log.debug("Found %d drills." % len(points))
         self.gcode = []
 
         # Basic G-Code macros
@@ -3016,7 +3016,7 @@ class CNCjob(Geometry):
         else:
             gcode += "M03\n"  # Spindle start
 
-        #gcode += self.pausecode + "\n"
+        # gcode += self.pausecode + "\n"
 
         for tool in tools:
 
@@ -3187,7 +3187,7 @@ class CNCjob(Geometry):
                             log.warning("G-code generation not implemented for %s" % (str(type(geo))))
 
                         # Reverse coordinates if not a loop so we can continue
-                        # cutting without returning to the beginhing.
+                        # cutting without returning to the beginning.
                         if type(geo) == LineString:
                             geo.coords = list(geo.coords)[::-1]
                             reverse = True

+ 2 - 0
termwidget.py

@@ -132,6 +132,7 @@ class TermWidget(QWidget):
             self._edit.setPlainText("...proccessing... [%s]" % detail)
 
         self._edit.setDisabled(True)
+        self._edit.setFocus()
 
     def close_proccessing(self):
         """
@@ -143,6 +144,7 @@ class TermWidget(QWidget):
         self._edit.setTextBackgroundColor(Qt.white)
         self._edit.setPlainText('')
         self._edit.setDisabled(False)
+        self._edit.setFocus()
 
     def _append_to_browser(self, style, text):
         """