Commit 387d462c authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

Geometry: Meshing: Update windows with radiobutton instead of checkbox.

Showing with 55 additions and 35 deletions
+55 -35
......@@ -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()
......
......@@ -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,
......
......@@ -21,7 +21,7 @@
<item>
<widget class="QLabel" name="label">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="text">
<string>First cross section</string>
......@@ -31,7 +31,7 @@
<item>
<widget class="QComboBox" name="comboBox_begin_kp">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
</widget>
</item>
......@@ -42,7 +42,7 @@
<item>
<widget class="QLabel" name="label_2">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="text">
<string>Last cross section</string>
......@@ -52,7 +52,7 @@
<item>
<widget class="QComboBox" name="comboBox_end_kp">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
</widget>
</item>
......@@ -67,7 +67,7 @@
<item>
<widget class="QLabel" name="label_5">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="text">
<string>First guide line</string>
......@@ -77,7 +77,7 @@
<item>
<widget class="QComboBox" name="comboBox_begin_kp_2">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
</widget>
</item>
......@@ -88,7 +88,7 @@
<item>
<widget class="QLabel" name="label_6">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="text">
<string>Last guide line</string>
......@@ -98,7 +98,7 @@
<item>
<widget class="QComboBox" name="comboBox_end_kp_2">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
</widget>
</item>
......@@ -138,17 +138,17 @@
<item>
<widget class="QLabel" name="label_4">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="text">
<string>lm</string>
<string>Distance computation guild line</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_lm">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
</widget>
</item>
......@@ -168,26 +168,40 @@
</layout>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="checkBox_lplan">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Lplan</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QRadioButton" name="radioButton_spline">
<property name="text">
<string>Spline</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_linear">
<property name="text">
<string>Linear</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="checkBox_linear">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Linear</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment