mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-19 02:48:49 +00:00
Disable actionJupyter if not needed, Display Jupyter URL if QtWebEngine is disabled
This commit is contained in:
parent
ccedd3d59f
commit
011d113a5e
@ -222,6 +222,9 @@ void MainWindow::initUI()
|
|||||||
ADD_DOCK(FlagsWidget, flagsDock, ui->actionFlags);
|
ADD_DOCK(FlagsWidget, flagsDock, ui->actionFlags);
|
||||||
#ifdef CUTTER_ENABLE_JUPYTER
|
#ifdef CUTTER_ENABLE_JUPYTER
|
||||||
ADD_DOCK(JupyterWidget, jupyterDock, ui->actionJupyter);
|
ADD_DOCK(JupyterWidget, jupyterDock, ui->actionJupyter);
|
||||||
|
#else
|
||||||
|
ui->actionJupyter->setEnabled(false);
|
||||||
|
ui->actionJupyter->setVisible(false);
|
||||||
#endif
|
#endif
|
||||||
ADD_DOCK(Dashboard, dashboardDock, ui->actionDashboard);
|
ADD_DOCK(Dashboard, dashboardDock, ui->actionDashboard);
|
||||||
ADD_DOCK(SdbDock, sdbDock, ui->actionSDBBrowser);
|
ADD_DOCK(SdbDock, sdbDock, ui->actionSDBBrowser);
|
||||||
|
@ -42,7 +42,17 @@ void JupyterWidget::urlReceived(const QString &url)
|
|||||||
#ifdef CUTTER_ENABLE_QTWEBENGINE
|
#ifdef CUTTER_ENABLE_QTWEBENGINE
|
||||||
createNewTab()->load(QUrl(url));
|
createNewTab()->load(QUrl(url));
|
||||||
#else
|
#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.<br />Open the following URL in your Browser to use Jupyter:<br /><a href=\"%1\">%1</a>").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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user