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 check_compatibility for PyQt4 and WebEngine #78

Merged
merged 4 commits into from
Jun 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions spyder_notebook/notebookplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
import sys

# Qt imports
from qtpy import PYQT4
from qtpy.compat import getsavefilename, getopenfilenames
from qtpy.QtCore import Qt, QEventLoop, QTimer, Signal
from qtpy.QtGui import QIcon
from qtpy.QtWebEngineWidgets import WEBENGINE
from qtpy.QtWidgets import QApplication, QMessageBox, QVBoxLayout, QMenu
from qtpy.QtCore import Qt, QEventLoop, QTimer, Signal
from qtpy.compat import getsavefilename, getopenfilenames

# Third-party imports
import nbformat
Expand Down Expand Up @@ -174,6 +176,18 @@ def register_plugin(self):
QIcon(icon_path))
self.recent_notebook_menu.aboutToShow.connect(self.setup_menu_actions)

def check_compatibility(self):
"""Check compatibility for PyQt and sWebEngine."""
message = ''
value = True
if PYQT4 or WEBENGINE:
message = _("You are working with Qt4 or the PyQt5 wheels."
"<br><br>In order to make the Notebook plugin "
"work you need to update to Qt5 and/or use "
"Anaconda or Miniconda.")
value = False
return value, message

# ------ Public API (for clients) -----------------------------------------
def setup_menu_actions(self):
"""Setup and update the menu actions."""
Expand Down