Skip to content

Commit

Permalink
Merge pull request #788 from kartoza/analysis-dialog
Browse files Browse the repository at this point in the history
Fix analysis dialog
  • Loading branch information
timlinux authored Jan 23, 2025
2 parents fdac68e + edb66aa commit 38d12a6
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 114 deletions.
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author": "Kartoza",
"email": "[email protected]",
"description": "Gender Enabling Environments Spatial Tool",
"version": "0.4.9",
"version": "0.5.0",
"changelog": "",
"server": false
}
Expand Down
5 changes: 4 additions & 1 deletion geest/gui/dialogs/analysis_aggregation_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ def restore_dialog_geometry(self):
geometry = settings.value("AnalysisAggregationDialog/geometry")
if geometry:
log_message("Restoring dialog geometry")
self.resize(geometry.width(), geometry.height())
try:
self.resize(geometry.width(), geometry.height())
except AttributeError:
pass
else:
log_message("No saved geometry found, resizing dialog")
# Resize the dialog to be almost as large as the main window
Expand Down
216 changes: 104 additions & 112 deletions geest/ui/analysis_dialog_base.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>1084</width>
<width>1129</width>
<height>805</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="banner_label">
<property name="text">
Expand All @@ -40,12 +40,12 @@
<rect>
<x>0</x>
<y>0</y>
<width>1066</width>
<height>673</height>
<width>1111</width>
<height>657</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QGridLayout" name="wee_layout">
<item row="0" column="0">
<widget class="QLabel" name="wee_title">
Expand Down Expand Up @@ -98,7 +98,7 @@ padding: 4px;</string>
</item>
</layout>
</item>
<item row="1" column="0" colspan="2">
<item row="1" column="0">
<widget class="QLabel" name="aggregation_description">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Aggregation boundaries (optional):&lt;/span&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt; You can generate insights from the WEE analysis by providing subnational boundaries. For each boundary, we will calculate the majority WEE score, majority WEE by Population score (if population data is set below) and majority WEE by Job Distribution score (if configured below).&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
Expand All @@ -108,7 +108,7 @@ padding: 4px;</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QgsMapLayerComboBox" name="aggregation_combo"/>
Expand All @@ -125,102 +125,48 @@ padding: 4px;</string>
</item>
</layout>
</item>
<item row="3" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="wee_x_population_title">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background: #1BA1E2;
color: white;
padding: 4px;</string>
</property>
<property name="text">
<string>WEE by Population</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="wee_jobs_title">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background: #1BA1E2;
<item row="3" column="0">
<widget class="QLabel" name="wee_x_population_title">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background: #1BA1E2;
color: white;
padding: 4px;</string>
</property>
<property name="text">
<string>WEE by Job Distribution</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</property>
<property name="text">
<string>WEE by Population</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="wee_x_population_description">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Optional:&lt;/span&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt; You can visualize WEE with respect to female population distribution. Please provide a raster dataset below containing (female) population density and it will be combined with the WEE score to calculate the WEE by Population score. If you have set an aggregation layer above, this will be aggregated per subnational boundary to show the majory WEE by Population score per polygon.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignJustify|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="wee_x_jobs_description">
<property name="font">
<font>
<family>Noto Sans [GOOG]</family>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Optional: &lt;/span&gt;You can perform a targeted analysis of Women’s Enablement Environments with respect to the location of jobs. Input the location of existing or potential jobs either as a point file, in polygon format or raster format explore how the results relate to existing or planned job opportunities.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignJustify|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
<item row="4" column="0">
<widget class="QLabel" name="wee_x_population_description">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Optional:&lt;/span&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt; You can visualize WEE with respect to female population distribution. Please provide a raster dataset below containing (female) population density and it will be combined with the WEE score to calculate the WEE by Population score. If you have set an aggregation layer above, this will be aggregated per subnational boundary to show the majory WEE by Population score per polygon.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignJustify|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>false</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
Expand All @@ -246,7 +192,53 @@ padding: 4px;</string>
</item>
</layout>
</item>
<item row="5" column="1">
<item row="6" column="0">
<widget class="QLabel" name="wee_jobs_title">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background: #1BA1E2;
color: white;
padding: 4px;</string>
</property>
<property name="text">
<string>WEE by Job Distribution</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="wee_x_jobs_description">
<property name="font">
<font>
<family>Noto Sans [GOOG]</family>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Optional: &lt;/span&gt;You can perform a targeted analysis of Women’s Enablement Environments with respect to the location of jobs. Input the location of existing or potential jobs either as a point file, in polygon format or raster format explore how the results relate to existing or planned job opportunities.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignJustify|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QGroupBox" name="mask_source_group">
<property name="title">
<string>Mask Source</string>
Expand Down Expand Up @@ -390,21 +382,21 @@ padding: 4px;</string>
</layout>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QWidget" name="help_widget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="2" column="0">
<widget class="QWidget" name="help_widget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QDialogButtonBox" name="button_box">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
Expand Down

0 comments on commit 38d12a6

Please sign in to comment.