Skip to content

Commit 25bd143

Browse files
committed
docs: save state of provider combobox
1 parent d497168 commit 25bd143

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

ORStools/gui/ORStoolsDialog.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,9 @@ def __init__(self, iface: QgisInterface, parent=None) -> None:
533533
lambda: self.color_duplicate_items(self.routing_fromline_list)
534534
)
535535

536+
self.load_provider_combo_state()
537+
self.provider_combo.activated.connect(self.save_selected_provider_state)
538+
536539
self.annotation_canvas = self._iface.mapCanvas()
537540

538541
def _save_vertices_to_layer(self) -> None:
@@ -694,3 +697,15 @@ def color_duplicate_items(self, list_widget):
694697
for index in indices:
695698
item = list_widget.item(index)
696699
item.setBackground(QColor("lightsalmon"))
700+
701+
def load_provider_combo_state(self):
702+
s = QgsSettings()
703+
index = s.value("ORSTools/gui")
704+
print("load", index)
705+
if index:
706+
self.provider_combo.setCurrentIndex(index)
707+
708+
def show(self):
709+
"""Load the saved state when the window is shown"""
710+
super().show()
711+
self.load_provider_combo_state()

0 commit comments

Comments
 (0)