-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
Show target version for upgrades in change set #2888
Conversation
So as it is right now in your PR, the But either way, if we introduce different properties used for a single change type, we should go all the way with your suggestion: separate classes inheriting from |
I'm skeptical about 'lightweight', since we're just holding references to objects that already exist in the registry; a reference to a I'll try refactoring |
42507ed
to
c78c479
Compare
OK, now we have a Also a bunch of compilation warnings are fixed. |
c78c479
to
cceeffb
Compare
The GUI hangs on startup at the end of the modlist initialization.
|
... great. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get this merged before another one opens a issue for this bug!
Problem
When you upgrade a module, the change set says it is going to "upgrade [...] to" the version that's already installed. That's wrong.
Cause
The change set is a sequence of
ModChange
objects, each of which holds a reference to just oneCkanModule
object, which is always the one that's currently installed or will be installed. For upgrades, the target version is known insideGUIMod
(it'sSelectedMod
), but is lost in the shuffle when the change set is generated until it's finally recalculated inModuleInstaller
. Since theModChange
representing an upgrade only has a reference to the version that's installed, that's what displays on screen.Changes
Now
GUIMod.GetRequestedChanges
is replaced withGUIMod.GetModChanges
which directly returns a sequence ofModChange
objects. This allowsGUIMod
to pass additional info to these objects that would not have fit into aKeyValuePair<CkanModule, GUIModChangeType>
, specifically a secondCkanModule
reference for the target version for upgrades sourced fromSelectedMod
, which is then used to populate the change set display.This change simplifies
ComputeUserChangeSet
, which no longer has to generate its ownModChange
objects fromKeyValuePair<CkanModule, GUIModChangeType>
objects.Fixes #2873.
Request for assistance
I need help improving the new structure of
ModChange
. I do not like the nameOtherMod
at all, but I am drawing a blank as to what to use instead. Or maybe some other overall approach would be better? Feedback solicited!