Commit 80b740ee authored by Alexander Semke's avatar Alexander Semke
Browse files

Redesigned the settings widget for Lua.

parent c5ed784d
......@@ -7,6 +7,8 @@ set(LuaBackend_SRCS
luakeywords.cpp
luahighlighter.cpp
luaextensions.cpp
luasettingswidget.cpp
../backendsettingswidget.cpp
)
kconfig_add_kcfg_files(LuaBackend_SRCS settings.kcfgc)
......@@ -18,7 +20,7 @@ add_backend(luabackend ${LuaBackend_SRCS})
include_directories(${LUAJIT_INCLUDE_DIR})
target_link_libraries(cantor_luabackend ${LUAJIT_LIBRARY} KF5::SyntaxHighlighting)
target_link_libraries(cantor_luabackend cantor_help ${LUAJIT_LIBRARY} KF5::SyntaxHighlighting)
if(BUILD_TESTING)
add_executable( testlua testlua.cpp)
......
......@@ -16,14 +16,14 @@
---
Copyright (C) 2014 Lucas Hermann Negri <lucashnegri@gmail.com>
Copyright (C) 2019 Alexander Semke <alexander.semke@web.de>
Copyright (C) 2019-2020 Alexander Semke <alexander.semke@web.de>
*/
#include "luabackend.h"
#include "luaextensions.h"
#include "luasession.h"
#include "luasettingswidget.h"
#include "settings.h"
#include "ui_settings.h"
LuaBackend::LuaBackend( QObject* parent,const QList<QVariant> args ) : Cantor::Backend( parent,args )
{
......@@ -73,11 +73,7 @@ QString LuaBackend::description() const
QWidget* LuaBackend::settingsWidget(QWidget* parent) const
{
QWidget* widget = new QWidget(parent);
Ui::LuaSettingsBase s;
s.setupUi(widget);
return widget;
return new LuaSettingsWidget(parent, id());
}
KConfigSkeleton* LuaBackend::config() const
......
......@@ -6,59 +6,79 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>420</width>
<height>302</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Path to luajit command:</string>
</property>
</widget>
</item>
<item>
<widget class="KUrlRequester" name="kcfg_Path"/>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="toolTip">
<string>This autorun commands, which will run on start new worksheet. They can be useful for loading needed modules, changing environment, etc.</string>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<property name="title">
<string>Commands to autorun</string>
</property>
<layout class="QVBoxLayout" name="verticalLayoutScripts">
<item>
<widget class="KEditListWidget" name="kcfg_autorunScripts" native="true"/>
</item>
</layout>
<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>Path to luajit:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KUrlRequester" name="kcfg_Path"/>
</item>
<item row="1" 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>
<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>
<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>
<customwidget>
<class>KUrlRequester</class>
<extends>QFrame</extends>
<extends>QWidget</extends>
<header>kurlrequester.h</header>
<container>1</container>
</customwidget>
......
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