gui: populate model list on dialog open

When the new-session dialog opens, the backend combo defaults to index 0
but onCurrentTextChanged doesn't fire for the initial value. Explicitly
call listModelsByBackend for the default backend so the model dropdown
is populated immediately.
This commit is contained in:
Levi Neely 2026-07-30 16:29:50 +02:00
parent e4c1cea385
commit 1a6aab7a13
2 changed files with 6 additions and 0 deletions

View File

@ -196,6 +196,9 @@ ApplicationWindow {
newSessionDialog.backendCombo.currentIndex = 0
newSessionDialog.agentCombo.currentIndex = 0
newSessionDialog.modelCombo.editText = ""
// Populate model list for the default (first) backend
if (newSessionDialog.backendCombo.currentText)
newSessionDialog.modelCombo.model = dbus.listModelsByBackend(newSessionDialog.backendCombo.currentText)
newSessionDialog.open()
}

View File

@ -194,6 +194,9 @@ ApplicationWindow {
newSessionDialog.backendCombo.currentIndex = 0
newSessionDialog.agentCombo.currentIndex = 0
newSessionDialog.modelCombo.editText = ""
// Populate model list for the default (first) backend
if (newSessionDialog.backendCombo.currentText)
newSessionDialog.modelCombo.model = dbus.listModelsByBackend(newSessionDialog.backendCombo.currentText)
newSessionDialog.open()
}