Skip to content

Gui: Fix Spaceball button list not updating on device reset#28956

Open
Maik-0000FF wants to merge 1 commit intoFreeCAD:mainfrom
Maik-0000FF:fix/spaceball-reset-model
Open

Gui: Fix Spaceball button list not updating on device reset#28956
Maik-0000FF wants to merge 1 commit intoFreeCAD:mainfrom
Maik-0000FF:fix/spaceball-reset-model

Conversation

@Maik-0000FF
Copy link
Copy Markdown
Contributor

When you select a device from the dropdown in the Spaceball Buttons dialog and press Reset, the button list doesn't update. It keeps showing the old entries until you close and reopen the dialog.

The problem is in ButtonModel::loadConfig(). It calls goClear() which does beginRemoveRows/endRemoveRows, then load3DConnexionButtons() writes new button entries to user.cfg — but without calling beginInsertRows/endInsertRows. The view never learns about the new rows.

The fix wraps the whole operation in beginResetModel/endResetModel so the view refreshes in one go.

Tested on Arch Linux / KDE Plasma Wayland with SpaceNavigator (046d:c626). Selected "SpaceNavigator" from the dropdown, pressed Reset — the list now immediately updates from 31 entries to 2. Before the fix, the list stayed at 31 until the dialog was reopened.

Fixes #19366

ButtonModel::loadConfig() called goClear() which notified the view
about removed rows, then load3DConnexionButtons() wrote new entries
to user.cfg without any model notification. The view kept showing
the old button list until the dialog was reopened.

Use beginResetModel/endResetModel to wrap the entire clear and load
operation so the view updates immediately.

Fixes FreeCAD#19366
@github-actions github-actions Bot added the Mod: Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD label Apr 1, 2026
@maxwxyz maxwxyz added the Type: Bug This issue or PR is related to a bug label Apr 1, 2026
@maxwxyz maxwxyz added this to the 1.2 milestone Apr 1, 2026
@maxwxyz maxwxyz moved this from Queue to Merge Meeting in Merge Queue Apr 1, 2026
@chennes chennes added the Approved: Code Quality The PR was checked for code quality and approved label Apr 10, 2026
@maxwxyz maxwxyz moved this from Merge Meeting to Approved in Merge Queue Apr 10, 2026
@Maik-0000FF
Copy link
Copy Markdown
Contributor Author

gentle ping — anything blocking review here? happy to rebase or address feedback if needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved: Code Quality The PR was checked for code quality and approved Mod: Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD Type: Bug This issue or PR is related to a bug

Projects

Status: Approved

Development

Successfully merging this pull request may close these issues.

Navigation: SpaceBall Button Dialog "Reset" function breaks the SpaceBall button configuration

4 participants