Skip to content
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

Customisable columns in GUI Modlist #2690

Merged
merged 2 commits into from Mar 15, 2019

Conversation

DasSkelett
Copy link
Member

@DasSkelett DasSkelett commented Feb 26, 2019

This PR adds the option to hide columns in the modlist. as asked by @politas in #2687.

This happens via a right click context menu on the header row of the modlist:
ckan1

The columns are hidden with column.Visibility = false, which seems to work perfectly fine in my testing. This doesn't need a reload of the modlist or anything, so it's fast.
On every change of the visibility of a column it is saved to the GUIconfig, which means it's persistend across ckan restarts.

The Update and the Replace checkbox columns are hidden by default, and only shown if an update / a replacement is available. I could only test updates yet, but replacements should work the same.
Once all updates / replacements have been done, the columns are hidden again.
This all happens in UpdateModsList().

Furthermore, the Installed version and the Install date columns are hidden with the Not Installed filter setting selected, there's no sense in showing them. This happens without a GUIconfig change, so once the filter is changed again, those two columns reappear (or stay hidden) based on the previous setting.

many columns hidden updates available

Closes #2687


Small sidefix: if you right-clicked on the modlist header bar before, the context menu for the mod rows opened, despite it shouldn't. It's fixed now by not assigning ModList.ContextMenuStrip = ModListContextMenuStrip. Instead, the new column selection menu opens, obviously.

@HebaruSan
Copy link
Member

Let's remove the update/replace columns from the menu since we're managing them automatically.

@DasSkelett
Copy link
Member Author

I'm going to set the Installed checkbox column (the first one) to always visible then true.
Else the code will get a bit messy, because I access the columns via their index (which is taken from the index of the clicked button).

@DasSkelett
Copy link
Member Author

Removed the buttons for the first three columns in the context menu.
Beware: If you've already run the previous commit, make sure to either delete the whole GUIConfig.xml or only the VisibleColumns array, because I shortened the array, and "using" the old one will be buggy.

@HebaruSan
Copy link
Member

This looks pretty good. Created DasSkelett#3 with some code style and UI ideas.

@DasSkelett
Copy link
Member Author

For the record: @HebaruSan's suggestions are merged and included. Thanks :)

GUI/MainModList.cs Outdated Show resolved Hide resolved
@HebaruSan
Copy link
Member

DasSkelett#4 created with a suggestion for the config.

…mn (#4)

* Save/load column names instead of list of bools

* Remove auto-managed columns from default config list

* Save/load hidden columns instead of visible

* Rename col vis config func

By @HebaruSan
Copy link
Member

@HebaruSan HebaruSan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. My favorite part of this is the hiding of the update/replace columns when they're not needed.

@HebaruSan HebaruSan added Enhancement GUI Issues affecting the interactive GUI Pull request labels Mar 5, 2019
@politas politas merged commit edca196 into KSP-CKAN:master Mar 15, 2019
politas added a commit that referenced this pull request Mar 15, 2019
@DasSkelett DasSkelett deleted the feature/customModListColumns branch March 26, 2019 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement GUI Issues affecting the interactive GUI Pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Customise columns in GUI Modlist
3 participants