diff --git a/README.md b/README.md index 0cf4037f..e07ea442 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ CAD program, and create G-Code for Isolation routing. - changed the order of the menu entries in the FIle -> Open ... - organized the list of recent files so the Project entries are to the top and separated from the other types of file +- work on identification of changes in Preferences tab 30.07.2019 diff --git a/flatcamGUI/FlatCAMGUI.py b/flatcamGUI/FlatCAMGUI.py index bc3b4885..09ec9283 100644 --- a/flatcamGUI/FlatCAMGUI.py +++ b/flatcamGUI/FlatCAMGUI.py @@ -810,7 +810,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow): self.right_lay.setContentsMargins(0, 0, 0, 0) self.right_widget.setLayout(self.right_lay) # self.plot_tab_area = FCTab() - self.plot_tab_area = FCDetachableTab(protect=False, protect_by_name=[_('Plot Area')]) + self.plot_tab_area = FCDetachableTab2(protect=False, protect_by_name=[_('Plot Area')]) self.plot_tab_area.useOldIndex(True) self.right_lay.addWidget(self.plot_tab_area) diff --git a/flatcamGUI/GUIElements.py b/flatcamGUI/GUIElements.py index 548792c5..e24a9512 100644 --- a/flatcamGUI/GUIElements.py +++ b/flatcamGUI/GUIElements.py @@ -884,6 +884,7 @@ class FCDetachableTab(QtWidgets.QTabWidget): :param currentIndex: :return: """ + self.removeTab(currentIndex) def protectTab(self, currentIndex): @@ -1348,6 +1349,25 @@ class FCDetachableTab(QtWidgets.QTabWidget): self.detachedTabDropSignal.emit(name, index, dropPos) +class FCDetachableTab2(FCDetachableTab): + + def __init__(self, protect=None, protect_by_name=None, parent=None): + super(FCDetachableTab2, self).__init__(protect=protect, protect_by_name=protect_by_name, parent=parent) + + def closeTab(self, currentIndex): + """ + Slot connected to the tabCloseRequested signal + + :param currentIndex: + :return: + """ + idx = self.currentIndex() + if self.tabText(idx) == _("Preferences"): + #TODO work on this, identify if widget changed and print a status message + pass + + self.removeTab(currentIndex) + class VerticalScrollArea(QtWidgets.QScrollArea): """ This widget extends QtGui.QScrollArea to make a vertical-only