141 |
self.dead = False |
self.dead = False |
142 |
self.error_msg = None |
self.error_msg = None |
143 |
|
|
144 |
def make_static(self,table): |
def make_static(self, table, values=None): |
145 |
self.active = False |
self.active = False |
146 |
#print "TABLE COLS:",table.cols |
#print "TABLE COLS:",table.cols |
147 |
#print "ROW VALUES:",self.values |
#print "ROW VALUES:",self.values |
148 |
_v = {} |
if values is None: |
149 |
for col in table.cols.values(): |
_v = {} |
150 |
_v[col.index] = col.instance.getRealValue() |
for col in table.cols.values(): |
151 |
self.values = _v |
_v[col.index] = col.instance.getRealValue() |
152 |
|
self.values = _v |
153 |
|
else: |
154 |
|
self.values = values |
155 |
#print "Made static, values:",self.values |
#print "Made static, values:",self.values |
156 |
|
|
157 |
def get_values(self,table): |
def get_values(self,table): |
243 |
else: |
else: |
244 |
cell.set_property('pixbuf',self.keptimg.get_pixbuf()) |
cell.set_property('pixbuf',self.keptimg.get_pixbuf()) |
245 |
|
|
246 |
|
def get_values(self): |
247 |
|
_v = [] |
248 |
|
for col in self.cols.values(): |
249 |
|
_v.append(col.instance.getRealValue()) |
250 |
|
return _v |
251 |
|
|
252 |
def on_add_clicked(self,*args): |
def on_add_clicked(self,*args): |
253 |
self.do_add_row() |
self.do_add_row() |
254 |
|
|
279 |
if y is None: |
if y is None: |
280 |
y=[self.cols[1]] |
y=[self.cols[1]] |
281 |
|
|
282 |
|
##### CELSIUS TEMPERATURE WORKAROUND |
283 |
|
size = len(CelsiusUnits.get_celsius_sign()) |
284 |
|
xtit = x.title.find(CelsiusUnits.get_celsius_sign()) |
285 |
|
if xtit != -1: |
286 |
|
x.title = x.title[:xtit] + "K" + x.title[xtit + size:] |
287 |
|
for yy in y: |
288 |
|
ytit = yy.title.find(CelsiusUnits.get_celsius_sign()) |
289 |
|
if ytit != -1: |
290 |
|
yy.title = yy.title[:ytit] + "K" + yy.title[ytit + size:] |
291 |
|
##### CELSIUS TEMPERATURE WORKAROUND |
292 |
|
|
293 |
# if column indices are provided instead of columns, convert them |
# if column indices are provided instead of columns, convert them |
294 |
if x.__class__ is int and x>=0 and x<len(self.cols): |
if x.__class__ is int and x>=0 and x<len(self.cols): |
295 |
x=self.cols[x] |
x=self.cols[x] |
444 |
self.rows.append(_row) |
self.rows.append(_row) |
445 |
if self.activeiter is not None: |
if self.activeiter is not None: |
446 |
_oldrow = _store.get_value(self.activeiter, 0) |
_oldrow = _store.get_value(self.activeiter, 0) |
447 |
_oldrow.make_static(self) |
_oldrow.make_static(self, values) |
448 |
self.activeiter = _store.append(None,[_row]) |
self.activeiter = _store.append(None,[_row]) |
449 |
_path = _store.get_path(self.activeiter) |
_path = _store.get_path(self.activeiter) |
450 |
_oldpath,_oldcol = self.view.get_cursor() |
_oldpath,_oldcol = self.view.get_cursor() |