diff --git a/src/View/Geometry/Window.py b/src/View/Geometry/Window.py index 0827a094..5f3ad301 100644 --- a/src/View/Geometry/Window.py +++ b/src/View/Geometry/Window.py @@ -314,6 +314,10 @@ class GeometryWindow(PamhyrWindow): trad=self._trad, parent=self ) + dlg.adjustSize() + dialog_geometry = dlg.frameGeometry() + dialog_geometry.moveCenter(self.frameGeometry().center()) + dlg.move(dialog_geometry.topLeft()) if dlg.exec(): data = { "step": dlg.space_step, diff --git a/src/View/MainWindow.py b/src/View/MainWindow.py index 1e5d3a88..05db840a 100644 --- a/src/View/MainWindow.py +++ b/src/View/MainWindow.py @@ -175,6 +175,7 @@ define_model_action = [ "action_menu_rep_additional_lines", "action_menu_run_adists", "action_menu_pollutants", "action_menu_d90", "action_menu_dif", "action_menu_edit_geotiff", + "action_menu_meshing", "action_menu_boundary_conditions_temperature", "action_menu_initial_conditions_temperature", "action_menu_weather_parameters", "action_menu_run_adistt", @@ -310,6 +311,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): "action_menu_edit_scenarios": self.open_scenarios, "action_menu_edit_network": self.open_network, "action_menu_edit_geometry": self.open_geometry, + "action_menu_meshing": self.open_meshing, "action_menu_boundary_conditions": self.open_boundary_cond, "action_menu_boundary_conditions_sediment": self.open_boundary_cond_sed, @@ -351,6 +353,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): # Current actions "action_toolBar_network": self.open_network, "action_toolBar_geometry": self.open_geometry, + "action_toolBar_meshing": self.open_meshing, "action_toolBar_boundary_cond": self.open_boundary_cond, "action_toolBar_lateral_contrib": self.open_lateral_contrib, "action_toolBar_frictions": self.open_frictions, @@ -1339,7 +1342,10 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): GeometryWindow, data=[self._study, self.conf, reach] ): - return + return self.get_sub_window( + GeometryWindow, + data=[self._study, self.conf, reach] + ) geometry = GeometryWindow( study=self._study, @@ -1348,8 +1354,21 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): parent=self ) geometry.show() + return geometry else: self.msg_select_reach() + return None + + def open_meshing(self): + """Open the current reach geometry and its meshing dialog.""" + geometry = self.open_geometry() + if geometry is None or self._study.is_read_only(): + return + + geometry.raise_() + geometry.activateWindow() + QApplication.processEvents() + geometry.edit_meshing() def open_boundary_cond_sed(self): self.open_boundary_cond(tab=1) diff --git a/src/View/ui/MainWindow.ui b/src/View/ui/MainWindow.ui index 4d13ceb6..683f68b5 100644 --- a/src/View/ui/MainWindow.ui +++ b/src/View/ui/MainWindow.ui @@ -19,6 +19,7 @@ Serif + 75 true false @@ -64,6 +65,7 @@ Ubuntu + 50 false false @@ -87,6 +89,7 @@ Sans Serif + 50 false false @@ -126,6 +129,7 @@ &Geometry + @@ -257,6 +261,7 @@ Ubuntu + 50 false false @@ -275,6 +280,7 @@ Sans Serif + 50 false true @@ -325,6 +331,7 @@ Ubuntu + 50 false false @@ -346,6 +353,7 @@ + @@ -866,6 +874,30 @@ Open results temperature + + + + ressources/meshing.pngressources/meshing.png + + + Meshing + + + + + true + + + + ressources/meshing.pngressources/meshing.png + + + Meshing + + + Mesh geometry + +