-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
PR: Add a way to handle font errors in QtAwesome #3886
Conversation
except FontError as fontError: | ||
import traceback | ||
traceback.print_exc(file=STDERR) | ||
traceback.print_exc(file=open('spyder_crash.log', 'w')) |
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 these three lines.
" eventually creating a new issue <a href=\"%s\">here</a>. " | ||
"Your feedback will always be greatly appreciated." | ||
"" % (fontError ,__project_fonts__, __project_url__, | ||
__forum_url__, __project_url__)) |
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.
Please rephrase this text like this
Spyder can't load the <i>Spyder 3</i> icon theme. That's why it's going to
fallback to the theme used in Spyder 2.
For that, please close this window and start Spyder again.
and make it translatable.
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.
And after this dialog, we need to add this line
CONF.set('main', 'icon_theme', 'spyder 2')
(but please test that my approach works correctly by removing the QtAwesome fonts in your computer and starting Spyder again).
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.
Better message
Spyder was unable to load the <i>Spyder 3</i> icon theme. That's why it's going to
fallback to the theme used in Spyder 2.
For that, please close this window and start Spyder again.
@dalthviz, I added a commit to your branch to fix some Travis errors. Please don't forget to pick it up locally. Still this is a bit tricky to merge because it depends on a new version of QtAwesome. I'm going to release QtAwesome 0.4 with your |
@ccordoba12 regarding
I suggest we use a |
Three reasons i think this is not a good idea:
I know this process is still cumbersome, but that's why CI services are for: to test if we did things right :-) |
Regarding the comments 1.) That is the exception and not the rule (in reality is just PyQt ad Python) |
If I had nickel for every time... |
…s in package requirements to version 0.4 of qtawesome.
@dalthviz, please add the QtAwesome version we need now in @goanpeca, sometimes you're right and sometimes not. But you're prone to give me the task of finishing what you start, and I really (really) don't have time for that now. So I think we're going to continue with our awkward (but proven ;-) procedure. As I said before, it's not something we do everyday so I'm fine with it. |
@dalthviz, please change QtAwesome version to 0.4.1. I had to do some changes in 0.4 to better detect this error. |
@@ -145,6 +145,7 @@ | |||
PY3, qbytearray_to_str, configparser as cp) | |||
from spyder.utils import encoding, programs | |||
from spyder.utils import icon_manager as ima | |||
from qtawesome.iconic_font import FontError |
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.
Please move this import after the qtpy ones, i.e. after line 92
Ok, this is ready now. Thanks a lot @dalthviz for your work on this one. It's very important for 3.1 :-) |
Fixes #3843
Is important to know that for this to actually work this PR has to get a merge in the qtawesome project because of the
FontError
import.