diff --git a/src/View/MainWindow.py b/src/View/MainWindow.py index 4c5cf62f..6b11297c 100644 --- a/src/View/MainWindow.py +++ b/src/View/MainWindow.py @@ -90,8 +90,7 @@ from Model.Study import Study logger = logging.getLogger() no_model_action = [ - "action_menu_new", "action_menu_open", "action_menu_import_mage", - "action_menu_import_rubarbe", "action_toolBar_open", + "action_menu_new", "action_menu_open", "action_toolBar_open", ] model_action = [ @@ -101,17 +100,14 @@ model_action = [ ] other_model_action = [ - "action_toolBar_run_solver", "action_toolBar_kill_solver" + "action_toolBar_run_solver", ] define_model_action = [ # Toolbar "action_toolBar_network", "action_toolBar_geometry", - "action_toolBar_mesh", "action_toolBar_run_meshing_tool", "action_toolBar_boundary_cond", "action_toolBar_lateral_contrib", - "action_toolBar_spills", "action_toolBar_frictions", - "action_toolBar_stricklers", "action_toolBar_building", - "action_toolBar_initial_cond", + "action_toolBar_frictions", "action_toolBar_initial_cond", # Menu "action_menu_run_solver", "action_menu_numerical_parameter", "action_menu_edit_network", "action_menu_edit_geometry", @@ -155,11 +151,11 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): self ) + self.setup_debug_mode(init=True) self.setup_tab() self.setup_sc() self.setup_connection() self.default_style() - self.setup_debug_mode(init=True) self.setup_results() self.setup_timer() @@ -218,8 +214,11 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): Returns: Nothing """ - logger.debug(f"Set {action} to {enable}") - self.findChild(QAction, action).setEnabled(enable) + qaction = self.findChild(QAction, action) + if qaction is not None: + qaction.setEnabled(enable) + else: + logger.warning(f"Set {action} to {enable}") def setup_sc(self): self._run_sc = QShortcut(QKeySequence("F6"), self) @@ -269,7 +268,6 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): "action_menu_mage": self.open_doc_mage, "action_menu_about": self.open_about, # ToolBar action - "action_toolBar_quit": self.close, "action_toolBar_open": self.open_model, "action_toolBar_save": self.save_study, "action_toolBar_close": self.close_model, @@ -277,22 +275,18 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): # Current actions "action_toolBar_network": self.open_network, "action_toolBar_geometry": self.open_geometry, - "action_toolBar_mesh": lambda: self.open_dummy("Mesh"), - "action_toolBar_run_meshing_tool": self.open_solver_parameters, "action_toolBar_boundary_cond": self.open_boundary_cond, "action_toolBar_lateral_contrib": self.open_lateral_contrib, - "action_toolBar_spills": lambda: self.open_dummy("Deversement"), - "action_toolBar_stricklers": self.open_stricklers, "action_toolBar_frictions": self.open_frictions, - "action_toolBar_building": lambda: self.open_dummy("Ouvrages"), "action_toolBar_initial_cond": self.open_initial_conditions, } for action in actions: - logger.debug("Setup connection : " + action) - self.findChild(QAction, action)\ - .triggered.connect(actions[action]) - # action.triggered.connect(actions[action]) + qaction = self.findChild(QAction, action) + if qaction is not None: + qaction.triggered.connect(actions[action]) + else: + logger.warning(f"Setup connection : '{action}' to {actions[action]}") self._run_sc.activated.connect(self.run_lasest_solver) diff --git a/src/View/ui/MainWindow.ui b/src/View/ui/MainWindow.ui index 4ea3eb60..9e0f0fe5 100644 --- a/src/View/ui/MainWindow.ui +++ b/src/View/ui/MainWindow.ui @@ -157,15 +157,6 @@ - - - - - - &Cartography - - - &Help @@ -225,7 +216,6 @@ - @@ -343,25 +333,6 @@ Ctrl+O - - - false - - - Import data from MAGE - - - - - - - - false - - - Import data from RubarBE - - @@ -374,17 +345,6 @@ Close current study - - - true - - - true - - - Save mesh - - @@ -415,11 +375,6 @@ Ctrl+Shift+S - - - Archive - - Pamhyr configuration @@ -450,83 +405,6 @@ Edit geometry - - - false - - - Import geometry - - - - - false - - - Export geometry - - - - - false - - - Run extrenal meshing tool - - - - - choose meshing tool by reach - - - - - false - - - View meshed geometry - - - - - false - - - Export mesh - - - - - false - - - Delete mesh of current reach - - - - - false - - - Delete all mesh - - - - - false - - - Abscisse - Cote - - - - - false - - - XYZ - - Numerical parameter for solvers @@ -548,25 +426,6 @@ Initial conditions - - - true - - - false - - - Export initial conditions - - - - - false - - - Import final state as initial condition - - Edit friction @@ -577,27 +436,6 @@ Edit lateral contributions - - - false - - - Edit spills - - - - - Édition des Tronçons - - - - - false - - - Edit cross building - - Run solver @@ -606,34 +444,6 @@ F5 - - - Stop solver - - - - - Display listings - - - - - false - - - Simulation directory management - - - - - Open - - - - - Close - - false @@ -648,61 +458,11 @@ - - - false - - - Limnigram - - - - 75 - true - - - - - - false - - - Map current reach - - - - - false - - - Help PAMHYR - - - - - false - - - Help MAGE - - About - - - - ../ressources/menu/open.png../ressources/menu/open.png - - - ouvrir - - - Ouvrir une étude - - @@ -733,21 +493,6 @@ Ctrl+F - - - - ressources/exit_bis.pngressources/exit_bis.png - - - Quit - - - Quit the application (Ctrl+Q) - - - Ctrl+Q - - @@ -760,51 +505,6 @@ Run a solver - - - false - - - - ressources/gtk-stop.pngressources/gtk-stop.png - - - stop solver - - - Interrompt la simulation en cours - - - Ctrl+C - - - - - - ressources/gnome-stock-insert-table.pngressources/gnome-stock-insert-table.png - - - Run external meshing tool - - - Run meshing tool on current reach geometry - - - - - false - - - - ressources/gnome-stock-edit.pngressources/gnome-stock-edit.png - - - Display simulation listing - - - Display current simulation listing - - @@ -829,18 +529,6 @@ Edit reach geometry - - - - ressources/mailles-50.pngressources/mailles-50.png - - - Mesh - - - Display meshed reach - - Boundary conditions @@ -860,14 +548,6 @@ Edit lateral contribution - - - Spills - - - Edit lateral spills - - Friction @@ -876,22 +556,6 @@ Edit friction frictions - - - Stricklers - - - Edit the study stricklers - - - - - Building - - - Edit building (valve, ...), singularity and pump - - @@ -901,17 +565,7 @@ Edit study - Edit the study metadata - - - - - English - - - - - French + Edit the study information @@ -935,16 +589,6 @@ Edit reach sediment layers - - - Doc - - - - - Pamhyr2 developer - - Mage @@ -958,11 +602,6 @@ Users (wiki) - - - Users (html) - - Developers (pdf)