Commit 76d4a5dc authored by Shubham  .'s avatar Shubham .
Browse files

Merge master

parents 91b1b0b8 54f35d69
......@@ -4,8 +4,22 @@
### New features
* Change entries replacement logic and add possibility to use previous logic via Cantor setting option.
* Add possibility to change plot extension (available variants: jpeg, png, svg and eps (if builded with eps support)) in Octave backend.
* Change entries replacement logic and add possibility to use previous logic via Cantor setting option
* Add possibility to change plot extension (available variants: jpeg, png, svg and eps (if builded with eps support)) in Octave backend
* Use file name instead file URL in title bar
* LaTeX typesettings in Sage is back
* Add a filter in open dialog to present Cantor worksheets and Jupyter notebooks together
* Add new global entries actions: collapsing all results, uncollapsing all results, remove all results
* Add actions for selection
* Disable highlighting updates for excluded from execution entries
* Add new entry type - HorizontalRuleEntry
* Add zoom widget
* Add tooltips for almost all settings entries
* Python Plot Extension: Add support for different packages
* Improve tabulation handling in Command Entries. Now the tabulation works like tabulation in code editors
* Support popular Julia plot packages in PlotExtension
* Add File Browser panel
* Now it is possible to save and load images in Cantor worksheet file format
## 20.04
......
......@@ -31,6 +31,7 @@ set(cantor_SRCS
install(FILES cantor.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})
ki18n_wrap_ui(cantor_SRCS settings.ui)
ki18n_wrap_ui(cantor_SRCS formating.ui)
ki18n_wrap_ui(cantor_SRCS backendchooser.ui)
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/../icons/*-apps-cantor.png")
......@@ -65,6 +66,7 @@ set(cantor_PART_SRCS
latexentry.cpp
placeholderentry.cpp
horizontalruleentry.cpp
hierarchyentry.cpp
worksheetcursor.cpp
searchbar.cpp
actionbar.cpp
......
......@@ -50,7 +50,8 @@
#include "cantor.h"
#include "settings.h"
#include "ui_settings.h"
#include "ui_formating.h"
#include "backendchoosedialog.h"
#include <QMetaObject>
CantorShell::CantorShell() : KParts::MainWindow(), m_part(nullptr), m_panelHandler(nullptr)
......@@ -367,7 +368,12 @@ void CantorShell::addWorksheet(const QString& backendName)
connect(part, SIGNAL(setCaption(QString,QIcon)), this, SLOT(setTabCaption(QString,QIcon)));
connect(part, SIGNAL(worksheetSave(QUrl)), this, SLOT(onWorksheetSave(QUrl)));
connect(part, SIGNAL(showHelp(QString)), this, SIGNAL(showHelp(QString)));
connect(part, SIGNAL(hierarchyChanged(QStringList, QStringList, QList<int>)), this, SIGNAL(hierarchyChanged(QStringList, QStringList, QList<int>)));
connect(part, SIGNAL(hierarhyEntryNameChange(QString, QString, int)), this, SIGNAL(hierarhyEntryNameChange(QString, QString, int)));
connect(this, SIGNAL(requestScrollToHierarchyEntry(QString)), part, SIGNAL(requestScrollToHierarchyEntry(QString)));
connect(this, SIGNAL(settingsChanges()), part, SIGNAL(settingsChanges()));
connect(part, SIGNAL(requestDocumentation(QString)), this, SIGNAL(requestDocumentation(QString)));
m_parts.append(part);
if (backend) // If backend empty (loading worksheet from file), then we connect to signal and wait
m_parts2Backends[part] = backend->id();
......@@ -585,12 +591,19 @@ void CantorShell::closeEvent(QCloseEvent* event) {
void CantorShell::showSettings()
{
KConfigDialog *dialog = new KConfigDialog(this, QLatin1String("settings"), Settings::self());
QWidget *generalSettings = new QWidget;
Ui::SettingsBase base;
base.setupUi(generalSettings);
QWidget *formattingSettings = new QWidget;
Ui::SettingsFormatting formatting;
formatting.setupUi(formattingSettings);
base.kcfg_DefaultBackend->addItems(Cantor::Backend::listAvailableBackends());
dialog->addPage(generalSettings, i18n("General"), QLatin1String("preferences-other"));
dialog->addPage(formattingSettings, i18n("Formatting"), QLatin1String("preferences-other"));
for (auto* backend : Cantor::Backend::availableBackends())
{
if (backend->config()) //It has something to configure, so add it to the dialog
......@@ -598,6 +611,7 @@ void CantorShell::showSettings()
}
dialog->show();
connect(dialog, &KConfigDialog::settingsChanged, this, &CantorShell::settingsChanges);
}
void CantorShell::downloadExamples()
......
......@@ -79,6 +79,10 @@ protected:
Q_SIGNALS:
void showHelp(QString);
void hierarchyChanged(QStringList, QStringList, QList<int>);
void hierarhyEntryNameChange(QString, QString, int);
void requestScrollToHierarchyEntry(QString);
void settingsChanges();
void requestDocumentation(const QString&);
public Q_SLOTS:
......
......@@ -6,6 +6,7 @@
<include>cantor_export.h</include>
<include>config-cantor.h</include>
<include>QUrl</include>
<include>QApplication</include>
<kcfgfile/>
<group name="Cantor">
<entry name="DefaultBackend" type="String">
......@@ -64,6 +65,102 @@
<label>Path to directory, which contains Cantor plugins (cantorpart and all backends)</label>
<default code="true">QUrl::fromLocalFile(QString::fromLocal8Bit(PATH_TO_CANTOR_PLUGINS))</default>
</entry>
<entry name="ChapterFontFamily" type="Font">
<label>Hierarchy font for chapter</label>
<default code="true">QApplication::font()</default>
</entry>
<entry name="ChapterFontSize" type="Int">
<label>Hierarchy font size for chapter</label>
<default code="true">QApplication::font().pointSize()</default>
</entry>
<entry name="ChapterFontItalic" type="Bool">
<label>Hierarchy font italic for chapter</label>
<default>false</default>
</entry>
<entry name="ChapterFontBold" type="Bool">
<label>Hierarchy font bold for chapter</label>
<default>false</default>
</entry>
<entry name="SubchapterFontFamily" type="Font">
<label>Hierarchy font for subchapter</label>
<default code="true">QApplication::font()</default>
</entry>
<entry name="SubchapterFontSize" type="Int">
<label>Hierarchy font size for subchapter</label>
<default code="true">QApplication::font().pointSize()</default>
</entry>
<entry name="SubchapterFontItalic" type="Bool">
<label>Hierarchy font italic for subchapter</label>
<default>false</default>
</entry>
<entry name="SubchapterFontBold" type="Bool">
<label>Hierarchy font bold for subchapter</label>
<default>false</default>
</entry>
<entry name="SectionFontFamily" type="Font">
<label>Hierarchy font for section</label>
<default code="true">QApplication::font()</default>
</entry>
<entry name="SectionFontSize" type="Int">
<label>Hierarchy font for section</label>
<default code="true">QApplication::font().pointSize()</default>
</entry>
<entry name="SectionFontItalic" type="Bool">
<label>Hierarchy font italic for section</label>
<default>false</default>
</entry>
<entry name="SectionFontBold" type="Bool">
<label>Hierarchy font bold for section</label>
<default>false</default>
</entry>
<entry name="SubsectionFontFamily" type="Font">
<label>Hierarchy font for subsection</label>
<default code="true">QApplication::font()</default>
</entry>
<entry name="SubsectionFontSize" type="Int">
<label>Hierarchy font for subsection</label>
<default code="true">QApplication::font().pointSize()</default>
</entry>
<entry name="SubsectionFontItalic" type="Bool">
<label>Hierarchy font italic for subsection</label>
<default>false</default>
</entry>
<entry name="SubsectionFontBold" type="Bool">
<label>Hierarchy font bold for subsection</label>
<default>false</default>
</entry>
<entry name="ParagraphFontFamily" type="Font">
<label>Hierarchy font for paragraph</label>
<default code="true">QApplication::font()</default>
</entry>
<entry name="ParagraphFontSize" type="Int">
<label>Hierarchy font for paragraph</label>
<default code="true">QApplication::font().pointSize()</default>
</entry>
<entry name="ParagraphFontItalic" type="Bool">
<label>Hierarchy font italic for paragraph</label>
<default>false</default>
</entry>
<entry name="ParagraphFontBold" type="Bool">
<label>Hierarchy font bold for paragraph</label>
<default>false</default>
</entry>
<entry name="SubparagraphFontFamily" type="Font">
<label>Hierarchy font for subparagraph</label>
<default code="true">QApplication::font()</default>
</entry>
<entry name="SubparagraphFontSize" type="Int">
<label>Hierarchy font for subparagraph</label>
<default code="true">QApplication::font().pointSize()</default>
</entry>
<entry name="SubparagraphFontItalic" type="Bool">
<label>Hierarchy font italic for subparagraph</label>
<default>false</default>
</entry>
<entry name="SubparagraphFontBold" type="Bool">
<label>Hierarchy font bold for subparagraph</label>
<default>false</default>
</entry>
</group>
</kcfg>
......@@ -146,7 +146,12 @@ CantorPart::CantorPart( QWidget *parentWidget, QObject *parent, const QVariantLi
connect(m_worksheet, &Worksheet::modified, this, static_cast<void (KParts::ReadWritePart::*)()>(&KParts::ReadWritePart::setModified));
connect(m_worksheet, &Worksheet::showHelp, this, &CantorPart::showHelp);
connect(m_worksheet, &Worksheet::loaded, this, &CantorPart::initialized);
connect(m_worksheet, &Worksheet::hierarchyChanged, this, &CantorPart::hierarchyChanged);
connect(m_worksheet, &Worksheet::hierarhyEntryNameChange, this, &CantorPart::hierarhyEntryNameChange);
connect(this, &CantorPart::requestScrollToHierarchyEntry, m_worksheet, &Worksheet::requestScrollToHierarchyEntry);
connect(this, &CantorPart::settingsChanges, m_worksheet, &Worksheet::handleSettingsChanges);
connect(m_worksheet, &Worksheet::requestDocumentation, this, &CantorPart::requestDocumentation);
layout->addWidget(m_worksheetview);
setWidget(widget);
......
......@@ -83,8 +83,12 @@ public:
Q_SIGNALS:
void setCaption(const QString& caption, const QIcon& icon);
void showHelp(const QString& help);
void hierarchyChanged(QStringList, QStringList, QList<int>);
void hierarhyEntryNameChange(QString name, QString searchName, int depth);
void worksheetSave(const QUrl& url);
void setBackendName(const QString& name);
void requestScrollToHierarchyEntry(QString);
void settingsChanges();
void requestDocumentation(const QString& keyword);
public Q_SLOTS:
......
......@@ -50,7 +50,6 @@
const QString CommandEntry::Prompt = QLatin1String(">>> ");
const QString CommandEntry::MidPrompt = QLatin1String(">> ");
const QString CommandEntry::HidePrompt = QLatin1String("> ");
const double CommandEntry::HorizontalSpacing = 4;
const double CommandEntry::VerticalSpacing = 4;
......
......@@ -167,7 +167,6 @@ class CommandEntry : public WorksheetEntry
private:
static const double HorizontalSpacing;
static const double VerticalSpacing;
WorksheetTextItem* m_promptItem;
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SettingsFormatting</class>
<widget class="QWidget" name="SettingsFormatting">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>946</width>
<height>511</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="QGroupBox" name="groupBox">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>Hierarchy Fonts</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="ChapterTab">
<attribute name="title">
<string>Chapter Font</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Font Family:</string>
</property>
</widget>
</item>
<item>
<widget class="QFontComboBox" name="kcfg_ChapterFontFamily"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Font Size:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="kcfg_ChapterFontSize">
<property name="minimum">
<number>8</number>
</property>
<property name="maximum">
<number>40</number>
</property>
<property name="value">
<number>14</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="kcfg_ChapterFontBold">
<property name="text">
<string>Bold</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="kcfg_ChapterFontItalic">
<property name="text">
<string>Italic</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="SubchapterTab">
<attribute name="title">
<string>Subchapter Font</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Font Family:</string>
</property>
</widget>
</item>
<item>
<widget class="QFontComboBox" name="kcfg_SubchapterFontFamily"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Font Size:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="kcfg_SubchapterFontSize">
<property name="minimum">
<number>8</number>
</property>
<property name="maximum">
<number>40</number>
</property>
<property name="value">
<number>14</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="kcfg_SubchapterFontBold">
<property name="text">
<string>Bold</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="kcfg_SubchapterFontItalic">
<property name="text">
<string>Italic</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="SectionTab">
<attribute name="title">
<string>Section Font</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Font Family:</string>
</property>
</widget>
</item>
<item>
<widget class="QFontComboBox" name="kcfg_SectionFontFamily"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Font Size:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="kcfg_SectionFontSize">
<property name="minimum">
<number>8</number>
</property>
<property name="maximum">
<number>40</number>
</property>
<property name="value">
<number>14</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="kcfg_SectionFontBold">
<property name="text">
<string>Bold</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="kcfg_SectionFontItalic">
<property name="text">
<string>Italic</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="SubsectionTab">
<attribute name="title">
<string>Subsection Font</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLabel" name="label_8">
<property name="text">
<string>Font Family:</string>
</property>
</widget>
</item>
<item>
<widget class="QFontComboBox" name="kcfg_SubsectionFontFamily"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QLabel" name="label_9">
<property name="text">
<string>Font Size:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="kcfg_SubsectionFontSize">
<property name="minimum">
<number>8</number>
</property>
<property name="maximum">
<number>40</number>
</property>
<property name="value">
<number>14</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="kcfg_SubsectionFontBold">
<property name="text">
<string>Bold</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="kcfg_SubsectionFontItalic">
<property name="text">
<string>Italic</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="ParagraphTab">
<attribute name="title">
<string>Paragraph Font</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QLabel" name="label_11">
<property name="text">
<string>Font Family:</string>
</property>
</widget>
</item>
<item>
<widget class="QFontComboBox" name="kcfg_ParagraphFontFamily"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QLabel" name="label_10">
<property name="text">
<string>Font Size:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="kcfg_ParagraphFontSize">
<property name="minimum">
<number>8</number>
</property>
<property name="maximum">
<number>40</number>
</property>
<property name="value">
<number>14</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="kcfg_ParagraphFontBold">
<property name="text">
<string>Bold</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="kcfg_ParagraphFontItalic">
<property name="text">
<string>Italic</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="SubparagraphTab">
<attribute name="title">
<string>Subparagraph Font</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_11">
<item>
<widget class="QLabel" name="label_13">
<property name="text">
<string>Font Family:</string>
</property>
</widget>
</item>
<item>
<widget class="QFontComboBox" name="kcfg_SubparagraphFontFamily"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_12">
<item>
<widget class="QLabel" name="label_12">
<property name="text">
<string>Font Size:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="kcfg_SubparagraphFontSize">
<property name="minimum">
<number>8</number>