Skip to content

Commit

Permalink
fix: only generate profile when checkbox is ticked
Browse files Browse the repository at this point in the history
  • Loading branch information
merydian committed Feb 13, 2024
1 parent 5de13aa commit 6cf1738
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions ORStools/gui/ORStoolsDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,6 @@ def __init__(self, iface, parent=None):

# Recalculate elevation profile when vertex list changes
self.routing_fromline_list.model().rowsMoved.connect(self.update_elevation_profile)
self.routing_fromline_list.model().rowsRemoved.connect(self.update_elevation_profile)
self.routing_fromline_list.model().rowsInserted.connect(self.update_elevation_profile)

self.routing_travel_combo.currentIndexChanged.connect(self.update_elevation_profile)
self.routing_preference_combo.currentIndexChanged.connect(self.update_elevation_profile)
Expand All @@ -469,12 +467,17 @@ def __init__(self, iface, parent=None):
self.checkBox_elevation_profile.toggled.connect(self.toggle_elevation_profile)

def update_elevation_profile(self):
elev = Elevation(self)
elev.make_image()
if self.checkBox_elevation_profile.isChecked():
elev = Elevation(self)
elev.make_image()

def toggle_elevation_profile(self):
elev_check = self.checkBox_elevation_profile.isChecked()
if elev_check:
elev = Elevation(self)
elev.make_image()
if self.routing_fromline_list.count() not in [0, 1]:
self.label_elevation_profile.setVisible(self.checkBox_elevation_profile.isChecked())
self.label_elevation_profile.setVisible(elev_check)
else:
if self.checkBox_elevation_profile.isChecked():
QMessageBox.critical(
Expand Down

0 comments on commit 6cf1738

Please sign in to comment.