FSGModding / FSG_Mod_Assistant

Farming Simulator 22 Mod Manager.
https://fsgmodding.github.io/FSG_Mod_Assistant/
ISC License
74 stars 10 forks source link

[QUESTION] [BUG] [FEATURE] Download cancel button, bug with re-downloading while downloading, DL speed and remaining time #83

Closed KITT3000 closed 1 year ago

KITT3000 commented 1 year ago

Is there an existing issue for this?

Is your feature request related to a problem? Please describe.

Shouldn't the cancel download button be on the right side of the window or is it as intended as it is now? image

Describe the solution you'd like

No response

Anything else?

No response

KITT3000 commented 1 year ago

I also accidentally broke the program. image

Steps: 1) Run the download from the dedicated server. 2) Before the download is complete, click the download option again (the download will start again). 3) After a while, the error from the photo will appear. Additionally, I resized the download window and moved the main program window to another monitor.

I caused it because the download window is not "connected" to the program and after clicking on it from the taskbar it does not appear (due to 2 monitors and many programs open I did not notice that it was still active and I clicked re-download.

Crash LOG: crash.log

KITT3000 commented 1 year ago

Ok, sorry that it came out so strange, but I'll write everything here, so at the end: Is it possible to add download speed (e.g. in the middle of this circle) and the remaining time to complete the download?

jtsage commented 1 year ago

Huh. Interesting. In order

1.) Yes, the cancel button location was on purpose - it was really tough to get it to fit nicely with all of the different localizations on the right, and I couldn't be totally sure it would be in view (some locales have longer strings than others, and it was getting knocked off screen, so this seemed the easy compromise)

2.) Well, running 2 at a time is indeed not intended - I'll add some code to make sure that doesn't happen. As to the error, I imagine that my temp file name was not as unique as it probably ought to be - so you were in essence downloading twice to the same file. Maybe appending the date to it twice too? Not sure, but not a good plan anyway. This may be a case where it would be better to put the progress popup in the main window rather than in the separate one and force the user to wait.

3.) A speed and time remaining - yeah, probably. Speed is a factor of time elapsed, and guessing time remaining likely isn't that hard - I make no guarantees on how accurate it will be, but it should at least provide a good guess. As to where it will appear - I like the idea of putting it in the spinner, let me see if I can make that accurately happen for all locales - but I'm sure I can make it pretty somewhere on that dialog. Actually both of these lean towards it being a model dialog being a better plan, as the interface for that popup status window isn't terribly flexible. I'm honestly wondering if most of those progress windows should be self contained instead - it is sadly a limitation of windows that I can set a window to be always on top, but then it's always on top, and not just forced to the front of that app, which was my intent when it was made to be independent. I believe the only time that progress is truly triggered from elsewhere is the two mod cache operation buttons in preferences.

Thanks much!

jtsage commented 1 year ago

As a side note, more for me - an invalid signature and/or invalid ZIP file after download should not kill the program like that. Need to catch that.

jtsage commented 1 year ago

2023-02-20 18_39_06-FSG Mod Assistant

jtsage commented 1 year ago

I think I hit all of these, closing, unless I'm wrong, then feel free to re-open