diff --git a/CHANGELOG.md b/CHANGELOG.md index 8057c9ce..b171fa51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ CHANGELOG for FlatCAM beta - in Geometry Properties UI restored the plot functionality - in Tool Cutout fixed issues when using a negative value for the Margin parameter when the cutout object is a Gerber object - fixed the Gerber parser such that when it encounter an aperture with size 0.0 it will replace it with the smallest number that is still displayed which is (10 ** -self.decimals); previously it replaced with a too small number (1e-12) +- fixed the Distance adn Minimal Distance Tools not showing 17.11.2020 diff --git a/appTools/ToolDistance.py b/appTools/ToolDistance.py index 3fcf10fc..466499c8 100644 --- a/appTools/ToolDistance.py +++ b/appTools/ToolDistance.py @@ -97,8 +97,6 @@ class Distance(AppTool): if self.app.tool_tab_locked is True: return - self.app.ui.notebook.setTabText(2, _("Distance Tool")) - # if the splitter is hidden, display it if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) @@ -114,6 +112,20 @@ class Distance(AppTool): AppTool.install(self, icon, separator, shortcut='Ctrl+M', **kwargs) def set_tool_ui(self): + # if the Tool Tab is hidden display it, else hide it but only if the objectName is the same + found_idx = None + for idx in range(self.app.ui.notebook.count()): + if self.app.ui.notebook.widget(idx).objectName() == "tool_tab": + found_idx = idx + break + # show the Tab + if not found_idx: + self.app.ui.notebook.addTab(self.app.ui.tool_tab, _("Tool")) + # focus on Tool Tab + self.app.ui.notebook.setCurrentWidget(self.app.ui.tool_tab) + + self.app.ui.notebook.setTabText(2, _("Distance Tool")) + # Remove anything else in the appGUI self.app.ui.tool_scroll_area.takeWidget() diff --git a/appTools/ToolDistanceMin.py b/appTools/ToolDistanceMin.py index 70a236f1..725a7429 100644 --- a/appTools/ToolDistanceMin.py +++ b/appTools/ToolDistanceMin.py @@ -53,8 +53,6 @@ class DistanceMin(AppTool): if self.app.tool_tab_locked is True: return - self.app.ui.notebook.setTabText(2, _("Minimum Distance Tool")) - # if the splitter is hidden, display it if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) @@ -70,6 +68,20 @@ class DistanceMin(AppTool): AppTool.install(self, icon, separator, shortcut='Shift+M', **kwargs) def set_tool_ui(self): + # if the Tool Tab is hidden display it, else hide it but only if the objectName is the same + found_idx = None + for idx in range(self.app.ui.notebook.count()): + if self.app.ui.notebook.widget(idx).objectName() == "tool_tab": + found_idx = idx + break + # show the Tab + if not found_idx: + self.app.ui.notebook.addTab(self.app.ui.tool_tab, _("Tool")) + # focus on Tool Tab + self.app.ui.notebook.setCurrentWidget(self.app.ui.tool_tab) + + self.app.ui.notebook.setTabText(2, _("Minimum Distance Tool")) + # Remove anything else in the appGUI self.app.ui.tool_scroll_area.takeWidget() diff --git a/app_Main.py b/app_Main.py index 3e954580..3f0963bd 100644 --- a/app_Main.py +++ b/app_Main.py @@ -1019,7 +1019,7 @@ class App(QtCore.QObject): # ########################################## Tools and Plugins ############################################## # ########################################################################################################### - self.shell = None + self.shell = FCShell(app=self, version=self.version) self.dblsidedtool = None self.distance_tool = None self.distance_min_tool = None @@ -1804,7 +1804,7 @@ class App(QtCore.QObject): :return: None """ - # shell tool has t obe initialized always first because other tools print messages in the Shell Dock + # shell tool has to be initialized always first because other tools print messages in the Shell Dock self.shell = FCShell(app=self, version=self.version) self.distance_tool = Distance(self)