mirror of https://gitlab.com/pamhyr/pamhyr2
Scenario: Minor changes.
parent
a412f2f18f
commit
8f0535dc5c
|
|
@ -189,7 +189,7 @@ class Scenario(SQLSubModel):
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
if self._name == "":
|
if self._name == "":
|
||||||
return f"Child of '{self._parent.name}'"
|
return f"Child of '{self._parent.name}' ({self.id})"
|
||||||
|
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
|
|
@ -200,7 +200,7 @@ class Scenario(SQLSubModel):
|
||||||
@property
|
@property
|
||||||
def description(self):
|
def description(self):
|
||||||
if self._description == "":
|
if self._description == "":
|
||||||
return f"Child of '{self._parent.name}'"
|
return f"Child of '{self._parent.name}' ({self.id})"
|
||||||
|
|
||||||
return self._description
|
return self._description
|
||||||
|
|
||||||
|
|
@ -231,6 +231,8 @@ class Scenario(SQLSubModel):
|
||||||
self.description = value
|
self.description = value
|
||||||
|
|
||||||
def __getitem__(self, key):
|
def __getitem__(self, key):
|
||||||
|
if key == "id":
|
||||||
|
return self.id
|
||||||
if key == "name":
|
if key == "name":
|
||||||
return self.name
|
return self.name
|
||||||
if key == "description":
|
if key == "description":
|
||||||
|
|
|
||||||
|
|
@ -353,8 +353,8 @@ class GraphWidget(QGraphicsView):
|
||||||
if len(selectable_items) == 0:
|
if len(selectable_items) == 0:
|
||||||
if event.buttons() & Qt.LeftButton:
|
if event.buttons() & Qt.LeftButton:
|
||||||
old_p = self.mapToScene(
|
old_p = self.mapToScene(
|
||||||
int(self.m_origin_x),
|
float(self.m_origin_x),
|
||||||
int(self.m_origin_y)
|
float(self.m_origin_y)
|
||||||
)
|
)
|
||||||
new_p = self.mapToScene(event.pos())
|
new_p = self.mapToScene(event.pos())
|
||||||
translation = new_p - old_p
|
translation = new_p - old_p
|
||||||
|
|
@ -372,6 +372,7 @@ class GraphWidget(QGraphicsView):
|
||||||
dlg = WaitingDialog(
|
dlg = WaitingDialog(
|
||||||
payload_fn=fn,
|
payload_fn=fn,
|
||||||
title=action_str,
|
title=action_str,
|
||||||
|
trad=self._trad,
|
||||||
parent=self.parent
|
parent=self.parent
|
||||||
)
|
)
|
||||||
dlg.exec_()
|
dlg.exec_()
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,15 @@ class ScenariosTranslate(MainTranslate):
|
||||||
)
|
)
|
||||||
|
|
||||||
self._sub_dict["table_headers_scenarios"] = {
|
self._sub_dict["table_headers_scenarios"] = {
|
||||||
|
"id": self._dict['id'],
|
||||||
"name": self._dict['name'],
|
"name": self._dict['name'],
|
||||||
"description": self._dict['description'],
|
"description": self._dict['description'],
|
||||||
"parent": _translate("Scenarios", "Parent"),
|
"parent": _translate("Scenarios", "Parent"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self._dict["new_scenario"] = _translate(
|
||||||
|
"Scenarios", "Create new scenario"
|
||||||
|
)
|
||||||
|
self._dict["select_scenario"] = _translate(
|
||||||
|
"Scenarios", "Select scenario"
|
||||||
|
)
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,9 @@ class CommonWordTranslate(PamhyrTranslate):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(CommonWordTranslate, self).__init__()
|
super(CommonWordTranslate, self).__init__()
|
||||||
|
|
||||||
|
self._dict["id"] = _translate("CommonWord", "ID")
|
||||||
|
self._dict["pamhyr_id"] = _translate("CommonWord", "Pamhyr2 ID")
|
||||||
|
|
||||||
self._dict["name"] = _translate("CommonWord", "Name")
|
self._dict["name"] = _translate("CommonWord", "Name")
|
||||||
self._dict["type"] = _translate("CommonWord", "Type")
|
self._dict["type"] = _translate("CommonWord", "Type")
|
||||||
self._dict["value"] = _translate("CommonWord", "Value")
|
self._dict["value"] = _translate("CommonWord", "Value")
|
||||||
|
|
|
||||||
|
|
@ -80,8 +80,10 @@ class WaitingDialog(PamhyrDialog):
|
||||||
⣣⣤⣥⣦⣧⣨⣩⣪⣫⣬⣭⣮⣯⣰⣱⣲⣳⣴⣵⣶⣷⣸⣹⣺⣻⣼⣽⣾⣿""",
|
⣣⣤⣥⣦⣧⣨⣩⣪⣫⣬⣭⣮⣯⣰⣱⣲⣳⣴⣵⣶⣷⣸⣹⣺⣻⣼⣽⣾⣿""",
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, payload_fn, title, parent=None):
|
def __init__(self, payload_fn, title, trad=None, parent=None):
|
||||||
trad = MainTranslate()
|
if trad is None:
|
||||||
|
trad = MainTranslate()
|
||||||
|
|
||||||
super(WaitingDialog, self).__init__(
|
super(WaitingDialog, self).__init__(
|
||||||
title=trad[title],
|
title=trad[title],
|
||||||
trad=trad,
|
trad=trad,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue