Explorar el Código

- some fixed due of recent changes and some strings changed
- added a validator for the FCColorEntry GUI element such that only the valid chars are accepted

Marius Stanciu hace 5 años
padre
commit
cb5a20fda6

+ 3 - 0
AppGUI/GUIElements.py

@@ -689,6 +689,9 @@ class FCColorEntry(QtWidgets.QFrame):
         super().__init__(**kwargs)
 
         self.entry = FCEntry()
+        regex = QtCore.QRegExp("[#A-Fa-f0-9]*")
+        validator = QtGui.QRegExpValidator(regex, self.entry)
+        self.entry.setValidator(validator)
 
         self.button = QtWidgets.QPushButton()
         self.button.setFixedSize(15, 15)

+ 0 - 15
AppGUI/preferences/general/GeneralGUIPrefGroupUI.py

@@ -349,12 +349,10 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
     # Setting selection colors (left - right) handlers
     def on_sf_color_entry(self):
         self.app.defaults['global_sel_fill'] = self.app.defaults['global_sel_fill'][7:9]
-        self.sf_color_button.setStyleSheet("background-color:%s" % str(self.app.defaults['global_sel_fill'])[:7])
 
     def on_sl_color_entry(self):
         self.app.defaults['global_sel_line'] = self.sl_color_entry.get_value()[:7] + \
             self.app.defaults['global_sel_line'][7:9]
-        self.sl_color_button.setStyleSheet("background-color:%s" % str(self.app.defaults['global_sel_line'])[:7])
 
     def on_left_right_alpha_changed(self, spinner_value):
         """
@@ -376,16 +374,10 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
     def on_alt_sf_color_entry(self):
         self.app.defaults['global_alt_sel_fill'] = self.alt_sf_color_entry.get_value()[:7] + \
                                                    self.app.defaults['global_alt_sel_fill'][7:9]
-        self.alt_sf_color_button.setStyleSheet(
-            "background-color:%s" % str(self.app.defaults['global_alt_sel_fill'])[:7]
-        )
 
     def on_alt_sl_color_entry(self):
         self.app.defaults['global_alt_sel_line'] = self.alt_sl_color_entry.get_value()[:7] + \
                                                    self.app.defaults['global_alt_sel_line'][7:9]
-        self.alt_sl_color_button.setStyleSheet(
-            "background-color:%s" % str(self.app.defaults['global_alt_sel_line'])[:7]
-        )
 
     def on_right_left_alpha_changed(self, spinner_value):
         """
@@ -406,22 +398,15 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
     # Setting Editor colors
     def on_draw_color_entry(self):
         self.app.defaults['global_draw_color'] = self.draw_color_entry.get_value()
-        self.draw_color_button.setStyleSheet("background-color:%s" % str(self.app.defaults['global_draw_color']))
 
     def on_sel_draw_color_entry(self):
         self.app.defaults['global_sel_draw_color'] = self.sel_draw_color_entry.get_value()
-        self.sel_draw_color_button.setStyleSheet(
-            "background-color:%s" % str(self.app.defaults['global_sel_draw_color']))
 
     def on_proj_color_entry(self):
         self.app.defaults['global_proj_item_color'] = self.proj_color_entry.get_value()
-        self.proj_color_button.setStyleSheet(
-            "background-color:%s" % str(self.app.defaults['global_proj_item_color']))
 
     def on_proj_color_dis_entry(self):
         self.app.defaults['global_proj_item_dis_color'] = self.proj_color_dis_entry.get_value()
-        self.proj_color_dis_button.setStyleSheet(
-            "background-color:%s" % str(self.app.defaults['global_proj_item_dis_color']))
 
     def on_layout(self, index=None, lay=None):
         """

+ 1 - 1
AppTools/ToolFiducials.py

@@ -259,7 +259,7 @@ class ToolFiducials(AppTool):
         self.grb_object_combo.is_last = True
         self.grb_object_combo.obj_type = "Gerber"
 
-        self.grbobj_label = QtWidgets.QLabel("<b>%s:</b>" % _("Copper Gerber"))
+        self.grbobj_label = QtWidgets.QLabel("<b>%s:</b>" % _("GERBER"))
         self.grbobj_label.setToolTip(
             _("Gerber Object to which will be added a copper thieving.")
         )

+ 2 - 2
AppTools/ToolRulesCheck.py

@@ -58,7 +58,7 @@ class RulesCheck(AppTool):
         self.grid_layout.setColumnStretch(1, 3)
         self.grid_layout.setColumnStretch(2, 0)
 
-        self.gerber_title_lbl = QtWidgets.QLabel('<b>%s</b>:' % _("Gerber Files"))
+        self.gerber_title_lbl = QtWidgets.QLabel('<b>%s</b>:' % _("GERBER"))
         self.gerber_title_lbl.setToolTip(
             _("Gerber objects for which to check rules.")
         )
@@ -196,7 +196,7 @@ class RulesCheck(AppTool):
 
         self.grid_layout.addWidget(QtWidgets.QLabel(""), 8, 0, 1, 3)
 
-        self.excellon_title_lbl = QtWidgets.QLabel('<b>%s</b>:' % _("Excellon Objects"))
+        self.excellon_title_lbl = QtWidgets.QLabel('<b>%s</b>:' % _("EXCELLON"))
         self.excellon_title_lbl.setToolTip(
             _("Excellon objects for which to check rules.")
         )

+ 2 - 2
AppTools/ToolSub.py

@@ -67,7 +67,7 @@ class ToolSub(AppTool):
         form_layout = QtWidgets.QFormLayout()
         self.tools_box.addLayout(form_layout)
 
-        self.gerber_title = QtWidgets.QLabel("<b>%s</b>" % _("Gerber Objects"))
+        self.gerber_title = QtWidgets.QLabel("<b>%s</b>" % _("GERBER"))
         form_layout.addRow(self.gerber_title)
 
         # Target Gerber Object
@@ -122,7 +122,7 @@ class ToolSub(AppTool):
         form_geo_layout = QtWidgets.QFormLayout()
         self.tools_box.addLayout(form_geo_layout)
 
-        self.geo_title = QtWidgets.QLabel("<b>%s</b>" % _("Geometry Objects"))
+        self.geo_title = QtWidgets.QLabel("<b>%s</b>" % _("GEOMETRY"))
         form_geo_layout.addRow(self.geo_title)
 
         # Target Geometry Object

+ 1 - 1
App_Main.py

@@ -8906,7 +8906,7 @@ class App(QtCore.QObject):
         """
         self.log.debug("Plot_all()")
         if muted is not True:
-            self.inform[str, bool].emit('[success] %s...' % _("Redrawing all objects"), False)
+            self.inform[str, bool].emit('%s...' % _("Redrawing all objects"), False)
 
         for plot_obj in self.collection.get_list():
             def worker_task(obj):

+ 2 - 0
CHANGELOG.md

@@ -25,6 +25,8 @@ CHANGELOG for FlatCAM beta
 - in Preferences replaced the widgets that sets colors with a compound one (from David Robertson)
 - made Progressive plotting work in Isolation Tool
 - fix an issue with progressive plotted shapes not being deleted on the end of the job
+- some fixed due of recent changes and some strings changed
+- added a validator for the FCColorEntry GUI element such that only the valid chars are accepted
 
 31.05.2020