def setup_toolbar(self, exclude_private, exclude_uppercase, exclude_capitalized, exclude_unsupported, autorefresh):
    'Setup toolbar'
    self.setup_in_progress = True
    toolbar = []
    refresh_button = create_toolbutton(self, text=_('Refresh'), icon=get_icon('reload.png'), triggered=self.refresh_table)
    self.auto_refresh_button = create_toolbutton(self, text=_('Refresh periodically'), icon=get_icon('auto_reload.png'), toggled=self.toggle_auto_refresh)
    self.auto_refresh_button.setChecked(autorefresh)
    load_button = create_toolbutton(self, text=_('Import data'), icon=get_icon('fileimport.png'), triggered=self.import_data)
    self.save_button = create_toolbutton(self, text=_('Save data'), icon=get_icon('filesave.png'), triggered=(lambda : self.save_data(self.filename)))
    self.save_button.setEnabled(False)
    save_as_button = create_toolbutton(self, text=_('Save data as...'), icon=get_icon('filesaveas.png'), triggered=self.save_data)
    toolbar += [refresh_button, self.auto_refresh_button, load_button, self.save_button, save_as_button]
    self.exclude_private_action = create_action(self, _('Exclude private references'), tip=_('Exclude references which name starts with an underscore'), toggled=(lambda state: self.sig_option_changed.emit('exclude_private', state)))
    self.exclude_private_action.setChecked(exclude_private)
    self.exclude_uppercase_action = create_action(self, _('Exclude all-uppercase references'), tip=_('Exclude references which name is uppercase'), toggled=(lambda state: self.sig_option_changed.emit('exclude_uppercase', state)))
    self.exclude_uppercase_action.setChecked(exclude_uppercase)
    self.exclude_capitalized_action = create_action(self, _('Exclude capitalized references'), tip=_('Exclude references which name starts with an uppercase character'), toggled=(lambda state: self.sig_option_changed.emit('exclude_capitalized', state)))
    self.exclude_capitalized_action.setChecked(exclude_capitalized)
    self.exclude_unsupported_action = create_action(self, _('Exclude unsupported data types'), tip=_("Exclude references to unsupported data types (i.e. which won't be handled/saved correctly)"), toggled=(lambda state: self.sig_option_changed.emit('exclude_unsupported', state)))
    self.exclude_unsupported_action.setChecked(exclude_unsupported)
    options_button = create_toolbutton(self, text=_('Options'), icon=get_icon('tooloptions.png'))
    toolbar.append(options_button)
    options_button.setPopupMode(QToolButton.InstantPopup)
    menu = QMenu(self)
    editor = self.editor
    actions = [self.exclude_private_action, self.exclude_uppercase_action, self.exclude_capitalized_action, self.exclude_unsupported_action, None, editor.truncate_action]
    if is_module_installed('numpy'):
        actions.append(editor.minmax_action)
    add_actions(menu, actions)
    options_button.setMenu(menu)
    self.setup_in_progress = False
    return toolbar
Setup toolbar
def setup_toolbar(self, exclude_private, exclude_uppercase, exclude_capitalized, exclude_unsupported, autorefresh):
    
    self.setup_in_progress = True
    toolbar = []
    refresh_button = create_toolbutton(self, text=_('Refresh'), icon=get_icon('reload.png'), triggered=self.refresh_table)
    self.auto_refresh_button = create_toolbutton(self, text=_('Refresh periodically'), icon=get_icon('auto_reload.png'), toggled=self.toggle_auto_refresh)
    self.auto_refresh_button.setChecked(autorefresh)
    load_button = create_toolbutton(self, text=_('Import data'), icon=get_icon('fileimport.png'), triggered=self.import_data)
    self.save_button = create_toolbutton(self, text=_('Save data'), icon=get_icon('filesave.png'), triggered=(lambda : self.save_data(self.filename)))
    self.save_button.setEnabled(False)
    save_as_button = create_toolbutton(self, text=_('Save data as...'), icon=get_icon('filesaveas.png'), triggered=self.save_data)
    toolbar += [refresh_button, self.auto_refresh_button, load_button, self.save_button, save_as_button]
    self.exclude_private_action = create_action(self, _('Exclude private references'), tip=_('Exclude references which name starts with an underscore'), toggled=(lambda state: self.sig_option_changed.emit('exclude_private', state)))
    self.exclude_private_action.setChecked(exclude_private)
    self.exclude_uppercase_action = create_action(self, _('Exclude all-uppercase references'), tip=_('Exclude references which name is uppercase'), toggled=(lambda state: self.sig_option_changed.emit('exclude_uppercase', state)))
    self.exclude_uppercase_action.setChecked(exclude_uppercase)
    self.exclude_capitalized_action = create_action(self, _('Exclude capitalized references'), tip=_('Exclude references which name starts with an uppercase character'), toggled=(lambda state: self.sig_option_changed.emit('exclude_capitalized', state)))
    self.exclude_capitalized_action.setChecked(exclude_capitalized)
    self.exclude_unsupported_action = create_action(self, _('Exclude unsupported data types'), tip=_("Exclude references to unsupported data types (i.e. which won't be handled/saved correctly)"), toggled=(lambda state: self.sig_option_changed.emit('exclude_unsupported', state)))
    self.exclude_unsupported_action.setChecked(exclude_unsupported)
    options_button = create_toolbutton(self, text=_('Options'), icon=get_icon('tooloptions.png'))
    toolbar.append(options_button)
    options_button.setPopupMode(QToolButton.InstantPopup)
    menu = QMenu(self)
    editor = self.editor
    actions = [self.exclude_private_action, self.exclude_uppercase_action, self.exclude_capitalized_action, self.exclude_unsupported_action, None, editor.truncate_action]
    if is_module_installed('numpy'):
        actions.append(editor.minmax_action)
    add_actions(menu, actions)
    options_button.setMenu(menu)
    self.setup_in_progress = False
    return toolbar