Esempio n. 1
0
    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
Esempio n. 2
0
 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()
Esempio n. 3
0
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
Esempio n. 4
0
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
Esempio n. 5
0
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
Esempio n. 6
0
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
Esempio n. 7
0
def test_cell_toggle():
    cell = Cell('test', use_checkbox=True)
    renderer = cell.create_renderer(None, None)
    assert renderer.get_property('radio') == False
Esempio n. 8
0
def test_cell_radio():
    cell = Cell('test', use_radio=True)
    renderer = cell.create_renderer(None, None)
    assert renderer.get_property('radio') == True
Esempio n. 9
0
def test_cell_format_string():
    cell = Cell('test', format='hoo %s')
    assert cell.format_data(1) == 'hoo 1'
Esempio n. 10
0
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
Esempio n. 11
0
def test_cell_format_func():
    cell = Cell('test', format_func=str)
    assert cell.format_data(1) == '1'
Esempio n. 12
0
def test_cell_props():
    cell = Cell('test', cell_props={'size': 100})
    renderer = cell.create_renderer(None, None)
    assert renderer.get_property('size') == 100
Esempio n. 13
0
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'
Esempio n. 14
0
def test_cell_progress():
    cell = Cell('test', type=int, use_progress=True)
    renderer = cell.create_renderer(None, None)
    assert renderer.get_property('pulse') < 1
Esempio n. 15
0
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