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
KAlgebra
Commits
26158e29
Commit
26158e29
authored
Jul 06, 2021
by
Aleix Pol Gonzalez
🐧
Browse files
mobile console: Implement replacing input with what we clicked
parent
8d14ad73
Changes
3
Hide whitespace changes
Inline
Side-by-side
mobile/content/ui/Console.qml
View file @
26158e29
...
...
@@ -115,6 +115,10 @@ Kirigami.ScrollablePage {
delegate
:
Kirigami.Card
{
contentItem
:
QQC2.Label
{
text
:
model
.
result
onLinkActivated
:
{
input
.
remove
(
input
.
selectionStart
,
input
.
selectionEnd
)
input
.
insert
(
input
.
cursorPosition
,
consoleModel
.
readContent
(
link
))
}
}
actions
:
[
...
...
src/consolemodel.cpp
View file @
26158e29
...
...
@@ -24,6 +24,7 @@
#include <KLocalizedString>
#include <QGuiApplication>
#include <QPalette>
#include <QUrlQuery>
Q_GLOBAL_STATIC_WITH_ARGS
(
QByteArray
,
s_css
,
(
"<style type=
\"
text/css
\"
>
\n
"
...
...
@@ -179,3 +180,8 @@ QByteArray ConsoleModel::css() const
{
return
*
s_css
;
}
QString
ConsoleModel
::
readContent
(
const
QUrl
&
url
)
{
return
QUrlQuery
(
url
).
queryItemValue
(
"func"
);
}
src/consolemodel.h
View file @
26158e29
...
...
@@ -46,6 +46,8 @@ public:
Q_SCRIPTABLE
void
clear
();
Q_SCRIPTABLE
bool
saveLog
(
const
QUrl
&
path
)
const
;
Q_SCRIPTABLE
static
QString
readContent
(
const
QUrl
&
url
);
QByteArray
css
()
const
;
ConsoleMode
mode
()
const
{
return
m_mode
;
}
...
...
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