diff --git a/preditor/gui/group_tab_widget/__init__.py b/preditor/gui/group_tab_widget/__init__.py index 0d9814fb..6f2b3659 100644 --- a/preditor/gui/group_tab_widget/__init__.py +++ b/preditor/gui/group_tab_widget/__init__.py @@ -114,11 +114,20 @@ def add_new_tab(self, group, title="Workbox"): return parent, editor def all_widgets(self): - """Returns every widget under every group.""" - for i in range(self.count()): - tab_widget = self.widget(i) - for j in range(tab_widget.count()): - yield tab_widget.widget(j) + """A generator yielding information about every widget under every group. + + Yields: + widget, group tab name, widget tab name, group tab index, widget tab index + """ + for group_index in range(self.count()): + group_name = self.tabText(group_index) + + tab_widget = self.widget(group_index) + for tab_index in range(tab_widget.count()): + tab_name = tab_widget.tabText(tab_index) + yield tab_widget.widget( + tab_index + ), group_name, tab_name, group_index, tab_index def close_current_tab(self): """Convenient method to close the currently open editor tab prompting diff --git a/preditor/gui/loggerwindow.py b/preditor/gui/loggerwindow.py index ae26b43d..2722161b 100644 --- a/preditor/gui/loggerwindow.py +++ b/preditor/gui/loggerwindow.py @@ -589,7 +589,7 @@ def closeEvent(self, event): self.uiConsoleTOOLBAR.hide() # Handle any cleanup each workbox tab may need to do before closing - for editor in self.uiWorkboxTAB.all_widgets(): + for editor, _, _, _, _ in self.uiWorkboxTAB.all_widgets(): editor.__close__() def closeLogger(self): @@ -797,7 +797,7 @@ def restoreToolbars(self, pref=None): def setAutoCompleteEnabled(self, state): self.uiConsoleTXT.completer().setEnabled(state) - for workbox in self.uiWorkboxTAB.all_widgets(): + for workbox, _, _, _, _ in self.uiWorkboxTAB.all_widgets(): workbox.__set_auto_complete_enabled__(state) def setSpellCheckEnabled(self, state): @@ -994,13 +994,13 @@ def show_workbox_options(self): self.uiWorkboxSTACK.setCurrentIndex(WorkboxPages.Options) def updateCopyIndentsAsSpaces(self): - for workbox in self.uiWorkboxTAB.all_widgets(): + for workbox, _, _, _, _ in self.uiWorkboxTAB.all_widgets(): workbox.__set_copy_indents_as_spaces__( self.uiCopyTabsToSpacesACT.isChecked() ) def updateIndentationsUseTabs(self): - for workbox in self.uiWorkboxTAB.all_widgets(): + for workbox, _, _, _, _ in self.uiWorkboxTAB.all_widgets(): workbox.__set_indentations_use_tabs__( self.uiIndentationsTabsACT.isChecked() )