diff --git a/src/backends/R/rbackend.cpp b/src/backends/R/rbackend.cpp index c326b32e..ab619b9b 100644 --- a/src/backends/R/rbackend.cpp +++ b/src/backends/R/rbackend.cpp @@ -1,107 +1,111 @@ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --- Copyright (C) 2009 Alexander Rieder */ #include "rbackend.h" #include "rsession.h" #include "rextensions.h" #include "settings.h" #include "rsettingswidget.h" #include #include "cantor_macros.h" #include RBackend::RBackend(QObject* parent,const QList& args) : Cantor::Backend(parent, args) { setObjectName(QLatin1String("rbackend")); qDebug()<<"Creating RBackend"; new RScriptExtension(this); new RPlotExtension(this); new RVariableManagementExtension(this); } RBackend::~RBackend() { qDebug()<<"Destroying RBackend"; } QString RBackend::id() const { return QLatin1String("r"); } QString RBackend::version() const { return QLatin1String("Undefined"); } Cantor::Session* RBackend::createSession() { qDebug()<<"Spawning a new R session"; return new RSession(this); } Cantor::Backend::Capabilities RBackend::capabilities() const { qDebug()<<"Requesting capabilities of RSession"; return Cantor::Backend::InteractiveMode | Cantor::Backend::SyntaxHighlighting | Cantor::Backend::Completion | Cantor::Backend::VariableManagement; } bool RBackend::requirementsFullfilled() const { QFileInfo info(QStandardPaths::findExecutable( QLatin1String("cantor_rserver") ) ); return info.isExecutable(); } QWidget* RBackend::settingsWidget(QWidget* parent) const { return new RSettingsWidget(parent); } KConfigSkeleton* RBackend::config() const { return RServerSettings::self(); } QUrl RBackend::helpUrl() const { + const QUrl& localDoc = RServerSettings::self()->localDoc(); + if (!localDoc.isEmpty()) + return localDoc; + else return QUrl(i18nc("the url to the documentation of R, please check if there is a translated version and use the correct url", "http://rwiki.sciviews.org/doku.php?id=rdoc:rdoc")); } QString RBackend::description() const { return i18n("R is a language and environment for statistical computing and graphics, similar to the S language and environment.
"\ "It provides a wide variety of statistical (linear and nonlinear modelling, "\ "classical statistical tests, time-series analysis, classification, clustering, ...) "\ "and graphical techniques, and is highly extensible. The S language is often the "\ "vehicle of choice for research in statistical methodology, "\ "and R provides an Open Source route to participation in that activity."); } K_PLUGIN_FACTORY_WITH_JSON(rbackend, "rbackend.json", registerPlugin();) #include "rbackend.moc" diff --git a/src/backends/R/rserver/rserver.kcfg b/src/backends/R/rserver/rserver.kcfg index f33ec138..b391eff6 100644 --- a/src/backends/R/rserver/rserver.kcfg +++ b/src/backends/R/rserver/rserver.kcfg @@ -1,16 +1,19 @@ + + + true diff --git a/src/backends/R/settings.ui b/src/backends/R/settings.ui index fe9f7e20..769643c1 100644 --- a/src/backends/R/settings.ui +++ b/src/backends/R/settings.ui @@ -1,37 +1,51 @@ RSettingsBase 0 0 414 231 + + + + + + Path to local documentation: + + + + + + + + Integrate Plots in Worksheet Scripts to autorun diff --git a/src/backends/maxima/maximabackend.cpp b/src/backends/maxima/maximabackend.cpp index f7b3712b..9657d625 100644 --- a/src/backends/maxima/maximabackend.cpp +++ b/src/backends/maxima/maximabackend.cpp @@ -1,121 +1,125 @@ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --- Copyright (C) 2009 Alexander Rieder */ #include "maximabackend.h" #include "maximasession.h" #include "settings.h" #include "ui_settings.h" #include "maximaextensions.h" #include #include #include "cantor_macros.h" MaximaBackend::MaximaBackend( QObject* parent,const QList args ) : Cantor::Backend( parent,args ) { setObjectName(QLatin1String("maximabackend")); qDebug()<<"Creating MaximaBackend"; //initialize the supported extensions new MaximaHistoryExtension(this); new MaximaScriptExtension(this); new MaximaCASExtension(this); new MaximaCalculusExtension(this); new MaximaLinearAlgebraExtension(this); new MaximaPlotExtension(this); new MaximaVariableManagementExtension(this); } MaximaBackend::~MaximaBackend() { qDebug()<<"Destroying MaximaBackend"; } QString MaximaBackend::id() const { return QLatin1String("maxima"); } QString MaximaBackend::version() const { return QLatin1String("5.41 and 5.42"); } Cantor::Session* MaximaBackend::createSession() { qDebug()<<"Spawning a new Maxima session"; return new MaximaSession(this); } Cantor::Backend::Capabilities MaximaBackend::capabilities() const { qDebug()<<"Requesting capabilities of MaximaSession"; Cantor::Backend::Capabilities cap= Cantor::Backend::LaTexOutput | Cantor::Backend::InteractiveMode| Cantor::Backend::SyntaxHighlighting| Cantor::Backend::Completion | Cantor::Backend::SyntaxHelp; if(MaximaSettings::self()->variableManagement()) cap|=Cantor::Backend::VariableManagement; return cap; } bool MaximaBackend::requirementsFullfilled() const { QFileInfo info(MaximaSettings::self()->path().toLocalFile()); return info.isExecutable(); } QUrl MaximaBackend::helpUrl() const { - return QUrl(i18nc("the url to the documentation of Maxima, please check if there is a translated version and use the correct url", - "http://maxima.sourceforge.net/docs/manual/en/maxima.html")); + const QUrl& localDoc = MaximaSettings::self()->localDoc(); + if (!localDoc.isEmpty()) + return localDoc; + else + return QUrl(i18nc("the url to the documentation of Maxima, please check if there is a translated version and use the correct url", + "http://maxima.sourceforge.net/docs/manual/en/maxima.html")); } QWidget* MaximaBackend::settingsWidget(QWidget* parent) const { QWidget* widget=new QWidget(parent); Ui::MaximaSettingsBase s; s.setupUi(widget); return widget; } KConfigSkeleton* MaximaBackend::config() const { return MaximaSettings::self(); } QString MaximaBackend::description() const { return i18n("Maxima is a system for the manipulation of symbolic and numerical expressions, "\ "including differentiation, integration, Taylor series, Laplace transforms, "\ "ordinary differential equations, systems of linear equations, polynomials, and sets, "\ "lists, vectors, matrices, and tensors. Maxima yields high precision numeric results "\ "by using exact fractions, arbitrary precision integers, and variable precision "\ "floating point numbers. Maxima can plot functions and data in two and three dimensions. "); } K_PLUGIN_FACTORY_WITH_JSON(maximabackend, "maximabackend.json", registerPlugin();) #include "maximabackend.moc" diff --git a/src/backends/maxima/maximabackend.kcfg b/src/backends/maxima/maximabackend.kcfg index ef03582c..6c77fb51 100644 --- a/src/backends/maxima/maximabackend.kcfg +++ b/src/backends/maxima/maximabackend.kcfg @@ -1,25 +1,28 @@ QStandardPaths QUrl::fromLocalFile(QStandardPaths::findExecutable( QLatin1String("maxima") )) + + + true true diff --git a/src/backends/maxima/settings.ui b/src/backends/maxima/settings.ui index 476acd28..d238b8a8 100644 --- a/src/backends/maxima/settings.ui +++ b/src/backends/maxima/settings.ui @@ -1,81 +1,95 @@ MaximaSettingsBase 0 0 414 231 Path to Maxima: + + + + + + Path to local documentation: + + + + + + + + Integrate Plots in Worksheet Let Cantor follow the creation/destruction of variables Enable Variable Management Scripts to autorun Qt::Vertical 20 40 KUrlRequester QFrame
kurlrequester.h
diff --git a/src/backends/octave/octavebackend.cpp b/src/backends/octave/octavebackend.cpp index 6b387c00..8554ec5c 100644 --- a/src/backends/octave/octavebackend.cpp +++ b/src/backends/octave/octavebackend.cpp @@ -1,94 +1,98 @@ /* Copyright (C) 2010 Miha Čančula This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "octavebackend.h" #include "octavesession.h" #include "octaveextensions.h" #include "settings.h" #include "cantor_macros.h" #include #include #include "ui_settings.h" OctaveBackend::OctaveBackend(QObject* parent, const QList& args): Backend(parent, args) { new OctaveHistoryExtension(this); new OctaveScriptExtension(this); new OctavePlotExtension(this); new OctaveLinearAlgebraExtension(this); new OctaveVariableManagementExtension(this); new OctavePackagingExtension(this); } QString OctaveBackend::id() const { return QLatin1String("octave"); } QString OctaveBackend::version() const { return QLatin1String("4.0 and 4.2"); } Cantor::Backend::Capabilities OctaveBackend::capabilities() const { return SyntaxHighlighting | Completion | SyntaxHelp | VariableManagement; } Cantor::Session* OctaveBackend::createSession() { return new OctaveSession(this); } bool OctaveBackend::requirementsFullfilled() const { return QFileInfo(OctaveSettings::path().toLocalFile()).isExecutable(); } QUrl OctaveBackend::helpUrl() const { - return QUrl(i18nc("the url to the documentation of Octave, please check if there is a translated version (currently Czech and Japanese) and use the correct url", - "http://www.gnu.org/software/octave/doc/interpreter/")); + const QUrl& localDoc = OctaveSettings::self()->localDoc(); + if (!localDoc.isEmpty()) + return localDoc; + else + return QUrl(i18nc("the url to the documentation of Octave, please check if there is a translated version (currently Czech and Japanese) and use the correct url", + "http://www.gnu.org/software/octave/doc/interpreter/")); } QString OctaveBackend::description() const { return i18n("GNU Octave is a high-level language, primarily intended for numerical computations.
" "It provides a convenient command line interface for solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with Matlab."); } QWidget* OctaveBackend::settingsWidget(QWidget* parent) const { QWidget* widget = new QWidget(parent); Ui::OctaveSettingsBase ui; ui.setupUi(widget); return widget; } KConfigSkeleton* OctaveBackend::config() const { return OctaveSettings::self(); } K_PLUGIN_FACTORY_WITH_JSON(octavebackend, "octavebackend.json", registerPlugin();) #include "octavebackend.moc" diff --git a/src/backends/octave/octavebackend.kcfg b/src/backends/octave/octavebackend.kcfg index 8edecc80..b8d7014a 100644 --- a/src/backends/octave/octavebackend.kcfg +++ b/src/backends/octave/octavebackend.kcfg @@ -1,21 +1,24 @@ QStandardPaths QUrl::fromLocalFile(QStandardPaths::findExecutable( QLatin1String("octave-cli") )) + + + true diff --git a/src/backends/octave/settings.ui b/src/backends/octave/settings.ui index 6541f196..e4fa0e06 100644 --- a/src/backends/octave/settings.ui +++ b/src/backends/octave/settings.ui @@ -1,71 +1,85 @@ OctaveSettingsBase 0 0 400 300 Path to Octave: + + + + + + Path to local documentation: + + + + + + + + Integrate Plots in Worksheet Scripts to autorun Qt::Vertical 20 40 KUrlRequester QFrame
kurlrequester.h
diff --git a/src/backends/python/settings.ui b/src/backends/python/settings.ui index e239b4d4..7cbd5d2c 100644 --- a/src/backends/python/settings.ui +++ b/src/backends/python/settings.ui @@ -1,57 +1,71 @@ PythonSettingsBase 0 0 400 300 + + + + + + Path to local documentation: + + + + + + + + Integrate Plots in Worksheet Scripts to autorun Qt::Vertical 20 40 KUrlRequester QFrame
kurlrequester.h
diff --git a/src/backends/python2/python2backend.cpp b/src/backends/python2/python2backend.cpp index fa18217a..24d8767b 100644 --- a/src/backends/python2/python2backend.cpp +++ b/src/backends/python2/python2backend.cpp @@ -1,74 +1,78 @@ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --- Copyright (C) 2014, 2015 Minh Ngo */ #include "python2backend.h" #include "python2session.h" #include "cantor_macros.h" #include "settings.h" #include Python2Backend::Python2Backend(QObject* parent, const QList args) : PythonBackend(parent, args) { setObjectName(QLatin1String("python2backend")); // Because the plugin may not have been loaded with // ExportExternalSymbols, we load the python symbols again // to make sure that python modules such as numpy see them // (see bug #330032) QLibrary pythonLib(QLatin1String("python2.7")); pythonLib.setLoadHints(QLibrary::ExportExternalSymbolsHint); pythonLib.load(); } Cantor::Session* Python2Backend::createSession() { return new Python2Session(this); } QString Python2Backend::id() const { return QLatin1String("python2"); } QString Python2Backend::version() const { return QLatin1String("2.7"); } QUrl Python2Backend::helpUrl() const { - return QUrl(i18nc("the url to the documentation Python 2", "http://docs.python.org/2/")); + const QUrl& localDoc = PythonSettings::self()->localDoc(); + if (!localDoc.isEmpty()) + return localDoc; + else + return QUrl(i18nc("the url to the documentation Python 2", "http://docs.python.org/2/")); } QString Python2Backend::description() const { return i18n("

Python is a remarkably powerful dynamic programming language that is used in a wide variety of application domains. " \ "There are several Python packages to scientific programming.

" \ "

This backend supports Python 2.

"); } KConfigSkeleton* Python2Backend::config() const { return PythonSettings::self(); } K_PLUGIN_FACTORY_WITH_JSON(python2backend, "python2backend.json", registerPlugin();) #include "python2backend.moc" diff --git a/src/backends/python2/python2backend.kcfg b/src/backends/python2/python2backend.kcfg index cd9ccb55..d461f16e 100644 --- a/src/backends/python2/python2backend.kcfg +++ b/src/backends/python2/python2backend.kcfg @@ -1,16 +1,19 @@ + + + false diff --git a/src/backends/python3/python3backend.cpp b/src/backends/python3/python3backend.cpp index 7521aa2e..31f11c50 100644 --- a/src/backends/python3/python3backend.cpp +++ b/src/backends/python3/python3backend.cpp @@ -1,67 +1,71 @@ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --- Copyright (C) 2014, 2015 Minh Ngo */ #include "python3backend.h" #include "python3session.h" #include "cantor_macros.h" #include "settings.h" #include Python3Backend::Python3Backend(QObject* parent, const QList& args) : PythonBackend(parent, args) { setObjectName(QLatin1String("python3backend")); } Cantor::Session* Python3Backend::createSession() { return new Python3Session(this); } QString Python3Backend::id() const { return QLatin1String("python3"); } QString Python3Backend::version() const { return QLatin1String("3.6"); } QUrl Python3Backend::helpUrl() const { - return QUrl(i18nc("the url to the documentation Python 3", "http://docs.python.org/3/")); + const QUrl& localDoc = PythonSettings::self()->localDoc(); + if (!localDoc.isEmpty()) + return localDoc; + else + return QUrl(i18nc("the url to the documentation Python 3", "http://docs.python.org/3/")); } QString Python3Backend::description() const { return i18n("

Python is a remarkably powerful dynamic programming language that is used in a wide variety of application domains. " \ "There are several Python packages to scientific programming.

" \ "

This backend supports Python 3.

"); } KConfigSkeleton* Python3Backend::config() const { return PythonSettings::self(); } K_PLUGIN_FACTORY_WITH_JSON(python3backend, "python3backend.json", registerPlugin();) #include "python3backend.moc" diff --git a/src/backends/python3/python3backend.kcfg b/src/backends/python3/python3backend.kcfg index 202879b7..3ceb9800 100644 --- a/src/backends/python3/python3backend.kcfg +++ b/src/backends/python3/python3backend.kcfg @@ -1,16 +1,19 @@ + + + false