Commit 5a900578 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

IC: Fix row display.

Showing with 8 additions and 6 deletions
+8 -6
......@@ -5,7 +5,7 @@ from tools import trace, timer
class Data(object):
def __init__(self, status = None):
super(Data, self).__init()
super(Data, self).__init__()
self._status = status
......@@ -17,7 +17,7 @@ class Data(object):
self._cote = 0.0
self._tiran = 0.0
def __getitems__(self, key):
def __getitem__(self, key):
val = None
if key == "name":
......@@ -35,7 +35,7 @@ class Data(object):
return val
def __setitems__(self, key, value):
def __setitem__(self, key, value):
if key == "name":
self._name = str(value)
elif key == "comment":
......
......@@ -34,3 +34,4 @@ class InitialConditionsDict(object):
def new(self, reach):
new = InitialConditions(reach = reach, status = self._status)
self.set(reach, new)
return new
......@@ -16,14 +16,15 @@ class SetCommand(QUndoCommand):
self._ics = ics
self._row = row
self._column = column
self._old = self._ics.get(self._row)[column]
self._new = new_value
def undo(self):
self._ics.get(self._row)[column] = self._old
self._ics.get(self._row)[self._column] = self._old
def redo(self):
self._ics.get(self._row)[column] = self._new
self._ics.get(self._row)[self._column] = self._new
class AddCommand(QUndoCommand):
def __init__(self, ics, index):
......
......@@ -131,7 +131,7 @@ class InitialConditionsWindow(ASubMainWindow, ListedSubWindow):
def add(self):
rows = self.index_selected_rows()
if self._ics.len(tab) == 0 or len(rows) == 0:
if len(self._ics) == 0 or len(rows) == 0:
self._table.add(0)
else:
self._table.add(rows[0])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment