From 1492cf546764308009230f714b0a9d7702f99b5e Mon Sep 17 00:00:00 2001
From: nilsnolde
' \
'Email: {1}
' \
'Web: {2}
' \
- 'Repo: github.com/nilsnolde/ORStools
' \
+ 'Repo: github.com/GIScience/ORStools
' \
'Version: {3}'.format(DEFAULT_COLOR, __email__, __web__, __version__)
QMessageBox.information(
@@ -209,6 +210,7 @@ def _init_gui_control(self):
# Make sure plugin window stays open when OK is clicked by reconnecting the accepted() signal
self.dlg.global_buttons.accepted.disconnect(self.dlg.accept)
self.dlg.global_buttons.accepted.connect(self.run_gui_control)
+ self.dlg.avoidpolygon_dropdown.setFilters(QgsMapLayerProxyModel.PolygonLayer)
# Populate provider box on window startup, since can be changed from multiple menus/buttons
providers = configmanager.read_config()['providers']
diff --git a/ORStools/gui/ORStoolsDialogUI.py b/ORStools/gui/ORStoolsDialogUI.py
index e67ce10b..ed6c57e6 100644
--- a/ORStools/gui/ORStoolsDialogUI.py
+++ b/ORStools/gui/ORStoolsDialogUI.py
@@ -11,7 +11,7 @@
class Ui_ORStoolsDialogBase(object):
def setupUi(self, ORStoolsDialogBase):
ORStoolsDialogBase.setObjectName("ORStoolsDialogBase")
- ORStoolsDialogBase.resize(412, 781)
+ ORStoolsDialogBase.resize(412, 868)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
@@ -200,10 +200,11 @@ def setupUi(self, ORStoolsDialogBase):
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.advances_group.sizePolicy().hasHeightForWidth())
self.advances_group.setSizePolicy(sizePolicy)
- self.advances_group.setMaximumSize(QtCore.QSize(16777215, 16777215))
+ self.advances_group.setMaximumSize(QtCore.QSize(16777215, 23))
self.advances_group.setCheckable(False)
self.advances_group.setChecked(False)
- self.advances_group.setCollapsed(False)
+ self.advances_group.setCollapsed(True)
+ self.advances_group.setSaveCollapsedState(False)
self.advances_group.setObjectName("advances_group")
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.advances_group)
self.verticalLayout_3.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)
@@ -215,10 +216,11 @@ def setupUi(self, ORStoolsDialogBase):
sizePolicy.setHeightForWidth(self.optimization_group.sizePolicy().hasHeightForWidth())
self.optimization_group.setSizePolicy(sizePolicy)
self.optimization_group.setMinimumSize(QtCore.QSize(0, 0))
- self.optimization_group.setMaximumSize(QtCore.QSize(16777215, 115))
+ self.optimization_group.setMaximumSize(QtCore.QSize(16777215, 23))
self.optimization_group.setCheckable(True)
self.optimization_group.setChecked(False)
- self.optimization_group.setCollapsed(False)
+ self.optimization_group.setCollapsed(True)
+ self.optimization_group.setSaveCollapsedState(False)
self.optimization_group.setObjectName("optimization_group")
self.gridLayout_2 = QtWidgets.QGridLayout(self.optimization_group)
self.gridLayout_2.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)
@@ -255,6 +257,7 @@ def setupUi(self, ORStoolsDialogBase):
self.routing_avoid_tags_group.setCheckable(True)
self.routing_avoid_tags_group.setChecked(False)
self.routing_avoid_tags_group.setCollapsed(True)
+ self.routing_avoid_tags_group.setSaveCollapsedState(False)
self.routing_avoid_tags_group.setObjectName("routing_avoid_tags_group")
self.gridLayout_4 = QtWidgets.QGridLayout(self.routing_avoid_tags_group)
self.gridLayout_4.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)
@@ -285,6 +288,7 @@ def setupUi(self, ORStoolsDialogBase):
self.routing_avoid_countries_group.setCheckable(True)
self.routing_avoid_countries_group.setChecked(False)
self.routing_avoid_countries_group.setCollapsed(True)
+ self.routing_avoid_countries_group.setSaveCollapsedState(False)
self.routing_avoid_countries_group.setObjectName("routing_avoid_countries_group")
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.routing_avoid_countries_group)
self.verticalLayout_4.setObjectName("verticalLayout_4")
@@ -293,6 +297,25 @@ def setupUi(self, ORStoolsDialogBase):
self.countries_text.setObjectName("countries_text")
self.verticalLayout_4.addWidget(self.countries_text)
self.verticalLayout_3.addWidget(self.routing_avoid_countries_group)
+ self.avoidpolygon_group = QgsCollapsibleGroupBox(self.advances_group)
+ sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.avoidpolygon_group.sizePolicy().hasHeightForWidth())
+ self.avoidpolygon_group.setSizePolicy(sizePolicy)
+ self.avoidpolygon_group.setMaximumSize(QtCore.QSize(16777215, 23))
+ self.avoidpolygon_group.setCheckable(True)
+ self.avoidpolygon_group.setChecked(False)
+ self.avoidpolygon_group.setCollapsed(True)
+ self.avoidpolygon_group.setSaveCollapsedState(False)
+ self.avoidpolygon_group.setObjectName("avoidpolygon_group")
+ self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.avoidpolygon_group)
+ self.verticalLayout_6.setObjectName("verticalLayout_6")
+ self.avoidpolygon_dropdown = QgsMapLayerComboBox(self.avoidpolygon_group)
+ self.avoidpolygon_dropdown.setShowCrs(False)
+ self.avoidpolygon_dropdown.setObjectName("avoidpolygon_dropdown")
+ self.verticalLayout_6.addWidget(self.avoidpolygon_dropdown)
+ self.verticalLayout_3.addWidget(self.avoidpolygon_group)
self.verticalLayout_7.addWidget(self.advances_group)
self.tabWidget.addTab(self.qwidget, "")
self.batch_tab = QtWidgets.QWidget()
@@ -465,6 +488,9 @@ def retranslateUi(self, ORStoolsDialogBase):
self.routing_avoid_countries_group.setToolTip(_translate("ORStoolsDialogBase", "
Avoid countries based on alphnumeric ISO 3166 Alpha-2 or Alpha-3 codes.
Find a list of codes at https://github.com/GIScience/openrouteservice-docs#country-list.
")) self.routing_avoid_countries_group.setTitle(_translate("ORStoolsDialogBase", "Avoid countries")) self.countries_text.setToolTip(_translate("ORStoolsDialogBase", "Avoid countries based on ISO 3166 Alpha-2 or Alpha-3 codes.
")) + self.avoidpolygon_group.setToolTip(_translate("ORStoolsDialogBase", "Avoid areas by specifying a (Multi-)Polygon layer.
Note, only the first feature of the layer will be respected.
")) + self.avoidpolygon_group.setTitle(_translate("ORStoolsDialogBase", "Avoid polygon(s)")) + self.avoidpolygon_dropdown.setToolTip(_translate("ORStoolsDialogBase", "Avoid areas by specifying a (Multi-)Polygon layer.
Note, only the first feature of the layer will be respected.
")) self.tabWidget.setTabText(self.tabWidget.indexOf(self.qwidget), _translate("ORStoolsDialogBase", "Advanced Directions")) self.groupBox.setTitle(_translate("ORStoolsDialogBase", "Directions")) self.batch_routing_line.setText(_translate("ORStoolsDialogBase", "Polylines Layer")) @@ -483,4 +509,5 @@ def retranslateUi(self, ORStoolsDialogBase): from qgscollapsiblegroupbox import QgsCollapsibleGroupBox from qgsfilterlineedit import QgsFilterLineEdit +from qgsmaplayercombobox import QgsMapLayerComboBox from . import resources_rc diff --git a/ORStools/gui/ORStoolsDialogUI.ui b/ORStools/gui/ORStoolsDialogUI.ui index 478fb526..07a1cb84 100644 --- a/ORStools/gui/ORStoolsDialogUI.ui +++ b/ORStools/gui/ORStoolsDialogUI.ui @@ -7,7 +7,7 @@