Commit c5d57f78 authored by Alexander Semke's avatar Alexander Semke
Browse files

Minor fixes:

1. when modifying the documention properties, hide the text field for the file name if the documentation was download from the internet
2. show icon for the documentation if it was provided as part of the arhive
3. don't show the "Show Help" action in the context menu of a command entry if the command is empty yet
4. minor UX improvements in the settings widgets for R and Julia
parent be1c8e8f
Pipeline #67674 canceled with stage
......@@ -47,11 +47,17 @@
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="kcfg_integratePlots">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>If enabled, plots will be shown inside of the worksheet. Otherwise, plots will be shown in an external window.</string>
</property>
<property name="text">
<string>Integrate Plots in Worksheet</string>
<string>Enabled</string>
</property>
</widget>
</item>
......@@ -68,7 +74,7 @@
<string>Monitor the creation and destruction of variables and show the existing variables in the variable panel.</string>
</property>
<property name="text">
<string>Enable Variable Management</string>
<string>Enabled</string>
</property>
</widget>
</item>
......
......@@ -24,7 +24,7 @@
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Path to Julia:</string>
<string>Executable:</string>
</property>
</widget>
</item>
......
......@@ -92,7 +92,7 @@ QtHelpConfig::QtHelpConfig(const QString& backend) : QWidget(), m_backend(backen
m_treeWidget->model()->setHeaderData(ConfigColumn, Qt::Horizontal, QVariant());
m_treeWidget->header()->setSectionsMovable(false);
m_treeWidget->header()->setStretchLastSection(false);
m_treeWidget->header()->setSectionResizeMode(NameColumn, QHeaderView::Stretch);
m_treeWidget->header()->setSectionResizeMode(NameColumn, QHeaderView::ResizeToContents);
m_treeWidget->header()->setSectionResizeMode(PathColumn, QHeaderView::Stretch);
m_treeWidget->header()->setSectionResizeMode(ConfigColumn, QHeaderView::Fixed);
......@@ -136,8 +136,11 @@ void QtHelpConfig::modify(QTreeWidgetItem* item)
if (item->text(GhnsColumn) != QLatin1String("0"))
{
dialog->qchRequester->setText(i18n("Documentation provided by GHNS"));
dialog->qchRequester->setEnabled(false);
dialog->qchRequester->hide();
dialog->lPath->hide();
//resize the dialog to fit the content after the widgets were hidden
dialog->layout()->activate();
dialog->resize( QSize(dialog->width(), 0).expandedTo(dialog->minimumSize()) );
}
else
{
......@@ -207,6 +210,7 @@ void QtHelpConfig::knsUpdate(const KNS3::Entry::List& list)
//determine the path for the qch file
QString qchPath;
QString iconPath = QStringLiteral("documentation");
QString path = e.installedFiles().at(0);
path.chop(1);
QDir dir(path);
......@@ -214,16 +218,16 @@ void QtHelpConfig::knsUpdate(const KNS3::Entry::List& list)
for (const auto& fileInfo : fileInfos)
{
if (fileInfo.suffix() == QLatin1String("qch"))
{
qchPath = fileInfo.filePath();
break;
}
if (fileInfo.suffix() == QLatin1String("svg"))
iconPath = fileInfo.filePath();
}
//add the qch file if valid
if(checkNamespace(qchPath, nullptr))
{
auto* item = addTableItem(QStringLiteral("documentation"), e.name(), qchPath, QStringLiteral("1"));
auto* item = addTableItem(iconPath, e.name(), qchPath, QStringLiteral("1"));
m_treeWidget->setCurrentItem(item);
}
}
......
......@@ -7,12 +7,12 @@
<x>0</x>
<y>0</y>
<width>400</width>
<height>125</height>
<height>174</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<widget class="QLabel" name="lIcon">
<property name="text">
<string comment="@label:chooser">Icon:</string>
</property>
......@@ -32,7 +32,7 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<widget class="QLabel" name="lName">
<property name="text">
<string comment="@label:textbox">Name:</string>
</property>
......@@ -49,7 +49,7 @@
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="lPath">
<property name="text">
<string comment="@label:textbox">Path:</string>
</property>
......@@ -90,12 +90,12 @@
<customwidget>
<class>KIconButton</class>
<extends>QPushButton</extends>
<header>KIconButton</header>
<header>kiconbutton.h</header>
</customwidget>
<customwidget>
<class>KUrlRequester</class>
<extends>QWidget</extends>
<header>KUrlRequester</header>
<header>kurlrequester.h</header>
</customwidget>
</customwidgets>
<resources/>
......
......@@ -144,7 +144,7 @@ void CantorShell::setupActions()
KStandardAction::preferences(this, SLOT(showSettings()), actionCollection());
QAction* downloadExamples = new QAction(i18n("Download Example Worksheets"), actionCollection());
QAction* downloadExamples = new QAction(i18n("Download Examples"), actionCollection());
downloadExamples->setIcon(QIcon::fromTheme(QLatin1String("get-hot-new-stuff")));
actionCollection()->addAction(QLatin1String("file_example_download"), downloadExamples);
connect(downloadExamples, &QAction::triggered, this, &CantorShell::downloadExamples);
......@@ -706,6 +706,7 @@ void CantorShell::initPanels()
QDockWidget* docker = new QDockWidget(plugin->name(), this);
docker->setObjectName(plugin->name());
docker->setWidget(plugin->widget());
docker->setWindowIcon(QIcon::fromTheme(QStringLiteral("format-text-bold")));
addDockWidget(Qt::RightDockWidgetArea, docker);
docker->hide();
......@@ -826,9 +827,6 @@ void CantorShell::updateNewSubmenu()
Cantor::WorksheetAccessInterface* CantorShell::currentWorksheetAccessInterface()
{
auto* wa = m_part->findChild<Cantor::WorksheetAccessInterface*>(Cantor::WorksheetAccessInterface::Name);
if (!wa)
qDebug()<<"failed to access worksheet access interface for current part";
return wa;
}
......
/*
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2009 Alexander Rieder <alexanderrieder@gmail.com>
SPDX-FileCopyrightText: 2017-2019 Alexander Semke <alexander.semke@web.de>
SPDX-FileCopyrightText: 2017-2021 Alexander Semke <alexander.semke@web.de>
SPDX-FileCopyrightText: 2019 Sirgienko Nikita <warquark@gmail.com>
*/
......@@ -14,8 +14,6 @@
#include "lib/assistant.h"
#include "lib/backend.h"
#include "lib/extension.h"
#include "lib/panelpluginhandler.h"
#include "lib/panelplugin.h"
#include "lib/worksheetaccess.h"
#include "scripteditor/scripteditorwidget.h"
#include "searchbar.h"
......
......@@ -337,10 +337,13 @@ void CommandEntry::populateMenu(QMenu* menu, QPointF pos)
}
QAction* action = new QAction(QIcon::fromTheme(QLatin1String("help-hint")), i18n("Show Help"));
connect(action, &QAction::triggered, this, &CommandEntry::showHelp);
menu->addAction(action);
menu->addSeparator();
if (!m_commandItem->toPlainText().simplified().isEmpty())
{
QAction* action = new QAction(QIcon::fromTheme(QLatin1String("help-hint")), i18n("Show Help"));
connect(action, &QAction::triggered, this, &CommandEntry::showHelp);
menu->addAction(action);
menu->addSeparator();
}
QAction* enabledAction = new QAction(QIcon::fromTheme(QLatin1String("checkmark")), i18n("Enabled"));
enabledAction->setCheckable(true);
......
......@@ -138,7 +138,6 @@ bool TextEntry::focusEntry(int pos, qreal xCoord)
return true;
}
void TextEntry::setContent(const QString& content)
{
m_textItem->setPlainText(content);
......@@ -254,7 +253,6 @@ QJsonValue TextEntry::toJupyterJson()
// Replace our $$ formulas to $
entryData.replace(QLatin1String("$$"), QLatin1String("$"));
}
else
{
......@@ -500,7 +498,6 @@ bool TextEntry::isConvertableToTextEntry(const QJsonObject& cell)
return textContent == source;
}
void TextEntry::handleMathRender(QSharedPointer<MathRenderResult> result)
{
if (!result->successful)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment