From cc28ccb339046f4605eadc50b27adbcbefa74ba1 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Fri, 11 Mar 2022 14:05:31 +0200 Subject: [PATCH] - made sure that on canvas context menu pop-up, some actions are disabled if there is no object selected --- CHANGELOG.md | 3 ++- app_Main.py | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab71a6b0..a39c19c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ CHANGELOG for FlatCAM beta 11.03.2022 - added a new feature: now in the context menu (and main menu -> Edit) there is a new command that allow to move a selection of objects at specified numeric coordinates (either absolute or relative to current position) +- made sure that on canvas context menu pop-up, some actions are disabled if there is no object selected 10.03.2022 @@ -30,7 +31,7 @@ CHANGELOG for FlatCAM beta 9.03.2022 - added a few new GUI custom widgets -- removed the status bar Tcl Shell toggleable QLable. Now the Tcl Shell is toggled by clicking the Message in the Status bar +- removed the status bar Tcl Shell toggleable QLabel. Now the Tcl Shell is toggled by clicking the Message in the Status bar 24.02.2022 diff --git a/app_Main.py b/app_Main.py index b2dd382d..6e07c35b 100644 --- a/app_Main.py +++ b/app_Main.py @@ -7660,10 +7660,25 @@ class App(QtCore.QObject): sel_obj_list = self.collection.get_selected() self.ui.pop_menucolor.setDisabled(True) if sel_obj_list: + self.ui.popmenu_copy.setDisabled(False) + self.ui.popmenu_delete.setDisabled(False) + self.ui.popmenu_edit.setDisabled(False) + + self.ui.popmenu_numeric_move.setDisabled(False) + self.ui.popmenu_move2origin.setDisabled(False) + self.ui.popmenu_move.setDisabled(False) for obj in sel_obj_list: if obj.kind in ["gerber", "excellon"]: self.ui.pop_menucolor.setDisabled(False) break + else: + self.ui.popmenu_copy.setDisabled(True) + self.ui.popmenu_delete.setDisabled(True) + self.ui.popmenu_edit.setDisabled(True) + + self.ui.popmenu_numeric_move.setDisabled(True) + self.ui.popmenu_move2origin.setDisabled(True) + self.ui.popmenu_move.setDisabled(True) def selection_area_handler(self, start_pos, end_pos, sel_type): """