- updated the new shortcut list with the shortcuts added lately

- now the special messages in the Shell are color coded according to the level. Before they all were RED. Now the WARNINGS are yellow, ERRORS are red and SUCCESS is a dark green. Also the level is in CAPS LOCK to make them more obvious
- some more changes to GUI interface (solved issues)
- added some status bar messages in the Geometry Editor to guide the user when using the Geometry Tools
- now the '`' shortcut key that shows the 'shortcut key list' in Editors points to the same window which is created in a tab no longer as a pop-up window. This tab can be detached if needed.
This commit is contained in:
Marius Stanciu
2019-02-03 15:13:09 +02:00
committed by Marius S
parent e5ebfac3ce
commit 6ea3499d39
22 changed files with 428 additions and 409 deletions

View File

@@ -493,13 +493,13 @@ class ToolPaint(FlatCAMTool, Gerber):
try:
tool_dia = float(self.addtool_entry.get_value().replace(',', '.'))
except ValueError:
self.app.inform.emit("[error_notcl]Wrong value format entered, "
self.app.inform.emit("[ERROR_NOTCL]Wrong value format entered, "
"use a number.")
return
if tool_dia is None:
self.build_ui()
self.app.inform.emit("[warning_notcl] Please enter a tool diameter to add, in Float format.")
self.app.inform.emit("[WARNING_NOTCL] Please enter a tool diameter to add, in Float format.")
return
# construct a list of all 'tooluid' in the self.tools
@@ -523,7 +523,7 @@ class ToolPaint(FlatCAMTool, Gerber):
if float('%.4f' % tool_dia) in tool_dias:
if muted is None:
self.app.inform.emit("[warning_notcl]Adding tool cancelled. Tool already in Tool Table.")
self.app.inform.emit("[WARNING_NOTCL]Adding tool cancelled. Tool already in Tool Table.")
self.tools_table.itemChanged.connect(self.on_tool_edit)
return
else:
@@ -563,7 +563,7 @@ class ToolPaint(FlatCAMTool, Gerber):
try:
new_tool_dia = float(self.tools_table.item(row, 1).text().replace(',', '.'))
except ValueError:
self.app.inform.emit("[error_notcl]Wrong value format entered, "
self.app.inform.emit("[ERROR_NOTCL]Wrong value format entered, "
"use a number.")
return
tooluid = int(self.tools_table.item(row, 3).text())
@@ -582,7 +582,7 @@ class ToolPaint(FlatCAMTool, Gerber):
break
restore_dia_item = self.tools_table.item(row, 1)
restore_dia_item.setText(str(old_tool_dia))
self.app.inform.emit("[warning_notcl] Edit cancelled. New diameter value is already in the Tool Table.")
self.app.inform.emit("[WARNING_NOTCL] Edit cancelled. New diameter value is already in the Tool Table.")
self.build_ui()
# def on_tool_copy(self, all=None):
@@ -615,7 +615,7 @@ class ToolPaint(FlatCAMTool, Gerber):
# print("COPIED", self.paint_tools[td])
# self.build_ui()
# except AttributeError:
# self.app.inform.emit("[warning_notcl]Failed. Select a tool to copy.")
# self.app.inform.emit("[WARNING_NOTCL]Failed. Select a tool to copy.")
# self.build_ui()
# return
# except Exception as e:
@@ -623,7 +623,7 @@ class ToolPaint(FlatCAMTool, Gerber):
# # deselect the table
# # self.ui.geo_tools_table.clearSelection()
# else:
# self.app.inform.emit("[warning_notcl]Failed. Select a tool to copy.")
# self.app.inform.emit("[WARNING_NOTCL]Failed. Select a tool to copy.")
# self.build_ui()
# return
# else:
@@ -679,7 +679,7 @@ class ToolPaint(FlatCAMTool, Gerber):
self.paint_tools.pop(t, None)
except AttributeError:
self.app.inform.emit("[warning_notcl]Delete failed. Select a tool to delete.")
self.app.inform.emit("[WARNING_NOTCL]Delete failed. Select a tool to delete.")
return
except Exception as e:
log.debug(str(e))
@@ -690,7 +690,7 @@ class ToolPaint(FlatCAMTool, Gerber):
def on_paint_button_click(self):
self.app.report_usage("geometry_on_paint_button")
self.app.inform.emit("[warning_notcl]Click inside the desired polygon.")
self.app.inform.emit("[WARNING_NOTCL]Click inside the desired polygon.")
try:
overlap = float(self.paintoverlap_entry.get_value())
except ValueError:
@@ -698,7 +698,7 @@ class ToolPaint(FlatCAMTool, Gerber):
try:
overlap = float(self.paintoverlap_entry.get_value().replace(',', '.'))
except ValueError:
self.app.inform.emit("[error_notcl]Wrong value format entered, "
self.app.inform.emit("[ERROR_NOTCL]Wrong value format entered, "
"use a number.")
return
@@ -712,11 +712,11 @@ class ToolPaint(FlatCAMTool, Gerber):
try:
self.paint_obj = self.app.collection.get_by_name(str(self.obj_name))
except:
self.app.inform.emit("[error_notcl]Could not retrieve object: %s" % self.obj_name)
self.app.inform.emit("[ERROR_NOTCL]Could not retrieve object: %s" % self.obj_name)
return
if self.paint_obj is None:
self.app.inform.emit("[error_notcl]Object not found: %s" % self.paint_obj)
self.app.inform.emit("[ERROR_NOTCL]Object not found: %s" % self.paint_obj)
return
o_name = '%s_multitool_paint' % (self.obj_name)
@@ -729,7 +729,7 @@ class ToolPaint(FlatCAMTool, Gerber):
contour=contour)
if select_method == "single":
self.app.inform.emit("[warning_notcl]Click inside the desired polygon.")
self.app.inform.emit("[WARNING_NOTCL]Click inside the desired polygon.")
# use the first tool in the tool table; get the diameter
tooldia = float('%.4f' % float(self.tools_table.item(0, 1).text()))
@@ -780,14 +780,14 @@ class ToolPaint(FlatCAMTool, Gerber):
try:
paint_margin = float(self.paintmargin_entry.get_value().replace(',', '.'))
except ValueError:
self.app.inform.emit("[error_notcl]Wrong value format entered, "
self.app.inform.emit("[ERROR_NOTCL]Wrong value format entered, "
"use a number.")
return
# No polygon?
if poly is None:
self.app.log.warning('No polygon found.')
self.app.inform.emit('[warning] No polygon found.')
self.app.inform.emit('[WARNING] No polygon found.')
return
proc = self.app.proc_container.new("Painting polygon.")
@@ -832,7 +832,7 @@ class ToolPaint(FlatCAMTool, Gerber):
geo_obj.solid_geometry += list(cp.get_objects())
return cp
else:
self.app.inform.emit('[error_notcl] Geometry could not be painted completely')
self.app.inform.emit('[ERROR_NOTCL] Geometry could not be painted completely')
return None
geo_obj.solid_geometry = []
@@ -847,7 +847,7 @@ class ToolPaint(FlatCAMTool, Gerber):
except Exception as e:
log.debug("Could not Paint the polygons. %s" % str(e))
self.app.inform.emit(
"[error] Could not do Paint. Try a different combination of parameters. "
"[ERROR] Could not do Paint. Try a different combination of parameters. "
"Or a different strategy of paint\n%s" % str(e))
return
@@ -878,7 +878,7 @@ class ToolPaint(FlatCAMTool, Gerber):
# self.app.inform.emit("[success] Paint single polygon Done")
# else:
# print("[WARNING] Paint single polygon done with errors")
# self.app.inform.emit("[warning] Paint single polygon done with errors. "
# self.app.inform.emit("[WARNING] Paint single polygon done with errors. "
# "%d area(s) could not be painted.\n"
# "Use different paint parameters or edit the paint geometry and correct"
# "the issue."
@@ -889,7 +889,7 @@ class ToolPaint(FlatCAMTool, Gerber):
app_obj.new_object("geometry", name, gen_paintarea)
except Exception as e:
proc.done()
self.app.inform.emit('[error_notcl] PaintTool.paint_poly() --> %s' % str(e))
self.app.inform.emit('[ERROR_NOTCL] PaintTool.paint_poly() --> %s' % str(e))
return
proc.done()
# focus on Selected Tab
@@ -924,7 +924,7 @@ class ToolPaint(FlatCAMTool, Gerber):
try:
paint_margin = float(self.paintmargin_entry.get_value().replace(',', '.'))
except ValueError:
self.app.inform.emit("[error_notcl]Wrong value format entered, "
self.app.inform.emit("[ERROR_NOTCL]Wrong value format entered, "
"use a number.")
return
@@ -1033,7 +1033,7 @@ class ToolPaint(FlatCAMTool, Gerber):
except Exception as e:
log.debug("Could not Paint the polygons. %s" % str(e))
self.app.inform.emit(
"[error] Could not do Paint All. Try a different combination of parameters. "
"[ERROR] Could not do Paint All. Try a different combination of parameters. "
"Or a different Method of paint\n%s" % str(e))
return
@@ -1057,7 +1057,7 @@ class ToolPaint(FlatCAMTool, Gerber):
if geo_obj.tools[tooluid]['solid_geometry']:
has_solid_geo += 1
if has_solid_geo == 0:
self.app.inform.emit("[error] There is no Painting Geometry in the file.\n"
self.app.inform.emit("[ERROR] There is no Painting Geometry in the file.\n"
"Usually it means that the tool diameter is too big for the painted geometry.\n"
"Change the painting parameters and try again.")
return
@@ -1112,7 +1112,7 @@ class ToolPaint(FlatCAMTool, Gerber):
except Exception as e:
log.debug("Could not Paint the polygons. %s" % str(e))
self.app.inform.emit(
"[error] Could not do Paint All. Try a different combination of parameters. "
"[ERROR] Could not do Paint All. Try a different combination of parameters. "
"Or a different Method of paint\n%s" % str(e))
return
@@ -1142,7 +1142,7 @@ class ToolPaint(FlatCAMTool, Gerber):
if geo_obj.tools[tooluid]['solid_geometry']:
has_solid_geo += 1
if has_solid_geo == 0:
self.app.inform.emit("[error_notcl] There is no Painting Geometry in the file.\n"
self.app.inform.emit("[ERROR_NOTCL] There is no Painting Geometry in the file.\n"
"Usually it means that the tool diameter is too big for the painted geometry.\n"
"Change the painting parameters and try again.")
return