mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
debug add function and save/load in db for edit LCAdisTS window
This commit is contained in:
1 parent
102702e1df
commit
30e34b6847
4 files changed
+68
-30
No files matched your search
@@ -34,29 +34,14 @@ class SetDataCommand(QUndoCommand):
|
||||
self._data = data
|
||||
self._index = index
|
||||
self._column = column
|
||||
self._old = self._data._data[self._index][self._column]
|
||||
_type = self._data._types[self._column]
|
||||
self._new = _type(new_value)
|
||||
self._old = self._data.get_i(self._index)[self._column]
|
||||
self._new = new_value
|
||||
|
||||
def undo(self):
|
||||
if self._column == 0:
|
||||
self._data._data[self._index] = (
|
||||
self._old, self._data._data[self._index][1]
|
||||
)
|
||||
else:
|
||||
self._data._data[self._index] = (
|
||||
self._data._data[self._index][0], self._old
|
||||
)
|
||||
self._data._set_i_c_v(self._index, self._column, self._old)
|
||||
|
||||
def redo(self):
|
||||
if self._column == 0:
|
||||
self._data._data[self._index] = (
|
||||
self._new, self._data._data[self._index][1]
|
||||
)
|
||||
else:
|
||||
self._data._data[self._index] = (
|
||||
self._data._data[self._index][0], self._new
|
||||
)
|
||||
self._data._set_i_c_v(self._index, self._column, self._new)
|
||||
|
||||
|
||||
class AddCommand(QUndoCommand):
|
||||
@@ -72,11 +57,7 @@ class AddCommand(QUndoCommand):
|
||||
|
||||
def redo(self):
|
||||
if self._new is None:
|
||||
self._new = self._data._data.insert(
|
||||
self._index, (
|
||||
self._data._types[0](0), self._data._types[1](0.0)
|
||||
)
|
||||
)
|
||||
self._new = self._data.add(self._index)
|
||||
else:
|
||||
self._data._data.insert(self._index, self._new)
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@ class LateralContributionAdisTSWindow(PamhyrWindow):
|
||||
return
|
||||
|
||||
for row in rows:
|
||||
data = self._table.get(row)
|
||||
data = self._lcs.lst[row]
|
||||
|
||||
if self.sub_window_exists(
|
||||
EditLateralContributionAdisTSWindow,
|
||||
|
||||
Reference in new issue
Block a user