Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/points_list.py
diff options
context:
space:
mode:
authorAlan Aguiar <alanjas@hotmail.com>2013-12-25 16:12:52 (GMT)
committer Alan Aguiar <alanjas@hotmail.com>2013-12-25 16:12:52 (GMT)
commit0f295a9a5f6d3e7913a73cb365a161c3bef4520a (patch)
tree80530dd05dd251c51659200cfcca63b682b08cf0 /points_list.py
parentc962744b7ecd6d86001963e2e6dfb31a8eb0fd93 (diff)
needs a bit of work
Diffstat (limited to 'points_list.py')
-rw-r--r--points_list.py31
1 files changed, 3 insertions, 28 deletions
diff --git a/points_list.py b/points_list.py
index 23c8f18..25f739b 100644
--- a/points_list.py
+++ b/points_list.py
@@ -76,45 +76,20 @@ class Data(gtk.TreeView):
self.model[path][0] = data
#self.emit("label-changed", str(path), data)
print 'remover', path, column
+ return path
def _label_changed(self, cell, path, new_text, model):
-
model[path][0] = new_text
self.emit("label-changed", str(path), new_text)
def _value_changed(self, cell, path, new_text, model, activity):
+ model[path][1] = new_text
- is_number = True
- number = new_text.replace(",", ".")
- try:
- float(number)
- except ValueError:
- is_number = False
-
- if is_number:
- decimals = utils.get_decimals(str(float(number)))
- new_text = locale.format('%.' + decimals + 'f', float(number))
- model[path][1] = str(new_text)
-
- self.emit("value-changed", str(path), number)
-
- elif not is_number:
- alert = Alert()
-
- alert.props.title = _('Invalid Value')
- alert.props.msg = \
- _('The value must be a number (integer or decimal)')
-
- ok_icon = Icon(icon_name='dialog-ok')
- alert.add_button(gtk.RESPONSE_OK, _('Ok'), ok_icon)
- ok_icon.show()
+ self.emit("value-changed", str(path), new_text)
- alert.connect('response', lambda a, r: activity.remove_alert(a))
- activity.add_alert(alert)
- alert.show()