Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F217193
ManiphestPage.qml
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
ManiphestPage.qml
View Options
import
QtQuick
2.1
import
QtQuick
.
Controls
2.0
as
QQC2
import
org
.
kde
.
kirigami
2.4
as
Kirigami
import
Qt
.
labs
.
settings
1.0
import
"../js/functions.js"
as
ManifoldJS
Kirigami
.
ScrollablePage
{
title:
"Maniphest Tasks"
supportsRefreshing:
true
// Completely don't understand how to do this in pure QML / JavaScript yet, alas
Settings
{
id: settings
property
string
phab_url:
"https://phabricator.example.com"
property
string
api_token:
"api-aaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
property
var
phab_url:
settings
.
phab_url
Component
{
id: myDelegate
Text
{
text:
"<font color=\""
+
priorityColor
+
"\"><strong><a href='"
+
settings
.
phab_url
+
"/T"
+
taskID
+
"' >T"
+
taskID
+
":</a></strong></font> "
+
title
// color: Kirigami.Theme.highlightedTextColor
color:
priorityColor
onLinkActivated:
Qt
.
openUrlExternally
(
link
)
}
}
//Page contents...
ListView
{
id: taskList
model:
ListModel
{
id: model
}
anchors.fill:
parent
delegate:
myDelegate
Component.onCompleted:
{
// Set some stuff
Qt
.
application
.
name
=
"Manifold"
Qt
.
application
.
domain
=
"keithzg.ca"
Qt
.
application
.
organization
=
"keithzg"
console
.
log
(
"Phab url is "
+
settings
.
phab_url
);
var
xhr
=
new
XMLHttpRequest
;
xhr
.
open
(
"POST"
,
settings
.
phab_url
+
"/api/maniphest.query"
);
xhr
.
onreadystatechange
=
function
()
{
if
(
xhr
.
readyState
===
XMLHttpRequest
.
DONE
)
{
var
data
=
JSON
.
parse
(
xhr
.
responseText
);
model
.
clear
();
var
list
=
data
[
"result"
];
for
(
var
i
in
list
)
{
model
.
append
({
taskID:
list
[
i
][
"id"
],
title:
list
[
i
][
"title"
],
priorityColor:
list
[
i
][
"priorityColor"
],
});
}
}
}
xhr
.
send
(
"api.token="
+
settings
.
api_token
+
"&order=order-priority&status=status-open"
);
}
}
}
File Metadata
Details
Attached
Mime Type
text/html
Expires
Sun, Apr 27, 3:59 PM (23 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
154005
Default Alt Text
ManiphestPage.qml (1 KB)
Attached To
Mode
rMANIFOLD Manifold
Attached
Detach File
Event Timeline
Log In to Comment