- fixed issues in the Tools Database due of recent changes in how the data structure is created
- made sure that the right tools go only to the intended use, in Tools Database otherwise an error status message is created and Tools DB is closed on adding a wrong tool - fixed the usage for Tools Database in Unix-like OS's - done some modest refactoring - fixed the Search and Add feature in Geometry Object UI
This commit is contained in:
@@ -836,7 +836,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
# if the sender is in the column with index 2 then we update the tool_type key
|
||||
if cw_col == 2:
|
||||
tt = cw.currentText()
|
||||
typ = 'Iso' if tt == 'V' else "Rough"
|
||||
typ = 'Iso' if tt == 'V' else _("Rough")
|
||||
|
||||
self.ncc_tools[current_uid].update({
|
||||
'type': typ,
|
||||
@@ -976,7 +976,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
def on_tool_add(self, custom_dia=None):
|
||||
self.blockSignals(True)
|
||||
|
||||
filename = self.app.data_path + '\\tools_db.FlatDB'
|
||||
filename = self.app.tools_database_path()
|
||||
|
||||
new_tools_dict = deepcopy(self.default_data)
|
||||
updated_tooldia = None
|
||||
@@ -1042,7 +1042,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
|
||||
offset = 'Path'
|
||||
offset_val = 0.0
|
||||
typ = "Rough"
|
||||
typ = _("Rough")
|
||||
tool_type = 'V'
|
||||
# look in database tools
|
||||
for db_tool, db_tool_val in tools_db_dict.items():
|
||||
@@ -3721,7 +3721,12 @@ class NonCopperClear(AppTool, Gerber):
|
||||
"""
|
||||
tool_from_db = deepcopy(tool)
|
||||
|
||||
if tool['data']['tool_target'] != _("NCC"):
|
||||
if tool['data']['tool_target'] not in [0, 5]: # [General, NCC]
|
||||
for idx in range(self.app.ui.plot_tab_area.count()):
|
||||
if self.app.ui.plot_tab_area.tabText(idx) == _("Tools Database"):
|
||||
wdg = self.app.ui.plot_tab_area.widget(idx)
|
||||
wdg.deleteLater()
|
||||
self.app.ui.plot_tab_area.removeTab(idx)
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Selected tool can't be used here. Pick another."))
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user