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

- fixed and issue that made setting colors for the Gerber file not possible if using a translation

Marius Stanciu 6 лет назад
Родитель
Сommit
4047cc8499
2 измененных файлов с 9 добавлено и 9 удалено
  1. 8 9
      FlatCAMApp.py
  2. 1 0
      README.md

+ 8 - 9
FlatCAMApp.py

@@ -12459,33 +12459,32 @@ class App(QtCore.QObject):
 
 
     def on_set_color_action_triggered(self):
     def on_set_color_action_triggered(self):
         new_color = self.defaults['gerber_plot_fill']
         new_color = self.defaults['gerber_plot_fill']
-        act_name = self.sender().text().lower()
-
+        act_name = self.sender().text()
         sel_obj_list = self.collection.get_selected()
         sel_obj_list = self.collection.get_selected()
 
 
         if not sel_obj_list:
         if not sel_obj_list:
             return
             return
 
 
-        if act_name == 'red':
+        if act_name == _('Red'):
             new_color = '#FF0000' + \
             new_color = '#FF0000' + \
                         str(hex(self.ui.gerber_defaults_form.gerber_gen_group.pf_color_alpha_slider.value())[2:])
                         str(hex(self.ui.gerber_defaults_form.gerber_gen_group.pf_color_alpha_slider.value())[2:])
-        if act_name == 'blue':
+        if act_name == _('Blue'):
             new_color = '#0000FF' + \
             new_color = '#0000FF' + \
                         str(hex(self.ui.gerber_defaults_form.gerber_gen_group.pf_color_alpha_slider.value())[2:])
                         str(hex(self.ui.gerber_defaults_form.gerber_gen_group.pf_color_alpha_slider.value())[2:])
-        if act_name == 'yellow':
+        if act_name == _('Yellow'):
             new_color = '#FFDF00' + \
             new_color = '#FFDF00' + \
                         str(hex(self.ui.gerber_defaults_form.gerber_gen_group.pf_color_alpha_slider.value())[2:])
                         str(hex(self.ui.gerber_defaults_form.gerber_gen_group.pf_color_alpha_slider.value())[2:])
-        if act_name == 'green':
+        if act_name == _('Green'):
             new_color = '#00FF00' + \
             new_color = '#00FF00' + \
                         str(hex(self.ui.gerber_defaults_form.gerber_gen_group.pf_color_alpha_slider.value())[2:])
                         str(hex(self.ui.gerber_defaults_form.gerber_gen_group.pf_color_alpha_slider.value())[2:])
-        if act_name == 'purple':
+        if act_name == _('Purple'):
             new_color = '#FF00FF' + \
             new_color = '#FF00FF' + \
                         str(hex(self.ui.gerber_defaults_form.gerber_gen_group.pf_color_alpha_slider.value())[2:])
                         str(hex(self.ui.gerber_defaults_form.gerber_gen_group.pf_color_alpha_slider.value())[2:])
-        if act_name == 'brown':
+        if act_name == _('Brown'):
             new_color = '#A52A2A' + \
             new_color = '#A52A2A' + \
                         str(hex(self.ui.gerber_defaults_form.gerber_gen_group.pf_color_alpha_slider.value())[2:])
                         str(hex(self.ui.gerber_defaults_form.gerber_gen_group.pf_color_alpha_slider.value())[2:])
 
 
-        if act_name == 'custom':
+        if act_name == _('Custom'):
             new_color = QtGui.QColor(self.defaults['gerber_plot_fill'][:7])
             new_color = QtGui.QColor(self.defaults['gerber_plot_fill'][:7])
             c_dialog = QtWidgets.QColorDialog()
             c_dialog = QtWidgets.QColorDialog()
             plot_fill_color = c_dialog.getColor(initial=new_color)
             plot_fill_color = c_dialog.getColor(initial=new_color)

+ 1 - 0
README.md

@@ -13,6 +13,7 @@ CAD program, and create G-Code for Isolation routing.
 
 
 - fixed some bugs that are visible in Linux regarding the ArgsThread class: on app close we need to quit the QThread running the ArgsThread class and also close the opened Socket
 - fixed some bugs that are visible in Linux regarding the ArgsThread class: on app close we need to quit the QThread running the ArgsThread class and also close the opened Socket
 - make sure that the fixes above apply when rebooting app for theme change or for language change
 - make sure that the fixes above apply when rebooting app for theme change or for language change
+- fixed and issue that made setting colors for the Gerber file not possible if using a translation
 
 
 17.01.2020
 17.01.2020