diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index ae6d2366..a343f9b8 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -222,6 +222,9 @@ void MainWindow::initUI() ADD_DOCK(FlagsWidget, flagsDock, ui->actionFlags); #ifdef CUTTER_ENABLE_JUPYTER ADD_DOCK(JupyterWidget, jupyterDock, ui->actionJupyter); +#else + ui->actionJupyter->setEnabled(false); + ui->actionJupyter->setVisible(false); #endif ADD_DOCK(Dashboard, dashboardDock, ui->actionDashboard); ADD_DOCK(SdbDock, sdbDock, ui->actionSDBBrowser); diff --git a/src/widgets/JupyterWidget.cpp b/src/widgets/JupyterWidget.cpp index d05558fb..7565af32 100644 --- a/src/widgets/JupyterWidget.cpp +++ b/src/widgets/JupyterWidget.cpp @@ -42,7 +42,17 @@ void JupyterWidget::urlReceived(const QString &url) #ifdef CUTTER_ENABLE_QTWEBENGINE createNewTab()->load(QUrl(url)); #else - // TODO: make a tab with the url, so the user can use another browser + QWidget *failPage = new QWidget(this); + QLabel *label = new QLabel(failPage); + label->setText(tr("Cutter has been built without QtWebEngine.
Open the following URL in your Browser to use Jupyter:
%1").arg(url)); + label->setTextFormat(Qt::RichText); + label->setTextInteractionFlags(Qt::TextBrowserInteraction); + label->setOpenExternalLinks(true); + QHBoxLayout *layout = new QHBoxLayout(); + layout->addWidget(label); + layout->setAlignment(label, Qt::AlignCenter); + failPage->setLayout(layout); + ui->tabWidget->addTab(failPage, tr("Jupyter")); #endif }