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

Revert to system font if specified font not found on system #21

Merged
merged 1 commit into from
Mar 16, 2016

Conversation

droark
Copy link

@droark droark commented Mar 12, 2016

In certain instances, if certain calls are given a font not found on the system, Armory attempts to revert to the system font. The call for the system font is incorrect. Patch fixes this problem.

@achow101
Copy link

This also fixes the problem I was having with the address book.

@droark
Copy link
Author

droark commented Mar 12, 2016

Actually, it looks like there's a deeper problem. self.font is never getting set. It goes back to this commit from 2012. The code seems to assume that self.font is set somewhere. This isn't the case, and it looks like QDialog doesn't seem to have it. Same for ArmoryDialog. So, an error is always going to be raised. Maybe self.font was set at one point but got nuked in a bad merge or something?

@goatpig
Copy link
Owner

goatpig commented Mar 13, 2016

Actually self.font() is a method defined in QWidget, which QDialog inherits. I would say it's bad form to just reassign the name to a member variable instead.

The reason none of this crashes too hard is because self.font was indeed defined (even though it was never defined explicitly in ArmoryDialog), all due to Python's weak type semantics.

The solution is stop using self.font, use a different name and replace it whole sale across the code base.

@droark
Copy link
Author

droark commented Mar 15, 2016

The solution is stop using self.font, use a different name and replace it whole sale across the code base.

I seem to be missing something, as there's only the one instance of self.font that I can see.

In certain instances, if certain calls are given a font not found on the system, Armory attempts to revert to the system font. The call for the system font is incorrect. Patch fixes this problem.
@droark
Copy link
Author

droark commented Mar 16, 2016

Pushed a one-line change and squashed it.

@goatpig
Copy link
Owner

goatpig commented Mar 16, 2016

I seem to be missing something, as there's only the one instance of self.font that I can see.

That would explain why the issue was limited. The symptoms would have been much more visible if the mistake was wide spread.

@goatpig goatpig merged commit b210c58 into goatpig:testing Mar 16, 2016
goatpig pushed a commit that referenced this pull request Nov 10, 2017
a0d69e9 C++ reference implementation for Bech32 and SegWit addresses (Pieter Wuille)

Pull request description:

Tree-SHA512: a8b31e1eb13cae10d01bb580c8200a0adcc3d3edf83f9646c76e23421bf62d5f18c7bf8e3f9cda4cfa56a0b15df1654a08dfc51c7bbae043bb60c1477233bdc8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants