Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
Cantor
Commits
80b740ee
Commit
80b740ee
authored
Nov 20, 2020
by
Alexander Semke
Browse files
Redesigned the settings widget for Lua.
parent
c5ed784d
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/backends/lua/CMakeLists.txt
View file @
80b740ee
...
...
@@ -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
)
...
...
src/backends/lua/luabackend.cpp
View file @
80b740ee
...
...
@@ -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
...
...
src/backends/lua/settings.ui
View file @
80b740ee
...
...
@@ -6,59 +6,79 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
4
0
0
</width>
<height>
30
0
</height>
<width>
4
2
0
</width>
<height>
30
2
</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>
Q
Frame
</extends>
<extends>
Q
Widget
</extends>
<header>
kurlrequester.h
</header>
<container>
1
</container>
</customwidget>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment