'Called when a location icon is clicked (e.g. Library)'

def location_selected(self, location):

    page = (0 if (location == 'library') else (1 if (location == 'main') else (2 if (location == 'carda') else 3)))
    self.stack.setCurrentIndex(page)
    self.book_details.reset_info()
    for x in ('tb', 'cb'):
        splitter = getattr(self, (x + '_splitter'))
        splitter.button.setEnabled((location == 'library'))
    for action in self.iactions.values():
        action.location_selected(location)
    if (location == 'library'):
        self.virtual_library_menu.setEnabled(True)
        self.highlight_only_button.setEnabled(True)
        self.vl_tabs.setEnabled(True)
    else:
        self.virtual_library_menu.setEnabled(False)
        self.highlight_only_button.setEnabled(False)
        self.vl_tabs.setEnabled(False)
        self.current_view().reset()
    self.set_number_of_books_shown()
    self.update_status_bar()
