Changeset View
Changeset View
Standalone View
Standalone View
src/backends/julia/juliabackend.cpp
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | This program is free software; you can redistribute it and/or | ||||
3 | modify it under the terms of the GNU General Public License | ||||
4 | as published by the Free Software Foundation; either version 2 | ||||
5 | of the License, or (at your option) any later version. | ||||
6 | | ||||
7 | This program is distributed in the hope that it will be useful, | ||||
8 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
10 | GNU General Public License for more details. | ||||
11 | | ||||
12 | You should have received a copy of the GNU General Public License | ||||
13 | along with this program; if not, write to the Free Software | ||||
14 | Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||||
15 | Boston, MA 02110-1301, USA. | ||||
16 | | ||||
17 | --- | ||||
18 | Copyright (C) 2016 Ivan Lakhtanov <ivan.lakhtanov@gmail.com> | ||||
19 | */ | ||||
20 | #include "juliabackend.h" | ||||
21 | | ||||
22 | #include <klocalizedstring.h> | ||||
23 | | ||||
24 | #include "juliasession.h" | ||||
25 | #include "ui_settings.h" | ||||
26 | #include "settings.h" | ||||
27 | | ||||
28 | JuliaBackend::JuliaBackend(QObject *parent, const QList<QVariant> &args) | ||||
filipesaraiva: Try to remove it, but if you need use just 'julia'. | |||||
29 | : Cantor::Backend(parent, args) | ||||
30 | { | ||||
31 | setEnabled(true); | ||||
32 | } | ||||
33 | | ||||
34 | QString JuliaBackend::id() const | ||||
35 | { | ||||
36 | return QLatin1String("julia"); | ||||
37 | } | ||||
38 | | ||||
39 | Cantor::Session *JuliaBackend::createSession() | ||||
40 | { | ||||
41 | return new JuliaSession(this); | ||||
42 | } | ||||
43 | | ||||
44 | Cantor::Backend::Capabilities JuliaBackend::capabilities() const | ||||
45 | { | ||||
46 | return Cantor::Backend::Nothing; | ||||
Implements the description function here, like in Octave Backend. filipesaraiva: Implements the `description` function here, like in [[https://phabricator.kde. | |||||
47 | } | ||||
48 | | ||||
49 | QString JuliaBackend::description() const | ||||
50 | { | ||||
51 | return i18n( | ||||
52 | "<p><b>Julia</b> is a high-level, high-performance dynamic programming " | ||||
53 | "language for technical computing, with syntax that is familiar to " | ||||
54 | "users of other technical computing environments. It provides a " | ||||
55 | "sophisticated compiler, distributed parallel execution, numerical " | ||||
56 | "accuracy, and an extensive mathematical function library.</p>" | ||||
57 | ); | ||||
58 | } | ||||
59 | | ||||
60 | QUrl JuliaBackend::helpUrl() const | ||||
61 | { | ||||
62 | return QUrl(i18nc( | ||||
63 | "The url to the documentation of Julia, please check if there is a" | ||||
64 | " translated version and use the correct url", | ||||
65 | "http://docs.julialang.org/en/latest/" | ||||
66 | )); | ||||
67 | } | ||||
68 | | ||||
69 | bool JuliaBackend::requirementsFullfilled() const | ||||
70 | { | ||||
71 | return QFileInfo( | ||||
72 | JuliaSettings::self()->replPath().toLocalFile() | ||||
73 | ).isExecutable(); | ||||
74 | } | ||||
75 | | ||||
76 | QWidget *JuliaBackend::settingsWidget(QWidget *parent) const | ||||
77 | { | ||||
78 | QWidget *widget = new QWidget(parent); | ||||
79 | Ui::JuliaSettingsBase s; | ||||
80 | s.setupUi(widget); | ||||
81 | return widget; | ||||
82 | } | ||||
83 | | ||||
84 | KConfigSkeleton *JuliaBackend::config() const | ||||
85 | { | ||||
86 | return JuliaSettings::self(); | ||||
87 | } | ||||
88 | | ||||
89 | K_PLUGIN_FACTORY_WITH_JSON( | ||||
90 | juliabackend, | ||||
91 | "juliabackend.json", | ||||
92 | registerPlugin<JuliaBackend>(); | ||||
93 | ) | ||||
94 | | ||||
95 | #include "juliabackend.moc" |
Try to remove it, but if you need use just 'julia'.