Skip to content

Commit

Permalink
changed notification when working directory not set in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
benvanbasten-ns committed Sep 21, 2023
1 parent 4c06ef7 commit 8a05753
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- Sideview: X marker and red path remain when different maptool is selected (#891)
- Sideview: Water colors now different for each result (#891)
- Sideview: autoscale now takes culvert into account (#891)
- Sideview: minor changes in look&feel (#891)
- Sideview: minor changes in look&feel (#891, #900)
- Sideview: current route is now kept when maptool is deselected (#891)
- Graph: added batch delete option (#884)
- Graph: features with same id, but different layer should have different color (#895)
Expand All @@ -20,7 +20,7 @@
- Visualization: Remove legend subgroup hidden feature (#769)
- Visualization: fix TypeError for result without net cumulative discharge (#903)
- Water balance: enable selection of multipolygons (#885)

- Results: changed notification when working directory not set in settings (#899)

3.1.8 (2023-09-04)
------------------
Expand Down
4 changes: 2 additions & 2 deletions gui/threedi_plugin_grid_result_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from qgis.core import QgsSettings
from qgis.PyQt.QtGui import QStandardItemModel, QStandardItem
from threedi_results_analysis.utils.workingdir import list_local_schematisations
from threedi_results_analysis.utils.user_messages import pop_up_critical

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -195,8 +194,9 @@ def refresh(self):
self.model.clear()
self.model.setHorizontalHeaderLabels(self.header_labels)
threedi_working_dir = QgsSettings().value("threedi/working_dir", "")
self.messageLabel.setText("")
if not threedi_working_dir:
pop_up_critical("3Di Working Directory not yet set. Please set this in the 3Di Models & Simulations settings.")
self.messageLabel.setText("Please set your 3Di working directory in the 3Di Models & Simulations settings to be able to load computational grids and results from your 3Di working directory.")
return

local_schematisations = list_local_schematisations(threedi_working_dir)
Expand Down
13 changes: 13 additions & 0 deletions gui/threedi_plugin_grid_result_dialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@
</attribute>
</widget>
</item>
<item>
<widget class="QLabel" name="messageLabel">
<property name="styleSheet">
<string notr="true">color : red;</string>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
Expand Down

0 comments on commit 8a05753

Please sign in to comment.