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

Minor changes:

* the creation of the documentation panel widget was delayed, do the signal-slot connection when it's really available
* added "Show help" entry to the global and command entry independent context menu in the worksheet
* initialization of private members in RVariableModel directly in the header
parent c0d5c0a6
Pipeline #148519 passed with stage
in 7 minutes and 36 seconds
......@@ -11,9 +11,7 @@
using namespace Cantor;
RVariableModel::RVariableModel(RSession* session):
DefaultVariableModel(session),
m_expression(nullptr)
RVariableModel::RVariableModel(RSession* session) : DefaultVariableModel(session)
{
}
......
......@@ -14,7 +14,7 @@ class RVariableModel : public Cantor::DefaultVariableModel
{
Q_OBJECT
public:
RVariableModel( RSession* session);
RVariableModel(RSession*);
~RVariableModel() override;
// List of virables from other R namespaces (packages), which can be treted as constants, like "pi"
......@@ -27,14 +27,14 @@ class RVariableModel : public Cantor::DefaultVariableModel
void constantsRemoved(QStringList);
public Q_SLOTS:
void parseResult(Cantor::Expression::Status status);
void parseResult(Cantor::Expression::Status);
private:
void setConstants(QStringList constants);
void setConstants(QStringList);
private:
QStringList m_constants;
Cantor::Expression* m_expression;
Cantor::Expression* m_expression{nullptr};
};
#endif /* _RVARIABLEMODEL_H */
/*
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2020 Shubham <aryan100jangid@gmail.com>
SPDX-FileCopyrightText: 2020-2021 Alexander Semke <alexander.semke@web.de>
SPDX-FileCopyrightText: 2020-2022 Alexander Semke <alexander.semke@web.de>
*/
#include "documentationpanelplugin.h"
......@@ -20,7 +20,10 @@ DocumentationPanelPlugin::~DocumentationPanelPlugin()
QWidget* DocumentationPanelPlugin::widget()
{
if(!m_widget)
{
m_widget = new DocumentationPanelWidget(parentWidget());
connect(m_cantorShell, SIGNAL(requestDocumentation(QString)), m_widget, SLOT(contextSensitiveHelp(QString)));
}
return m_widget;
}
......@@ -34,7 +37,6 @@ void DocumentationPanelPlugin::connectToShell(QObject* cantorShell)
{
m_cantorShell = cantorShell;
connect(cantorShell, SIGNAL(requestDocumentation(QString)), this, SIGNAL(visibilityRequested()));
connect(cantorShell, SIGNAL(requestDocumentation(QString)), m_widget, SLOT(contextSensitiveHelp(QString)));
}
Cantor::PanelPlugin::State DocumentationPanelPlugin::saveState()
......
......@@ -1907,8 +1907,14 @@ void Worksheet::populateMenu(QMenu *menu, QPointF pos)
insertMenu->addAction(QIcon::fromTheme(QLatin1String("view-list-tree")), i18n("Hierarchy Entry"), this, &Worksheet::appendHierarchyEntry);
menu->addMenu(insertMenu);
//"Show help" for backend's documentation
menu->addSeparator();
menu->addAction(QIcon::fromTheme(QLatin1String("help-hint")), i18n("Show Help"), this,
[=] () { requestDocumentation(QString()); });
}
//evaluate the whole worksheet or interrupt the current calculation
menu->addSeparator();
if (!isRunning())
menu->addAction(QIcon::fromTheme(QLatin1String("system-run")), i18n("Evaluate Worksheet"),
......
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