Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poista yleismääräys kaavamääräysryhmän tyypin valinnasta uuden kaavamääräysryhmän lomakkeessa #196

Merged
merged 2 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions arho_feature_template/gui/components/code_combobox.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ def set_value(self, value: str | None) -> None:
if index != -1:
self.setCurrentIndex(index)

def remove_item_by_text(self, text: str):
index = self.findText(text)
if index != -1:
self.removeItem(index)


class HierarchicalCodeComboBox(QComboBox):
def __init__(self, parent=None):
Expand Down
2 changes: 1 addition & 1 deletion arho_feature_template/gui/dialogs/plan_feature_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(
self.show_regulation_group_library(0)

self.feature_type_of_underground.populate_from_code_layer(UndergroundTypeLayer)
self.feature_type_of_underground.removeItem(0) # Remove NULL from combobox as underground data is required
self.feature_type_of_underground.remove_item_by_text("NULL")
self.feature_type_of_underground.setCurrentIndex(1) # Set default to Maanpäällinen (index 1)

# Initialize attributes from template
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ def __init__(self, regulation_group: RegulationGroup):
self._initalize_regulation_from_config(config)

self.type_of_regulation_group.populate_from_code_layer(PlanRegulationGroupTypeLayer)
self.type_of_regulation_group.removeItem(0) # Remove NULL from selections
self.type_of_regulation_group.remove_item_by_text("NULL")
self.type_of_regulation_group.remove_item_by_text("Yleismääräykset")

self.add_proposition_btn.clicked.connect(self.add_new_proposition)
self.add_proposition_btn.setIcon(QgsApplication.getThemeIcon("mActionAdd.svg"))
Expand Down
Loading