Skip to content
This repository has been archived by the owner on Nov 8, 2020. It is now read-only.

Have user select provides #137

Closed
wants to merge 11 commits into from
Closed

Conversation

RichardLake
Copy link

Have user select provides when there are multiple choices.

Fixes KSP-CKAN/CKAN#976
Pops up the moment the user chooses a mod instead of waiting until the install. This way there can be accurate change sets and conflict detection.

@RichardLake
Copy link
Author

Reminder : Fix cancel button.

@Dazpoet
Copy link
Member

Dazpoet commented May 30, 2015

Tried the artifact out and I must say this way of handling the situation feels a lot better than the old one.

Fixes #976
Pops up the moment the user chooses a mod instead of waiting until the install. This way there can be accurate change sets and conflict detection.
Allows scrolling the error message and easier copying.
Now works. It deselects the mod which caused the screen to pop up. Also adds a test.
@pjf
Copy link
Member

pjf commented May 30, 2015

You rock! This is also on my morning list. :)

@mgsdk
Copy link

mgsdk commented May 30, 2015

With the latest artifact:

  • Select TAC for install.
  • Dialog pops up/tab opens.
  • Both stock and RO config is selected by default.
  • Try to be a rebel and press continue even though the text states to select one.
  • Hard crash.
KDE colorscheme read failure, using built-in colorscheme
7564 [1] WARN CKAN.URLHandlers (null) - Skipping URL handler: Parsing Error: Could not parse file ~/.local/share/applications/mimeapps.list
24572 [1] ERROR CKAN.RelationshipResolver (null) - Dependency on RealismOverhaul found, but nothing provides it.
System.InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed.
  at System.Threading.Tasks.TaskCompletionSource`1[CKAN.CkanModule].SetResult (CKAN.CkanModule result) [0x00000] in <filename unknown>:0 
  at CKAN.Main.ChooseProvidedModsContinueButton_Click (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.OnClick (System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Button.OnClick (System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.ButtonBase.OnMouseUp (System.Windows.Forms.MouseEventArgs mevent) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Button.OnMouseUp (System.Windows.Forms.MouseEventArgs mevent) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.WmLButtonUp (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.ButtonBase.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Button.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) [0x00000] in <filename unknown>:0

For DistantObject, selecting the stock and Astronomers pack config (De-selecting RO config since it is not installable in 1.0.2):

KDE colorscheme read failure, using built-in colorscheme
6578 [1] WARN CKAN.URLHandlers (null) - Skipping URL handler: Parsing Error: Could not parse file ~/.local/share/applications/mimeapps.list
System.InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed.
  at System.Threading.Tasks.TaskCompletionSource`1[CKAN.CkanModule].SetResult (CKAN.CkanModule result) [0x00000] in <filename unknown>:0 
  at CKAN.Main.ChooseProvidedModsContinueButton_Click (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.OnClick (System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Button.OnClick (System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.ButtonBase.OnMouseUp (System.Windows.Forms.MouseEventArgs mevent) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Button.OnMouseUp (System.Windows.Forms.MouseEventArgs mevent) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.WmLButtonUp (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.ButtonBase.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Button.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) [0x00000] in <filename unknown>:0

Windows seems to fire ItemChecked on creation, Linux does not. As such all checkbox where selected on Linux leading to errors.
Fixes some of KSP-CKAN#137 (comment)
When a selected provide mod it self triggered to many provides the next screen's cancel button was incorrectly cancelling the original mod.
@Dazpoet
Copy link
Member

Dazpoet commented May 30, 2015

I choose TACLS on a 1.0.2 install and then picked the RO-Config which correctly throws an window with

CKAN.ModuleNotFoundKraken: Exception of type 'CKAN.ModuleNotFoundKraken' was thrown.
   at CKAN.RelationshipResolver.ResolveStanza(IEnumerable`1 stanza, Relationship reason, RelationshipResolverOptions options, Boolean soft_resolve)
   at CKAN.RelationshipResolver.Resolve(CkanModule module, RelationshipResolverOptions options)
   at CKAN.RelationshipResolver..ctor(ICollection`1 modules, RelationshipResolverOptions options, Registry registry, KSPVersion kspversion)
   at CKAN.MainModList.<ComputeChangeSetFromModList>c__async0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at CKAN.Main.<UpdateChangeSetAndConflicts>c__async1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CKAN.Main.<ModList_CellValueChanged>c__async0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__0(Object state)

However when I press "continue" I'm left with a state where TACLS is still selected but not part of the Changeset. A rather minor inconvenience imo but I guess I should still report it :)

@mgsdk
Copy link

mgsdk commented May 30, 2015

Small note I didn't notice before: The tab which allows the user to select one of several configs does not have text for each column but just a blank white line.

Select mod for install was working on the filtered list instead of the whole.
ModuleNotFound occurs because the registry's availablewithprovides happy returns mods which are not available. Long term fixing that would be the correct solution
@RichardLake
Copy link
Author

Pushed fixes. If you have time can you retest?

@mgsdk
Copy link

mgsdk commented May 30, 2015

Still the same issue with the column header.

  • Select TAC.
  • Select cancel.
  • Select TAC.
  • Header is blank until resize of window.

@Dazpoet
Copy link
Member

Dazpoet commented May 30, 2015

O_O I'm now getting a real error window thrown at me when I choose the RO-Config which properly explains the potential cause of the problem.

However TACLS is still selected after choosing the incorrect Config and then dismissing the error. Choosing a valid Config (Stock-Config in this case) properly opens the changeset with TAC and the Config marked for installation.

@Dazpoet
Copy link
Member

Dazpoet commented May 30, 2015

Building on the above with a more advanced example.

KSP 1.0.2

  1. Check Astronomers Visual Pack
  2. Pick a cloud config
    Changeset tab exists
  3. Check TAC-LS
  4. Choose the RO-Config (not available for 1.0.2)
  5. Dismiss or continue past the error
    Changeset tab no longer exists and TAC-LS is still checked
  6. Manually check the TAC-LS stock config or uncheck TAC-LS
    Changeset tab re-emerges with the whole Changeset, including Astronomers

Otherwise if a provides throws a InconsistentKraken the contents would leak.
RichardLake added a commit to RichardLake/CKAN that referenced this pull request May 31, 2015
Windows seems to fire ItemChecked on creation, Linux does not. As such all checkbox where selected on Linux leading to errors.
Fixes some of KSP-CKAN/CKAN-GUI#137 (comment)
RichardLake added a commit to RichardLake/CKAN that referenced this pull request May 31, 2015
Windows seems to fire ItemChecked on creation, Linux does not. As such all checkbox where selected on Linux leading to errors.
Fixes some of KSP-CKAN/CKAN-GUI#137 (comment)
RichardLake added a commit to RichardLake/CKAN that referenced this pull request May 31, 2015
Windows seems to fire ItemChecked on creation, Linux does not. As such all checkbox where selected on Linux leading to errors.
Fixes some of KSP-CKAN/CKAN-GUI#137 (comment)
RichardLake added a commit to RichardLake/CKAN that referenced this pull request Jun 1, 2015
RichardLake added a commit to RichardLake/CKAN that referenced this pull request Jun 2, 2015
Windows seems to fire ItemChecked on creation, Linux does not. As such all checkbox where selected on Linux leading to errors.
Fixes some of KSP-CKAN/CKAN-GUI#137 (comment)
RichardLake added a commit to RichardLake/CKAN that referenced this pull request Jun 2, 2015
RichardLake added a commit to RichardLake/CKAN that referenced this pull request Jun 2, 2015
RichardLake added a commit to RichardLake/CKAN that referenced this pull request Jun 2, 2015
Windows seems to fire ItemChecked on creation, Linux does not. As such all checkbox where selected on Linux leading to errors.
Fixes some of KSP-CKAN/CKAN-GUI#137 (comment)
RichardLake added a commit to RichardLake/CKAN that referenced this pull request Jun 2, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants