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

More detailed error reporting for image import failure #1750

Merged
merged 6 commits into from
Apr 6, 2023

Conversation

anpanring
Copy link
Contributor

Fixes #1674

I am new to contributing to Pencil2D and would really appreciate any feedback on these fixes, especially the debugging and error messages. Thank you!

@J5lx J5lx added Enhancement UX Related to the way users interact with the program File Import labels Mar 8, 2023
@scribblemaniac
Copy link
Member

Thanks for your submission! We will review it when we get a chance, but I just want to warn you that PRs can move quite slowly in this project. We have very few developers and none of us are all that active right now so it can take some time before someone gets around to reviewing them.

Just skimming the changes you've made, it looks just like what I had in mind for this enhancement. I don't anticipate there being any major issues with this.

@scribblemaniac scribblemaniac self-requested a review March 27, 2023 00:50
@scribblemaniac scribblemaniac added the 🔹 Minor PR (only one reviewer required) label Mar 27, 2023
Copy link
Member

@scribblemaniac scribblemaniac 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. I've added a couple of further changes you can check out if you would like. Feel free to ask questions about anything I've done.

One of the main changes was adding the use of the tr function (https://doc.qt.io/qt-5/qobject.html#tr). We use this function throughout our code to add support for translating strings into other languages. When it comes to error dialogs specifically, we want to translate the title and description as those are meant to be read by the user. We don't translate the debug details as those are meant to be read by the developers and easily searched up in the English code.

The other noteworthy change was adding error dialogs to the image sequence, image predefined set, and animated GIF imports. This wasn't specified in the #1674, but they also should be using the same approach for returning and showing errors. And since they all use the importImage function which now returns a Status object, this was fairly simple to do.

@anpanring
Copy link
Contributor Author

Looks good, and thank you for your help with additional changes! I'll keep the tr function and other import methods in mind for the future.

app/src/mainwindow2.cpp Outdated Show resolved Hide resolved
Copy link
Member

@MrStevns MrStevns left a comment

Choose a reason for hiding this comment

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

Coding and style wise the changes looks good to me, the messages themselves however could be a bit more aligned.

In general I'd like to see the punctuation removed from the title. We don't use it anywhere else AFAIK and it's generally not common to do so.
The title should be short and concise, "couldn't" is just extra fluff that doesn't add anything, state the problem, simply put 😉
I've written a suggestion to one of them, the same title could be used for some of the other errors too.

Thanks for your contribution 😃
Let me know when you've addressed the mentioned changes, then i'll review again.

Copy link
Member

@MrStevns MrStevns left a comment

Choose a reason for hiding this comment

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

Changes looks good to me!
Thanks for your contribution 😄

I will merge the PR now.

@MrStevns MrStevns merged commit 91c50ff into pencil2d:master Apr 6, 2023
@MrStevns MrStevns added this to the v0.6.7 milestone Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement File Import 🔹 Minor PR (only one reviewer required) UX Related to the way users interact with the program
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Better error reporting for image import failure
5 participants