Skip to content

Commit

Permalink
fix values
Browse files Browse the repository at this point in the history
  • Loading branch information
JanCaha committed Oct 15, 2024
1 parent bc678e5 commit b9371de
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions los_tools/gui/dialog_los_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ def init_gui(self) -> None:
self.maximal_los_length.setValue(100, QgsUnitTypes.DistanceKilometers)
self.maximal_los_length.valueChanged.connect(self.fill_distances)
self.maximal_los_length.setDisabled(True)

self.use_maximal_los_length = QCheckBox()
self.use_maximal_los_length.stateChanged.connect(self.fill_distances)
self.use_maximal_los_length.toggled.connect(self.fill_distances)

layout_group_box_los.addRow("Default Sampling Size", self.default_sampling_size)
layout_group_box_los.addRow("Use Maximal LoS Length", self.use_maximal_los_length)
Expand Down Expand Up @@ -209,7 +210,7 @@ def remove_distance(self) -> None:
self.fill_distances()

def fill_distances(self) -> None:
self.maximal_los_length.setEnabled(self.use_maximal_los_length.isChecked())
self.maximal_los_length.setDisabled(not self.use_maximal_los_length.isChecked())

self.treeView.clear()

Expand Down Expand Up @@ -246,7 +247,7 @@ def fill_distances(self) -> None:
item = QTreeWidgetItem()
item.setText(
0,
f"Over {self._distances[-1]} to {self.maximal_los_length.distance().inUnits(result_unit)}",
f"Over {self._distances[-1]} to {self.maximal_los_length.distance()}",
)
item.setText(1, str(size))

Expand Down

0 comments on commit b9371de

Please sign in to comment.