Reduced Personnel Table Right-Click Menu Clutter #3970
Merged
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.
Current Implementation
Currently, when right-clicking on an employee on the Personnel Table, users are presented with a long list of options.
Problem
As shown in the above image, this list has gotten pretty lengthy and some options (such as 'edit personnel log...' and 'add single log entry') effectively replicate functionality. While, yes, clicking 'add single log entry' (instead of 'edit personnel log') does save one click, I don't think it warrants the clutter.
Solution
I went through and grouped a couple of similar functions together, as outlined below.
Edit Logs
Edit Logs has different functionality depending on whether one, or more, employees are selected. This ensures that prior functionality is maintained, while also reducing the number of available options.
Edit Profile
Edit Profile encompasses 'Change Portrait' (single), 'Change Biography', and 'Change Callsign'. When multiple employees are selected, 'Edit Profile' is no longer available, and is replaced by the 'Bulk Change to a Single Portrait' option. As with 'Edit Logs', this retains prior functionality, while also reducing the number of available options.
General Changes
I also went through and adjusted the wording of a couple options and removed the ellipses from options in this menu. This gives the menu a cleaner look.
Notes
JMenuHelpers.addMenuIfNonEmpty()
is used extensively throughoutMekHQ/src/mekhq/gui/adapter/PersonnelTableMouseAdapter.java
and is marked as Depreciated.