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

Redesigned settings widget for Sage.

parent 80b740ee
......@@ -6,6 +6,8 @@ set( SageBackend_SRCS
sagekeywords.cpp
sagehighlighter.cpp
sagecompletionobject.cpp
sagesettingswidget.cpp
../backendsettingswidget.cpp
)
kconfig_add_kcfg_files(SageBackend_SRCS settings.kcfgc)
......@@ -15,7 +17,7 @@ ki18n_wrap_ui(SageBackend_SRCS settings.ui)
add_backend(sagebackend ${SageBackend_SRCS})
target_link_libraries( cantor_sagebackend
target_link_libraries( cantor_sagebackend cantor_help
KF5::Pty
KF5::SyntaxHighlighting)
......
......@@ -16,14 +16,14 @@
---
Copyright (C) 2009 Alexander Rieder <alexanderrieder@gmail.com>
Copyright (C) 2019 Alexander Semke <alexander.semke@web.de>
Copyright (C) 2019-2020 Alexander Semke <alexander.semke@web.de>
*/
#include "sagebackend.h"
#include "sageextensions.h"
#include "sagesession.h"
#include "sagesettingswidget.h"
#include "settings.h"
#include "ui_settings.h"
SageBackend::SageBackend( QObject* parent,const QList<QVariant>& args ) : Cantor::Backend( parent,args )
{
......@@ -78,10 +78,7 @@ bool SageBackend::requirementsFullfilled(QString* const reason) const
QWidget* SageBackend::settingsWidget(QWidget* parent) const
{
QWidget* widget=new QWidget(parent);
Ui::SageSettingsBase s;
s.setupUi(widget);
return widget;
return new SageSettingsWidget(parent, id());
}
KConfigSkeleton* SageBackend::config() const
......
......@@ -6,96 +6,107 @@
<rect>
<x>0</x>
<y>0</y>
<width>416</width>
<height>400</height>
<width>420</width>
<height>302</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label">
<property name="text">
<string>Executable:</string>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tabGeneral">
<attribute name="title">
<string>General</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Executable:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KUrlRequester" name="kcfg_Path"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label2">
<property name="text">
<string>Documentation:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KUrlRequester" name="kcfg_localDoc">
<property name="toolTip">
<string>If empty, the &quot;Show help&quot; action will show the default online documentation. Otherwise, the specified URL will be opened.</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>LaTeX typesetting:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="kcfg_allowLatex">
<property name="toolTip">
<string>Sage LaTeX output not always correct, so latex typesetting can be disabled for better experience</string>
</property>
<property name="text">
<string>Enabled</string>
</property>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>118</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabAutorun">
<attribute name="title">
<string>Autorun</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="lAutorun">
<property name="text">
<string>Commands to autorun</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="KEditListWidget" name="kcfg_autorunScripts"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabDocumentation">
<attribute name="title">
<string>Documentation</string>
</attribute>
</widget>
</widget>
</item>
<item row="0" column="2">
<widget class="KUrlRequester" name="kcfg_Path"/>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label2">
<property name="text">
<string>Documentation:</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="KUrlRequester" name="kcfg_localDoc">
<property name="toolTip">
<string>If empty, the &quot;Show help&quot; action will show the default online documentation. Otherwise, the specified URL will be opened.</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>LaTeX typesetting:</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QCheckBox" name="kcfg_allowLatex">
<property name="toolTip">
<string>Sage LaTeX output not always correct, so latex typesetting can be disabled for better experience</string>
</property>
<property name="text">
<string>Enabled</string>
</property>
</widget>
</item>
<item row="3" column="1">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0" colspan="3">
<widget class="QGroupBox" name="groupBox">
<property name="toolTip">
<string>Commands to automatically run on start. They can be useful for loading needed modules, changing environment, etc.</string>
</property>
<property name="title">
<string>Commands to autorun</string>
</property>
<layout class="QVBoxLayout" name="verticalLayoutScripts">
<item>
<widget class="KEditListWidget" name="kcfg_autorunScripts"/>
</item>
</layout>
</widget>
</item>
<item row="5" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
......
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