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

- made units change from shortcut key 'Q' not to affect the preferences

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

+ 9 - 8
FlatCAMApp.py

@@ -3521,7 +3521,7 @@ class App(QtCore.QObject):
     def set_screen_units(self, units):
         self.ui.units_label.setText("[" + self.defaults["units"].lower() + "]")
 
-    def on_toggle_units(self):
+    def on_toggle_units(self, no_pref=False):
         """
         Callback for the Units radio-button change in the Options tab.
         Changes the application's default units or the current project's units.
@@ -3659,13 +3659,14 @@ class App(QtCore.QObject):
         response = msgbox.clickedButton()
 
         if response == bt_ok:
-            self.options_read_form()
-            scale_options(factor)
-            self.options_write_form()
-
-            self.defaults_read_form()
-            scale_defaults(factor)
-            self.defaults_write_form()
+            if no_pref is False:
+                self.options_read_form()
+                scale_options(factor)
+                self.options_write_form()
+
+                self.defaults_read_form()
+                scale_defaults(factor)
+                self.defaults_write_form()
 
             self.should_we_save = True
 

+ 4 - 0
README.md

@@ -9,6 +9,10 @@ CAD program, and create G-Code for Isolation routing.
 
 =================================================
 
+6.05.2019
+
+- made units change from shortcut key 'Q' not to affect the preferences
+
 5.05.2019
 
 - another fix for bug in clear geometry processing for Gerber apertures

+ 1 - 1
flatcamGUI/FlatCAMGUI.py

@@ -2290,7 +2290,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
                         self.app.ui.general_defaults_form.general_app_group.units_radio.set_value("IN")
                     else:
                         self.app.ui.general_defaults_form.general_app_group.units_radio.set_value("MM")
-                    self.app.on_toggle_units()
+                    self.app.on_toggle_units(no_pref=True)
 
                 # Rotate Object by 90 degree CW
                 if key == QtCore.Qt.Key_R: