-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
Hide StatusProgress-bar if user cancels installation #2418
Conversation
Gives a better `StatusMessage` too.
Interestingly, the GUI switches to the Modlist tab afterwards, and I have no idea why, as it shouldn't do it on errors though, and I see no code difference between handling errors and handling user cancellation regarding tab switches. |
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.
Added a few code comments. The overall approach looks reasonable to me. Nice job!
I believe the switching back to mod list happens in MainWait.cs
, in CancelCurrentActionButton_Click
, which calls HideWaitDialog
at the end. Just mentioning that in case you want to investigate it.
GUI/MainInstall.cs
Outdated
@@ -390,6 +390,19 @@ private void PostInstallMods(object sender, RunWorkerCompletedEventArgs e) | |||
RetryCurrentActionButton.Visible = false; | |||
UpdateChangesDialog(null, installWorker); | |||
} | |||
else if(!result.Key && installCanceled){ |
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.
We don't need to check result.Key
here, because we're already in the else
block of if (result.Key)
.
Also, can you put the curly brace on a new line? This file follows that convention currently.
GUI/MainInstall.cs
Outdated
RetryCurrentActionButton.Visible = true; | ||
Util.Invoke(statusStrip1, () => | ||
{ | ||
StatusProgress.Value = 0; |
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.
It would be nice if we didn't have to directly manipulate specific properties of GUI objects here. Some sort of helper function to encapsulate this at a higher level.
MainWait.cs
already has a partial API along those lines with ShowWaitDialog
and HideWaitDialog
. Maybe it should also have FailWaitDialog
, which could then be called by the cancel and error blocks here? Looks like the parameters should be the messages to display.
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.
HideWaitDialog
already gets passed a bool success
, but it's not used yet.
Either we keep this and differentiate success
or we create an explicit function.
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.
I thought the idea was to avoid hiding it, though, so the user can look at the errors.
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.
Well, as you mention it...
It would be a bit odd to have a funtion called HideWaitDialog to not hide the WaitDialog in case of an error...
Moved all GUI manipulations for cancelled installation to FailWaitDialog() in MainWait.cs
Need to sleep a night about this as this is some high level sh*t which definitely exceeds my capabilities by now. |
Boy, I know what that feels like! |
Gives a better `StatusMessage` too.
Moved all GUI manipulations for cancelled installation to FailWaitDialog() in MainWait.cs
Okay this was some strange rebase... |
Now clicking cancel first checks if everything was completed successfully despite cancling so there are no false error statements.
So I added the check if the installation completed despite "canceling", a bit hacky, but working (I think) Edit: The build fail is not my fault! It's TravisCI which failed on connecting to network again. |
What build fail? 😀 |
@DasSkelett , is this ready to merge, or are you still needing to work on it some more? |
Hey, back again, sorry for the long wait. |
Problem:
If you manually cancel the Installation process, the lower right Progress bar keeps moving.
Solution:
Reset and hides
StatusProgress
bar if user cancels installation.Give a better
StatusMessage
too (as "Error!" is not only verry vague, it's incorrect too in this case.)Fixes #2417