- solved the problem with not closing all the tabs in Plot Area when creating a New Project; the issue was that once a tab was removed the indexes are remade (when tab 0 is removed then tab 1 becomes tab 0 and so on)

This commit is contained in:
Marius Stanciu
2020-04-29 21:43:28 +03:00
committed by Marius
parent 1b0abc6798
commit 804b62af7f
5 changed files with 46 additions and 25 deletions

View File

@@ -1169,7 +1169,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.plot_tab_area.setTabsClosable(True)
self.plot_tab = QtWidgets.QWidget()
self.plot_tab.setObjectName("plotarea")
self.plot_tab.setObjectName("plotarea_tab")
self.plot_tab_area.addTab(self.plot_tab, _("Plot Area"))
self.right_layout = QtWidgets.QVBoxLayout()

View File

@@ -2076,7 +2076,7 @@ class FCDetachableTab(QtWidgets.QTabWidget):
class FCDetachableTab2(FCDetachableTab):
tab_closed_signal = QtCore.pyqtSignal(object)
tab_closed_signal = QtCore.pyqtSignal(object, int)
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)
@@ -2089,8 +2089,8 @@ class FCDetachableTab2(FCDetachableTab):
:return:
"""
# idx = self.currentIndex()
self.tab_name = self.widget(currentIndex).objectName()
self.tab_closed_signal.emit(self.tab_name)
tab_name = self.widget(currentIndex).objectName()
self.tab_closed_signal.emit(tab_name, currentIndex)
self.removeTab(currentIndex)