def create_ui(self): self.document = None self.tasks = {} self.restart = False self.source_tree.set_columns([ Column(title='name', cells=[ Cell('icon_name', use_stock=True), Cell('markup', use_markup=True, expand=True) ]), Column('type_markup', use_markup=True), Column('sort_by_type_by_name', visible=False), Column('sort_by_type_by_line', visible=False), Column('sort_by_line', visible=False), ]) self.source_tree.set_headers_visible(False) # faster lookups on the id property self.source_tree_ids = {} self.sort_box = AttrSortCombo(self.source_tree, [ ('sort_by_type_by_name', _('Alphabetical by type')), ('sort_by_type_by_line', _('By type by line number')), ('sort_by_line', _('By line number')), ], 'sort_by_type_by_name') self.sort_box.show() self.sort_vbox.pack_start(self.sort_box, expand=False) self.filter_model = self.source_tree.model_filter #FIXME this causes a total crash on win32 self.source_tree.set_visible_func(self._visible_func) self._last_expanded = None self._last_outliner = None
def create_ui(self): self.tester = None self._group = execnet.Group() self.source_tree.set_columns([Column(title='Result', cells=[ Cell('icon', use_stock=True, expand=False), Cell('short_name', title='status',), ])]) self.source_tree.set_headers_visible(False) self.clear()
def test_cell_spin_digits(): cell = Cell('test', type=float, use_spin=True, digits=5) renderer = cell.create_renderer(None, None) assert renderer.get_property('digits') == 5
def test_cell_spin_max(): cell = Cell('test', type=int, use_spin=True, max=5) renderer = cell.create_renderer(None, None) assert renderer.get_property('adjustment').get_property('upper') == 5
def test_cell_radio_checkbox_both(): # radio and checkbox, checkbox should win cell = Cell('test', use_checkbox=True, use_radio=True) renderer = cell.create_renderer(None, None) assert renderer.get_property('radio') == False
def test_cell_spin_digits_int(): cell = Cell('test', type=int, use_spin=True) renderer = cell.create_renderer(None, None) assert renderer.get_property('digits') == 0
def test_cell_toggle(): cell = Cell('test', use_checkbox=True) renderer = cell.create_renderer(None, None) assert renderer.get_property('radio') == False
def test_cell_radio(): cell = Cell('test', use_radio=True) renderer = cell.create_renderer(None, None) assert renderer.get_property('radio') == True
def test_cell_format_string(): cell = Cell('test', format='hoo %s') assert cell.format_data(1) == 'hoo 1'
def test_cell_ellipsize(): import pango cell = Cell('test', ellipsize=pango.ELLIPSIZE_END) renderer = cell.create_renderer(None, None) el = renderer.get_property('ellipsize') assert el == pango.ELLIPSIZE_END
def test_cell_format_func(): cell = Cell('test', format_func=str) assert cell.format_data(1) == '1'
def test_cell_props(): cell = Cell('test', cell_props={'size': 100}) renderer = cell.create_renderer(None, None) assert renderer.get_property('size') == 100
def test_cell_progress_text(): cell = Cell('test', type=int, use_progress=True, progress_text='hello') renderer = cell.create_renderer(None, None) assert renderer.get_property('text') == 'hello'
def test_cell_progress(): cell = Cell('test', type=int, use_progress=True) renderer = cell.create_renderer(None, None) assert renderer.get_property('pulse') < 1
def test_cell_spin_step(): cell = Cell('test', type=int, use_spin=True, step=5) renderer = cell.create_renderer(None, None) assert renderer.get_property('adjustment').get_property('step-increment') == 5