Exemple #1
0
    def _update_view_menu(self):
        display = app.display_manager.get_current_display()
        # using hasattr because not all displays have ids and types
        # TODO: refactor the display type / id system
        if not (hasattr(display, 'type') and hasattr(display, 'id')):
            return

        enabled = set(app.widget_state.get_sorts_enabled(display.type, display.id))
        checks = dict(('ToggleColumn-' + column, column in enabled)
            for column in WidgetStateStore.get_columns())
        self.emit('checked-changed', 'ListView', checks)

        for column in WidgetStateStore.get_columns_available(display.type):
            self.enabled_groups.add('column-%s' % column)
Exemple #2
0
    def _update_view_menu(self):
        display = app.display_manager.get_current_display()
        # using hasattr because not all displays have ids and types
        # TODO: refactor the display type / id system
        if not (hasattr(display, 'type') and hasattr(display, 'id')):
            return

        enabled = set(
            app.widget_state.get_sorts_enabled(display.type, display.id))
        checks = dict(('ToggleColumn-' + column, column in enabled)
                      for column in WidgetStateStore.get_columns())
        self.emit('checked-changed', 'ListView', checks)

        for column in WidgetStateStore.get_columns_available(display.type):
            self.enabled_groups.add('column-%s' % column)