Improve UI robustness and group/selection handling#5270
Merged
DavidXanatos merged 2 commits intosandboxie-plus:masterfrom Mar 28, 2026
Merged
Improve UI robustness and group/selection handling#5270DavidXanatos merged 2 commits intosandboxie-plus:masterfrom
DavidXanatos merged 2 commits intosandboxie-plus:masterfrom
Conversation
Multiple fixes and enhancements across the tray, grouping, and selection logic: - QSbieAPI/SbieIni: preserve and round-trip empty group entries when serializing/deserializing text maps (emit "Group:" lines and parse empty payloads). - SandMan (tray & box logic): - Update tray icon/tooltip while delete-content operations are in progress, and make m_iDeletingContent decremented safely and initialized on state update. - Harden OnBoxDblClick/OnBoxMenu/PopUpMenu with null/empty checks to avoid crashes when items or API are missing. - Improve tray widget layout: size policies, spacing, elide mode, alignment and minimum width calculation instead of fixed width. - Add user-visible placeholder actions/items when no sandboxes match the tray filter. - Fix several recursive Depth++ call sites to use Depth + 1 for clarity and correctness. - SbieView (grouping & selection): - Add NormalizeGroups() to sanitize group data (remove duplicates, cycles, invalid refs) and call it on load/save to keep grouping consistent. - Implement selection utilities SelectBoxes, SelectNames and RestoreBoxSelectionLater to preserve/restore selection and scroll post-refresh. - Make AddNewBox use a longer singleShot delay to avoid races with proxy/layout timers when selecting newly-created boxes. - Coalesce rapid MoveItem calls into a batch (m_MoveBatchPending/m_MoveBatchChanged) to avoid repeated clears/refreshes; restore selection after batch completes. - Ensure group create/import/rename/delete operations keep reasonable focus: restore box/group selection or root focus as appropriate. - Various small fixes: always ensure the empty root group exists, append new groups to root, and avoid invalid model/index operations. These changes aim to fix crashes, prevent UI races, keep the user's focus after structural changes, and provide clear feedback in the tray when no sandboxes are present.
Add explicit action wrapper methods (AddNewBoxAction, AddNewGroupAction, ImportBoxesAction) and update OnSandBoxAction to call them. Introduce name-focused selection handling: track m_MoveBatchFocusNames, collect/GetSelectedGroups(), and add RestoreNameSelectionLater to restore group/name selections after operations. Ensure tree receives focus when selecting items (setFocus calls) and consolidate selection restore logic in OnGroupAction and OnMoveItem so moved/imported groups remain selected and visible.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Multiple fixes and enhancements across the tray, grouping, and selection logic:
QSbieAPI/SbieIni: preserve and round-trip empty group entries when serializing/deserializing text maps (emit "Group:" lines and parse empty payloads).
SandMan (tray & box logic):
SbieView (grouping & selection):
These changes aim to fix crashes, prevent UI races, keep the user's focus after structural changes, and provide clear feedback in the tray when no sandboxes are present.