diff --git a/CHANGELOG.md b/CHANGELOG.md index ade5d0f7..ff9e1fb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ CHANGELOG for FlatCAM beta - Paint Tool - made the rest machining function for the paint single polygon method - Paint Tool - refurbished the 'rest machining' for the entire tool - Isolation Tool - fixed to work with selection of tools in the Tool Table (previously it always used all the tools in the Tool Table) +- Tools Database - added a context menu action to Save the changes to the database even if it's not in the Administration mode 14.06.2020 diff --git a/appDatabase.py b/appDatabase.py index d3174587..88a64422 100644 --- a/appDatabase.py +++ b/appDatabase.py @@ -2007,9 +2007,21 @@ class ToolsDB2(QtWidgets.QWidget): delete_tool = menu.addAction(QtGui.QIcon(self.app.resource_location + '/delete32.png'), _("Delete from DB")) delete_tool.triggered.connect(self.on_tool_delete) + sep = menu.addSeparator() + + save_changes = menu.addAction(QtGui.QIcon(self.app.resource_location + '/save_as.png'), _("Save changes")) + save_changes.triggered.connect(self.on_save_changes) + # tree_item = self.tree_widget.itemAt(pos) menu.exec(self.tree_widget.viewport().mapToGlobal(pos)) + def on_save_changes(self): + widget_name = self.app.ui.plot_tab_area.currentWidget().objectName() + if widget_name == 'database_tab': + # Tools DB saved, update flag + self.app.tools_db_changed_flag = False + self.app.tools_db_tab.on_save_tools_db() + def on_item_double_clicked(self, item, column): if column == 0 and self.ok_to_add is True: self.ok_to_add = False