191
185
Treeiter: tree path, type: (int,)*n
194
lambda self, row: '<i>{0}</i>'.format(row.attrname),#0
195
lambda self, row: row.attrtype,#1
196
lambda self, row: ' '.join(('' if row.attrtype not in 'AE' else
197
self.link_rows.get(row.self_link, dummy_row).display_value
188
lambda self, tpath, row: '<i>{0}</i>'.format(row.attrname),#0
189
lambda self, tpath, row: row.attrtype,#1
190
lambda self, tpath, row: ' '.join(('' if row.attrtype not in 'AE' else
191
self.link_rows.get(row.self_link, dummy_row)[1].display_value
198
192
if row.state == ROW_LINK else
199
193
row.display_value).splitlines()),#2
200
lambda self, row: (row.state != ROW_LOADING and row.attrtype in 'AE' and
194
lambda self, tpath, row: (row.state != ROW_LOADING and row.attrtype in 'AE' and
201
195
not (row.long_value and Row.long_value)),#3
202
lambda self, row: row.is_visible(),#4
203
lambda self, row: row.state != ROW_OK,#5
204
lambda self, row: (self.link_rows.get(row.self_link, dummy_row)
196
lambda self, tpath, row: row.is_visible(),#4
197
lambda self, tpath, row: row.state != ROW_OK,#5
198
lambda self, tpath, row: (self.link_rows.get(row.self_link, dummy_row)[0]
205
199
if row.state == ROW_LINK
206
else row).get_path(),#6
207
lambda self, row: bool(row.self_link),#7
208
lambda self, row: not row.long_value or not Row.long_value,#8
209
lambda self, row: '<i>{0}:</i>\n{1}'
201
lambda self, tpath, row: bool(row.self_link),#7
202
lambda self, tpath, row: not row.long_value or not Row.long_value,#8
203
lambda self, tpath, row: '<i>{0}:</i>\n{1}'
210
204
.format(row.attrname, GLib.markup_escape_text(row.display_value))
212
lambda self, row: row.long_value and Row.long_value,#10
213
lambda self, row: Row.row_icons[row.state],#11
214
lambda self, row: ('Loading' if row.state == ROW_LOADING else
206
lambda self, tpath, row: row.long_value and Row.long_value,#10
207
lambda self, tpath, row: Row.row_icons[row.state],#11
208
lambda self, tpath, row: ('Loading' if row.state == ROW_LOADING else
215
209
'Activate row to show attributes' if row.state == ROW_LINK else
216
210
(row.error.strip().splitlines() or [''])[0] if row.state == ROW_ERROR else
218
lambda self, row: False,#13
212
lambda self, tpath, row: False,#13
220
214
placeholder_data = ['<i><placeholder></i>','','',False,True,False,None,False,True,
221
215
'',False,'gtk-refresh','',True]
456
450
row = self.rows_info[path]
457
451
return row.get_attr_path()
459
def get_value_from_path(self, path):
453
def get_value_from_path(self, tpath):
460
454
'''Returns the value of the value-column'''
461
row = self.rows_info[path]
462
return self.get_value_from_row(row, self.COL_VALUE)
455
row = self.rows_info[tpath]
456
return self.get_value_from_row(tpath, row, self.COL_VALUE)
464
def get_status_text(self, path):
458
def get_status_text(self, tpath):
465
459
'''Returns the value of the status-column'''
466
row = self.rows_info[path]
467
return self.get_value_from_row(row, self.COL_ROW_STATUS)
460
row = self.rows_info[tpath]
461
return self.get_value_from_row(tpath, row, self.COL_ROW_STATUS)
469
463
def eval_operation(self, tpath, operation, kwargs):
470
464
'''Execute Operation'''
784
777
row = self.create_row(row, parent_tpath, parent, index=i, attrname='(empty)', attrtype='E')
785
778
self.get_collection_values_main(parent_tpath, parent)
787
def create_operation_row(self, parent):
780
def create_operation_row(self, parent_tpath, parent):
788
781
self.lp_worker.check_worker(False)
789
parent_tpath = parent.get_path()
790
782
row = self.create_row(None, parent_tpath, parent, 0, '(empty)', ' ')
791
783
parent.n_children = 1
840
832
if row.attrtype in 'ECO':
841
833
self.treestore.append(titer, self.placeholder_data)
842
834
for i in range(len(self.column_func)):
843
self.treestore.set_value(titer, i, self.get_value_from_row(row, i))
835
self.treestore.set_value(titer, i, self.get_value_from_row(tpath, row, i))
844
836
self.emit('row-changed-end', tpath, titer)
846
def get_value_from_row(self, rowref, column):
838
def get_value_from_row(self, tpath, row, column):
847
839
self.lp_worker.check_worker(False)
848
return self.column_func[column](self, rowref)
840
return self.column_func[column](self, tpath, row)