mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Pamhyr2, Scenario: Add Read only mode.
This commit is contained in:
1 parent
8f0535dc5c
commit
8afa3d1e30
9 files changed
+103
-17
No files matched your search
@@ -61,7 +61,7 @@ class ScenarioItem(QGraphicsTextItem):
|
||||
if self.graph.scenario_has_child(self.scenario):
|
||||
tag = "⛔ "
|
||||
|
||||
self.setPlainText(tag + self.scenario.name)
|
||||
self.setHtml(tag + self.scenario.name)
|
||||
self.setDefaultTextColor(Qt.black)
|
||||
|
||||
self.setFlag(QGraphicsItem.ItemIsMovable)
|
||||
@@ -412,7 +412,9 @@ class GraphWidget(QGraphicsView):
|
||||
self._study.save()
|
||||
self._study.reload_from_scenario(item.scenario)
|
||||
|
||||
self._close_other_window()
|
||||
self.exec_with_waiting_window(fn, "select_scenario")
|
||||
|
||||
self.changeScenario.emit(self.sender())
|
||||
|
||||
def new_scenario(self, pos):
|
||||
@@ -421,5 +423,14 @@ class GraphWidget(QGraphicsView):
|
||||
scenario = self._study.new_scenario_from_current()
|
||||
scenario.set_pos(pos.x(), pos.y())
|
||||
|
||||
self._close_other_window()
|
||||
self.exec_with_waiting_window(fn, "new_scenario")
|
||||
|
||||
self.changeScenario.emit(self.sender())
|
||||
|
||||
def _close_other_window(self):
|
||||
self.parent\
|
||||
.parent\
|
||||
._close_sub_window(
|
||||
exceptions=["Scenarios", "Debug REPL"]
|
||||
)
|
||||
Reference in new issue
Block a user