Skip to content

GUI: do not remove parameter value on dialog update event #5760

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

Merged
merged 2 commits into from
May 31, 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
9 changes: 4 additions & 5 deletions gui/wxpython/gui_core/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,6 @@ def run(self):

# @todo: replace name by isinstance() and signals

pBind = self.task.get_param(uid, element="wxId", raiseError=False)
if pBind:
pBind["value"] = ""

# set appropriate types in t.* modules and g.list/remove element
# selections
if name == "Select":
Expand Down Expand Up @@ -336,17 +332,20 @@ def run(self):
"vector": map,
"layer": layer,
"dbInfo": cparams[map]["dbInfo"],
"setDefaultValue": False,
}
# table
elif driver and db:
self.data[win.GetParent().InsertTableColumns] = {
"table": pTable.get("value"),
"driver": driver,
"database": db,
"setDefaultValue": False,
}
elif pTable:
self.data[win.GetParent().InsertTableColumns] = {
"table": pTable.get("value")
"table": pTable.get("value"),
"setDefaultValue": False,
}

elif name == "SubGroupSelect":
Expand Down
14 changes: 12 additions & 2 deletions gui/wxpython/gui_core/gselect.py
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,14 @@ def Clear(self):
self.SetValue("")

def InsertColumns(
self, vector, layer, excludeKey=False, excludeCols=None, type=None, dbInfo=None
self,
vector,
layer,
excludeKey=False,
excludeCols=None,
type=None,
dbInfo=None,
setDefaultValue=True,
):
"""Insert columns for a vector attribute table into the columns combobox

Expand All @@ -1150,6 +1157,8 @@ def InsertColumns(
:param excludeKey: exclude key column from the list?
:param excludeCols: list of columns to be removed from the list
:param type: only columns of given type (given as list)
:param dbInfo: dbInfo object
:param setDefaultValue: True to set default value
"""
if not dbInfo:
dbInfo = VectorDBInfo(vector)
Expand Down Expand Up @@ -1187,7 +1196,8 @@ def InsertColumns(
for col in self.columns:
self.tcp.AddItem(col)

self.SetValue(self.defaultValue)
if setDefaultValue:
self.SetValue(self.defaultValue)

if self.param:
value = self.param.get("value", "")
Expand Down
Loading