mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
pamhyr: Add saved status in model.
This commit is contained in:
1 parent
b786bb44e2
commit
d328806916
21 files changed
+215
-54
No files matched your search
@@ -75,6 +75,12 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||
self.trans = QTranslator(self)
|
||||
#self.ui.retranslateUi()
|
||||
|
||||
def set_title(self):
|
||||
if self.model is not None:
|
||||
self.setWindowTitle(f"PAMHYR - {self.model.name}")
|
||||
else:
|
||||
self.setWindowTitle("PAMHYR")
|
||||
|
||||
def enable_actions(self, action:str, enable:bool):
|
||||
"""Enable of disable an action componant
|
||||
|
||||
@@ -155,10 +161,12 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||
def set_model(self, model):
|
||||
self.model = model
|
||||
self.update_enable_action()
|
||||
self.set_title()
|
||||
|
||||
def close_model(self):
|
||||
self.model = None
|
||||
self.update_enable_action()
|
||||
self.set_title()
|
||||
|
||||
def update_enable_action(self):
|
||||
"""Update status of action componante
|
||||
|
||||
@@ -25,11 +25,7 @@ class NetworkWindow(ASubMainWindow):
|
||||
self.ui.setWindowTitle(title)
|
||||
|
||||
self.model = model
|
||||
if self.model.river is None:
|
||||
self.graph = River()
|
||||
self.model.river = self.graph
|
||||
else:
|
||||
self.graph = self.model.river
|
||||
self.graph = self.model.river
|
||||
|
||||
# Graph Widget
|
||||
|
||||
|
||||
Reference in new issue
Block a user