'Switch to quick layout number *index*'

def quick_layout_switch(self, index):

    section = 'quick_layouts'
    try:
        settings = self.load_window_settings('layout_{}/'.format(index), section=section)
        (hexstate, window_size, prefs_dialog_size, pos, is_maximized, is_fullscreen) = settings
        if (hexstate is None):
            self.setup_default_layouts(index, settings)
    except cp.NoOptionError:
        QMessageBox.critical(self, _('Warning'), (_('Quick    switch    layout    #%s    has    not    yet    been    defined.') % str(index)))
        return
    self.set_window_settings(*settings)
    self.current_quick_layout = index
    for plugin in self.widgetlist:
        action = plugin.toggle_view_action
        action.setChecked(plugin.dockwidget.isVisible())
