code: def refresh_actions(self):
          
          self.options_menu.clear()
  
          # Decide what additional actions to show
          if self.undocked_window is None:
              additional_actions = [MENU_SEPARATOR,
                                    self.undock_action,
                                    self.close_plugin_action]
          else:
              additional_actions = [MENU_SEPARATOR,
                                    self.dock_action]
  
          # Create actions list
          self.plugin_actions = self.get_plugin_actions() + additional_actions
          add_actions(self.options_menu, self.plugin_actions)
docs: Create options menu.