From 387d462c2c6e34eb4b7ac38752f12d39134070ff Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby Date: Fri, 9 Feb 2024 16:47:51 +0100 Subject: [PATCH] Geometry: Meshing: Update windows with radiobutton instead of checkbox. --- src/View/Geometry/MeshingDialog.py | 13 +++--- src/View/Geometry/Window.py | 5 ++- src/View/ui/MeshingOptions.ui | 72 ++++++++++++++++++------------ 3 files changed, 55 insertions(+), 35 deletions(-) diff --git a/src/View/Geometry/MeshingDialog.py b/src/View/Geometry/MeshingDialog.py index b5942dc5..053028cb 100644 --- a/src/View/Geometry/MeshingDialog.py +++ b/src/View/Geometry/MeshingDialog.py @@ -36,13 +36,15 @@ class MeshingDialog(PamhyrDialog): _pamhyr_ui = "MeshingOptions" _pamhyr_name = "Meshing" - def __init__(self, parent=None): + def __init__(self, reach, parent=None): super(MeshingDialog, self).__init__( title=self._pamhyr_name, options=[], parent=parent ) + self._reach = reach + self._init_default_values() def _init_default_values(self): @@ -55,8 +57,10 @@ class MeshingDialog(PamhyrDialog): self._space_step ) - self.set_check_box("checkBox_lplan", self._lplan) - self.set_check_box("checkBox_linear", self._linear) + if self._linear: + self.set_radio_button("radioButton_linear", True) + else: + self.set_radio_button("radioButton_spline", True) @property def space_step(self): @@ -74,8 +78,7 @@ class MeshingDialog(PamhyrDialog): self._space_step = self.get_double_spin_box( "doubleSpinBox_space_step", ) - self._lplan = self.get_check_box("checkBox_lplan") - self._linear = self.get_check_box("checkBox_linear") + self._linear = self.get_radio_button("radioButton_linear") super().accept() diff --git a/src/View/Geometry/Window.py b/src/View/Geometry/Window.py index 94a3b3c4..1f450678 100644 --- a/src/View/Geometry/Window.py +++ b/src/View/Geometry/Window.py @@ -261,7 +261,10 @@ class GeometryWindow(PamhyrWindow): def edit_meshing(self): try: - dlg = MeshingDialog(parent=self) + dlg = MeshingDialog( + reach=self._reach, + parent=self + ) if dlg.exec(): data = { "step": dlg.space_step, diff --git a/src/View/ui/MeshingOptions.ui b/src/View/ui/MeshingOptions.ui index 1ad0514b..fd3d077d 100644 --- a/src/View/ui/MeshingOptions.ui +++ b/src/View/ui/MeshingOptions.ui @@ -21,7 +21,7 @@ - false + true First cross section @@ -31,7 +31,7 @@ - false + true @@ -42,7 +42,7 @@ - false + true Last cross section @@ -52,7 +52,7 @@ - false + true @@ -67,7 +67,7 @@ - false + true First guide line @@ -77,7 +77,7 @@ - false + true @@ -88,7 +88,7 @@ - false + true Last guide line @@ -98,7 +98,7 @@ - false + true @@ -138,17 +138,17 @@ - false + true - lm + Distance computation guild line - false + true @@ -168,26 +168,40 @@ - - - true - - - Lplan - - + + + + + Spline + + + true + + + + + + + Linear + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - - - true - - - Linear - - - - Qt::Horizontal