-
Notifications
You must be signed in to change notification settings - Fork 277
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
New error message when opening unsupported formats #143
New error message when opening unsupported formats #143
Conversation
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.
Looks good, thanks for working on this!
Just had a couple minor notes in the comments.
string markup = "<span weight=\"bold\" size=\"larger\">{0}</span>\n\n{1}"; | ||
|
||
string secondaryText = string.Format(Catalog.GetString("Could not open file: {0}"), filename); | ||
secondaryText += $"{Environment.NewLine}{Environment.NewLine}Pinta supports the following file formats:{Environment.NewLine}"; |
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.
The "Pinta supports ..." string also needs to be translatable like the line above (i.e. using Catalog.GetString()
).
https://github.com/PintaProject/Pinta/wiki/Translations has more details on how translations work
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.
Ok, I'll change it.
string secondaryText = string.Format(Catalog.GetString("Could not open file: {0}"), filename); | ||
secondaryText += $"{Environment.NewLine}{Environment.NewLine}Pinta supports the following file formats:{Environment.NewLine}"; | ||
var extensions = from format in PintaCore.System.ImageFormats.Formats | ||
from extension in format.Extensions |
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.
Maybe this should also check whether an exporter exists for the format? I'm not sure if there are any write-only formats, though.
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 checked available formats for existing of exporter and found that around the half of the formats are available only for import. So I see two possible solutions:
- Show formats only available in both ways (Import/Export).
- Show import and export formats separately. More sophisticated way for a user, I'm not sure is it worth it.
I like simple way more, though.
For now, I changed LINQ with additional where statement:
where format.Exporter != null
But can change it without any problem.
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.
Thanks! Should it be the other way around, though? (checking format.Importer != null
) since this error is show when a file fails to import.
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.
Done.
Pinta.Core/Pinta.Core.csproj
Outdated
@@ -54,8 +54,8 @@ | |||
<Reference Include="System.Core" /> | |||
<Reference Include="System.Data" /> | |||
<Reference Include="System.Xml" /> | |||
<Reference Include="WindowsBase" /> |
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.
Is this being used for anything?
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.
My bad. It's useless.
Looks good, thank you! |
Report bug window is not useful for the users when they open files with unsupported formats, so I wrote another type of dialog window. Changes made based on info from tickets #1856821 and duplicate #1432606.