Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
KAlgebra
Commits
87def01d
Commit
87def01d
authored
Jul 04, 2011
by
Aleix Pol Gonzalez
🐧
Browse files
Finally make it lookup the plugins in the system directories.
parent
fe3c8096
Changes
17
Hide whitespace changes
Inline
Side-by-side
mobile/CMakeLists.txt
View file @
87def01d
add_subdirectory
(
script
s
)
add_subdirectory
(
plugin
s
)
kde4_add_executable
(
kalgebramobile graph2dmobile.cpp
analitzawrapper.cpp kalgebramobile.cpp main.cpp console.cpp
)
target_link_libraries
(
kalgebramobile
${
KDE4_KDE
UI
_LIBS
}
${
QT_QTSCRIPT_LIBRARY
}
${
QT_QTDECLARATIVE_LIBRARY
}
target_link_libraries
(
kalgebramobile
${
KDE4_KDE
CORE
_LIBS
}
${
QT_QTSCRIPT_LIBRARY
}
${
QT_QTDECLARATIVE_LIBRARY
}
# ${QT_QTSCRIPTTOOLS_LIBRARY}
analitza analitzagui
)
...
...
mobile/kalgebramobile.cpp
View file @
87def01d
...
...
@@ -60,23 +60,18 @@ class PluginsModel : public QStandardItemModel
explicit
PluginsModel
(
QObject
*
parent
=
0
)
:
QStandardItemModel
(
parent
)
{
#if 0
KStandardDirs
d
;
QStringList basedirs = d.findDirs("data", "kalgebra/
script
s");
QStringList
basedirs
=
d
.
findDirs
(
"data"
,
"kalgebra/
plugin
s"
);
QStringList
foundPlugins
;
foreach
(
const
QString
&
dir
,
basedirs
)
{
//we list <dir>/*/*.desktop
QDir
d
(
dir
);
QStringList
dir
s = d.entryList(Q
Dir::Dirs|QDir::NoDotAndDotDot
);
QStringList
file
s
=
d
.
entryList
(
Q
StringList
(
"*.desktop"
)
);
foreach(const QString& plugindir, dirs) {
QDir pd(d.filePath(plugindir));
QStringList files = pd.entryList(QStringList("*.desktop"));
foreach(const QString& plugin, files) {
foundPlugins += pd.absoluteFilePath(plugin);
}
qDebug
()
<<
"lalala"
<<
dir
<<
files
;
foreach
(
const
QString
&
plugin
,
files
)
{
foundPlugins
+=
d
.
absoluteFilePath
(
plugin
);
}
}
...
...
@@ -88,7 +83,7 @@ class PluginsModel : public QStandardItemModel
// const KPluginInfo& info;
QStandardItem
*
item
=
new
QStandardItem
(
KIcon
(
info
.
icon
()),
info
.
name
());
QString postfix = "kalgebra/
script
s/"+info.pluginName();
QString
postfix
=
"kalgebra/
plugin
s/"
+
info
.
pluginName
();
QString
scriptPath
=
KStandardDirs
::
locate
(
"data"
,
postfix
);
Q_ASSERT
(
!
scriptPath
.
isEmpty
());
...
...
@@ -101,18 +96,6 @@ class PluginsModel : public QStandardItemModel
appendRow
(
item
);
}
#endif
QDir
pd
(
"/home/kde-devel/kalgebra/mobile/plugins/"
);
QStringList
files
=
pd
.
entryList
(
QStringList
(
"*.qml"
)),
foundPlugins
;
qDebug
()
<<
"tururuuuuu"
<<
files
;
foreach
(
const
QString
&
plugin
,
files
)
{
QString
scriptPath
=
pd
.
absoluteFilePath
(
plugin
);
QStandardItem
*
item
=
new
QStandardItem
(
plugin
);
item
->
setData
(
scriptPath
,
PathRole
);
item
->
setData
(
0
,
PriorityRole
);
appendRow
(
item
);
}
setSortRole
(
PriorityRole
);
sort
(
0
);
}
...
...
mobile/plugins/CMakeLists.txt
0 → 100644
View file @
87def01d
add_subdirectory
(
widgets
)
install
(
FILES
Console.qml Plot2D.qml Tables.qml
kalgebraconsole.desktop kalgebraplot2d.desktop kalgebratables.desktop
DESTINATION
${
DATA_INSTALL_DIR
}
/kalgebra/plugins/
)
mobile/
scripts/console
/kalgebraconsole.desktop
→
mobile/
plugins
/kalgebraconsole.desktop
View file @
87def01d
...
...
@@ -54,7 +54,7 @@ Comment[zh_TW]=提供主控台以使用 KAlgebra 做為計算機
X-KDE-PluginInfo-Author=Aleix Pol Gonzalez
X-KDE-PluginInfo-Email=aleixpol@kde.org
X-KDE-PluginInfo-Name=
c
onsole
/console.js
X-KDE-PluginInfo-Name=
C
onsole
.qml
X-KDE-PluginInfo-Version=1.0
X-KDE-PluginInfo-License=GPL
X-KAlgebra-Priority=0
mobile/
scripts/plot2d
/kalgebraplot2d.desktop
→
mobile/
plugins
/kalgebraplot2d.desktop
View file @
87def01d
...
...
@@ -53,6 +53,6 @@ Comment[zh_TW]=讓您繪製平面圖形
X-KDE-PluginInfo-Author=Aleix Pol Gonzalez
X-KDE-PluginInfo-Email=aleixpol@kde.org
X-KDE-PluginInfo-Name=
plot2d/plot2d.js
X-KDE-PluginInfo-Name=
Plot2D.qml
X-KDE-PluginInfo-Version=1.0
X-KDE-PluginInfo-License=GPL
mobile/
scripts/table
s/kalgebratables.desktop
→
mobile/
plugin
s/kalgebratables.desktop
View file @
87def01d
...
...
@@ -52,6 +52,6 @@ Comment[zh_TW]=提供主控台以使用 KAlgebra 做為計算機
X-KDE-PluginInfo-Author=Aleix Pol Gonzalez
X-KDE-PluginInfo-Email=aleixpol@kde.org
X-KDE-PluginInfo-Name=
tables/t
ables.
js
X-KDE-PluginInfo-Name=
T
ables.
qml
X-KDE-PluginInfo-Version=1.0
X-KDE-PluginInfo-License=GPL
mobile/plugins/widgets/CMakeLists.txt
0 → 100644
View file @
87def01d
install
(
FILES
Button.qml CalcButton.qml CategoryDelegate.qml ConsoleDelegate.qml ConsoleModel.qml ExpressionInput.qml Keyboard.qml RealInput.qml ToolTip.qml
DESTINATION
${
DATA_INSTALL_DIR
}
/kalgebra/plugins/widgets/
)
mobile/scripts/CMakeLists.txt
deleted
100644 → 0
View file @
fe3c8096
add_subdirectory
(
console
)
add_subdirectory
(
plot2d
)
add_subdirectory
(
tables
)
add_subdirectory
(
variables
)
mobile/scripts/console/CMakeLists.txt
deleted
100644 → 0
View file @
fe3c8096
install
(
FILES
console.js kalgebraconsole.desktop
DESTINATION
${
DATA_INSTALL_DIR
}
/kalgebra/scripts/console/
)
mobile/scripts/console/console.js
deleted
100644 → 0
View file @
fe3c8096
KAlgebraExtension
.
prototype
.
addOperation
=
function
()
{
with
(
this
.
ui
)
{
console
.
addItem
(
Analitza
.
execute
(
display
.
text
))
display
.
selectAll
()
console
.
scrollDown
()
}
}
function
KAlgebraExtension
(
cfg
)
{
this
.
ui
=
cfg
.
newVerticalLayout
();
this
.
ui
.
addWidget
(
cfg
.
newListWidget
(
"
console
"
));
this
.
ui
.
addWidget
(
cfg
.
newQLineEdit
(
"
display
"
));
this
.
ui
.
display
.
setFocus
()
this
.
ui
.
display
.
returnPressed
.
connect
(
this
,
this
.
addOperation
);
}
mobile/scripts/plot2d/CMakeLists.txt
deleted
100644 → 0
View file @
fe3c8096
install
(
FILES
plot2d.js
kalgebraplot2d.desktop
DESTINATION
${
DATA_INSTALL_DIR
}
/kalgebra/scripts/plot2d/
)
mobile/scripts/plot2d/plot2d.js
deleted
100644 → 0
View file @
fe3c8096
KAlgebraExtension
.
prototype
.
edit
=
function
()
{
this
.
dialog
.
show
()
}
function
KAlgebraExtension
(
cfg
)
{
this
.
ui
=
cfg
.
newVerticalLayout
();
this
.
dialog
=
cfg
.
newFunctionsDialog
(
"
dialog
"
);
this
.
ui
.
addWidget
(
cfg
.
newGraph2D
(
"
graph
"
));
this
.
ui
.
addWidget
(
cfg
.
newQPushButton
(
"
edit
"
));
this
.
ui
.
edit
.
text
=
"
Edit
"
this
.
ui
.
edit
.
clicked
.
connect
(
this
,
this
.
edit
);
}
mobile/scripts/tables/CMakeLists.txt
deleted
100644 → 0
View file @
fe3c8096
install
(
FILES
tables.js kalgebratables.desktop
DESTINATION
${
DATA_INSTALL_DIR
}
/kalgebra/scripts/tables/
)
mobile/scripts/tables/tables.js
deleted
100644 → 0
View file @
fe3c8096
KAlgebraExtension
.
prototype
.
execute
=
function
()
{
var
a
=
Analitza
;
with
(
this
.
ui
)
{
list
.
clear
();
var
tmp
=
a
.
unusedVariableName
();
print
(
a
.
execute
(
tmp
+
"
:=
"
+
display
.
text
));
for
(
var
i
=
from
.
value
;
i
<=
to
.
value
;
i
++
)
{
print
(
"
::::
"
+
tmp
+
"
,
"
+
i
);
var
args
=
new
Array
();
args
[
0
]
=
i
;
list
.
addItem
(
i
+
"
:
"
+
a
.
executeFunc
(
tmp
,
args
));
}
a
.
removeVariable
(
tmp
);
}
}
function
KAlgebraExtension
(
cfg
)
{
this
.
ui
=
cfg
.
newVerticalLayout
();
this
.
ui
.
addWidget
(
cfg
.
newQLineEdit
(
"
display
"
));
this
.
ui
.
addWidget
(
cfg
.
newQDoubleSpinBox
(
"
from
"
));
this
.
ui
.
addWidget
(
cfg
.
newQDoubleSpinBox
(
"
to
"
));
this
.
ui
.
addWidget
(
cfg
.
newListWidget
(
"
list
"
));
this
.
ui
.
addWidget
(
cfg
.
newQPushButton
(
"
go
"
));
this
.
ui
.
go
.
text
=
"
Go!
"
this
.
ui
.
go
.
clicked
.
connect
(
this
,
this
.
execute
);
}
mobile/scripts/variables/CMakeLists.txt
deleted
100644 → 0
View file @
fe3c8096
install
(
FILES
variables.js kalgebravariables.desktop
DESTINATION
${
DATA_INSTALL_DIR
}
/kalgebra/scripts/variables/
)
mobile/scripts/variables/kalgebravariables.desktop
deleted
100644 → 0
View file @
fe3c8096
[Desktop Entry]
Icon=code-variable
Type=Service
ServiceTypes=KAlgebra/Script
Name=Variables
Name[bs]=Promjenljive
Name[ca]=Variables
Name[ca@valencia]=Variables
Name[cs]=Proměnné
Name[da]=Variabler
Name[de]=Variablen
Name[en_GB]=Variables
Name[es]=Variables
Name[et]=Muutujad
Name[fi]=Muuttujat
Name[fr]=Variables
Name[gl]=Variábeis
Name[it]=Variabili
Name[ja]=変数
Name[km]=អថេរ
Name[nb]=Variabler
Name[nds]=Variabeln
Name[nl]=Variabelen
Name[pa]=ਵੇਰੀਬਲ
Name[pt]=Variáveis
Name[pt_BR]=Variáveis
Name[ru]=Переменные
Name[sl]=Spremenljivke
Name[sv]=Variabler
Name[ug]=ئۆزگەرگۈچىلەر
Name[uk]=Змінні
Name[x-test]=xxVariablesxx
Name[zh_TW]=變數
Comment=Provides an enumeration of all defined variables
Comment[ca]=Enumera totes les variables definides
Comment[ca@valencia]=Enumera totes les variables definides
Comment[da]=Giver en nummerering af alle definerede værdier
Comment[de]=Stellt eine Aufzählung aller definierten Variablen bereit
Comment[en_GB]=Provides an enumeration of all defined variables
Comment[es]=Proporciona una enumeración de todas las variables definidas
Comment[et]=Kõigi defineeritud muutujate loend
Comment[fr]=Fournit une énumération de toutes les variables définies
Comment[gl]=Fornece unha enumeración de todas as variábeis definidas
Comment[it]=Fornisce un elenco di tutte le variabili definite
Comment[km]=ផ្ដល់នូវការរាយឈ្មោះអថេរទាំងអស់ដែលបានកំណត់
Comment[nb]=Gir en oppregning av alle definerte variabler
Comment[nds]=All defineert Variabeln optellen
Comment[nl]=Biedt en opsomming van alle gedefinieerde variabelen
Comment[pt]=Fornece uma enumeração de todas as variáveis definidas
Comment[pt_BR]=Fornece uma enumeração de todas as variáveis definidas
Comment[ru]=Список всех определённых переменных
Comment[sl]=Ponuja seznam vseh definiranih spremenljivk
Comment[sv]=Tillhandahåller en uppräkning av alla variabler
Comment[uk]=Показує перелік всіх визначених змінних
Comment[x-test]=xxProvides an enumeration of all defined variablesxx
Comment[zh_TW]=提供所有已定義變數的列舉。
X-KDE-PluginInfo-Author=Aleix Pol Gonzalez
X-KDE-PluginInfo-Email=aleixpol@kde.org
X-KDE-PluginInfo-Name=variables/variables.js
X-KDE-PluginInfo-Version=1.0
X-KDE-PluginInfo-License=GPL
mobile/scripts/variables/variables.js
deleted
100644 → 0
View file @
fe3c8096
function
KAlgebraExtension
(
cfg
)
{
this
.
ui
=
cfg
.
newTreeView
(
"
view
"
);
this
.
ui
.
rootIsDecorated
=
false
;
this
.
ui
.
setModel
(
VariablesModel
);
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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