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

SL: Minor fixes.

Showing with 9 additions and 1 deletion
+9 -1
......@@ -143,7 +143,12 @@ class SedimentLayer(SQLSubModel):
SedimentLayer._id_cnt = max(id, SedimentLayer._id_cnt+1)
def __str__(self):
return f"{self.name} ({len(self)}) - {self.comment}"
s = f"{self.name} ({len(self)})"
if self.comment != "":
s += f" - {self.comment}"
return s
def __len__(self):
return len(self._layers)
......
......@@ -46,6 +46,9 @@ class SLDialog(ASubWindow, ListedSubWindow):
@property
def sl(self):
if self.value == _translate("SedimentLayers", "Not defined"):
return None
return next(
filter(
lambda sl: str(sl) == self.value,
......
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