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
6 changes: 2 additions & 4 deletions spyder/app/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2753,14 +2753,12 @@ def _check_updates_ready(self):
url_i = 'http://pythonhosted.org/spyder/installation.html'

# Define the custom QMessageBox
box = MessageCheckBox()
box = MessageCheckBox(icon=QMessageBox.Information,
parent=self)
box.setWindowTitle(_("Spyder updates"))
box.set_checkbox_text(_("Check for updates on startup"))
box.setStandardButtons(QMessageBox.Ok)
box.setDefaultButton(QMessageBox.Ok)
# The next line is commented because it freezes the dialog.
# For now there is then no info icon. This solves issue #3609.
# box.setIcon(QMessageBox.Information)

# Adjust the checkbox depending on the stored configuration
section, option = 'main', 'check_updates_on_startup'
Expand Down
6 changes: 5 additions & 1 deletion spyder/widgets/helperwidgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

layout = self.layout()
layout.addLayout(check_layout, 1, 1)
if PYQT5:
layout.addLayout(check_layout, 1, 2)
else:
layout.addLayout(check_layout, 1, 1)

# --- Public API
# Methods to access the checkbox
Expand Down