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

PR: Add icon to MessageCheckBox while avoiding unclickable issue #4749

Merged
merged 7 commits into from
Jul 26, 2017

Conversation

jnsebgosselin
Copy link
Member

@jnsebgosselin jnsebgosselin commented Jul 14, 2017

Add an icon to the MessageCheckBox while avoiding the unclickable update message issue in PyQt5 and preserving backward compatibility with PyQt4.

Please revised that this fix works correctly in PyQt5. I cannot install PyQt5 alongside PyQt4 without messing my installation on my current setup. Feel free to give me advice to improve the way I can contribute.

- The icon is passed as argument when initiating the MessageCheckBox.
Thus, `setIcon` is called before adding a custom checkbox to the
MessageCheckBox layout, avoiding the unclickable update message box
issue.
- Also, self is passed as parent to the MessageCheckBox. This allows to
have the Spyder icon to show correctly on the left side corner of the
popup window in Window OS.
- Finally, when adding the custom checkbox to the MessageCheckBox
layout, the position where the widget is added depends if PyQt4 or PyQt5
is used in order to take into account changes in Qt framework between
Qt4 and Qt5.
@ccordoba12 ccordoba12 added this to the v3.2.1 milestone Jul 14, 2017
@ccordoba12 ccordoba12 changed the base branch from 3.1.x to 3.x July 14, 2017 22:57
@ccordoba12
Copy link
Member

@dalthviz, please test that @jnsebgosselin contribution works in PyQt5 as expected.

@@ -71,8 +71,12 @@ def __init__(self, *args, **kwargs):
check_layout.addItem(QSpacerItem(size, size))

# Access the Layout of the MessageBox to add the Checkbox
from qtpy import PYQT5
Copy link
Member

Choose a reason for hiding this comment

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

Please move this import to the top of the fie. There's no need to put it here.

ccordoba12 and others added 2 commits July 14, 2017 18:50
- This was only needed for IPython 2, but we don't support that version
anymore.
- This was breaking displaying Dataframes as html tables in
spyder-notebook.
@dalthviz
Copy link
Member

It works for me with Qt 5.6.2 PyQt5 5.6, this a preview of the dialog:

imagen

You can click the OK button and the links too 👍

PR: Don't set pandas.core.common.in_qtconsole anymore
@ccordoba12
Copy link
Member

@jnsebgosselin, please move this PR on your locale fork to the 3.x branch and make a forced push to fix the errors in CircleCI.

- The icon is passed as argument when initiating the MessageCheckBox.
Thus, `setIcon` is called before adding a custom checkbox to the
MessageCheckBox layout, avoiding the unclickable update message box
issue.
- Also, self is passed as parent to the MessageCheckBox. This allows to
have the Spyder icon to show correctly on the left side corner of the
popup window in Window OS.
- Finally, when adding the custom checkbox to the MessageCheckBox
layout, the position where the widget is added depends if PyQt4 or PyQt5
is used in order to take into account changes in Qt framework between
Qt4 and Qt5.
@ccordoba12 ccordoba12 changed the title Add icon to MessageCheckBox while avoiding unclickable issue PR: Add icon to MessageCheckBox while avoiding unclickable issue Jul 26, 2017
@ccordoba12 ccordoba12 merged commit 8716f06 into spyder-ide:3.x Jul 26, 2017
ccordoba12 added a commit that referenced this pull request Jul 26, 2017
@jnsebgosselin jnsebgosselin deleted the 3.1.x-messagecheckbox branch July 26, 2017 14:17
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.

3 participants