code: def refresh_file_dependent_actions(self):
          
          if self.dockwidget and self.dockwidget.isVisible():
              enable = self.get_current_editor() is not None
              for action in self.file_dependent_actions:
                  action.setEnabled(enable)
docs: Enable/disable file dependent actions
          (only if dockwidget is visible)