code: def switchCurrentView(self, viewType):
          
          if not self.count():
              return self.addView(viewType)
  
          # make sure we're not trying to switch to the same type
          view = self.currentView()
          if type(view) == viewType:
              return view
  
          # create a new view and close the old one
          self.blockSignals(True)
          self.setUpdatesEnabled(False)
  
          # create the new view
          index = self.indexOf(view)
          if not view.close():
              return None
          #else:
          #    self.tabBar().removeTab(index)
  
          index = self.currentIndex()
          new_view = viewType.createInstance(self.viewWidget(), self.viewWidget())
  
          # add the new view
          self.insertTab(index, new_view, new_view.windowTitle())
  
          self.blockSignals(False)
          self.setUpdatesEnabled(True)
          self.setCurrentIndex(index)
  
          return new_view
docs: Swaps the current tab view for the inputed action's type.
  
          :param      action | <QAction>
  
          :return     <XView> || None