Commit 66388850 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Add some actions to the console for feature parity

parent f9e340b8
import QtQuick 2.0
import QtQuick 2.2
import QtQuick.Dialogs 1.0
import org.kde.analitza 1.0
import widgets 1.0
......@@ -6,16 +7,56 @@ KAlgebraPage
{
id: page
ListModel { id: itemModel }
Analitza {
id: a
variables: app.variables
calculate: false
}
FileDialog {
id: fileDialog
folder: shortcuts.home
onAccepted: proceed()
property var proceed
}
function proceedLoadScript()
contextualActions: [
Action {
text: i18n("Load Script...")
onTriggered: {
fileDialog.title = text
var v = fileDialog.open()
console.log("opened...", v)
}
},
Action {
text: i18n("Save Script...")
},
//TODO: Recent scripts
Action {
text: i18n("Export Log...")
},
// --
Action {
text: a.calculate ? i18n("Evaluate...") : i18n("Calculate...")
onTriggered: a.calculate = !a.calculate
},
// --
Action {
iconName: "edit-clear-history"
text: i18n("Clear Log")
onTriggered: itemModel.clear()
}
]
ExpressionInput {
id: input
focus: true
Analitza {
id: a
variables: app.variables
}
Keys.onReturnPressed: {
var res = a.execute(text)
......
import org.kde.kirigami 2.0
Action
{}
install( FILES
SimpleListView.qml Dialog.qml AddButton.qml
SimpleListView.qml Dialog.qml AddButton.qml Action.qml
KAlgebraPage.qml KAlgebraMobile.qml
DESTINATION ${KDE_INSTALL_DATADIR}/kalgebramobile/plugins/widgets/
......
......@@ -13,11 +13,14 @@ Kirigami.ApplicationWindow
header: Kirigami.ApplicationHeader {}
contextDrawer: Kirigami.ContextDrawer {}
globalDrawer: Kirigami.GlobalDrawer {
id: drawer
title: "KAlgebra"
titleIcon: "qrc:/kalgebra.svgz"
bannerImageSource: "https://images.unsplash.com/photo-1464831728920-2095a7fbc506?ixlib=rb-0.3.5&q=35&fm=jpg&crop=entropy&cs=srgb&s=8887357234283ab5cc2088b779615d87"
Instantiator {
delegate: Kirigami.Action {
......
......@@ -10,3 +10,4 @@ KAlgebraMobile 1.0 KAlgebraMobile.qml
AddButton 1.0 AddButton.qml
Dialog 1.0 Dialog.qml
ComboBox 1.0 ComboBox.qml
Action 1.0 Action.qml
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