Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F217255
SettingsPage.qml
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
SettingsPage.qml
View Options
import
QtQuick
2.7
import
QtQuick
.
Controls
2.0
as
Controls
import
QtQuick
.
Controls
.
Material
2.0
import
QtQuick
.
Layouts
1.2
import
org
.
kde
.
kirigami
2.5
as
Kirigami
import
Qt
.
labs
.
settings
1.0
Kirigami
.
Page
{
title:
qsTr
(
"Settings"
)
ColumnLayout
{
anchors.fill:
parent
Kirigami
.
Heading
{
text:
qsTr
(
"Enter settings for your specific instance and credentials"
)
wrapMode:
Text
.
WordWrap
Layout.fillWidth:
true
horizontalAlignment:
Qt
.
AlignHCenter
}
Settings
{
id: settings
property
string
phab_url:
"https://phabricator.example.com"
property
string
api_token:
"api-aaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
ColumnLayout
{
width:
parent
.
width
Layout.fillWidth:
true
// For desktop or tablet devices
Layout.alignment:
Qt
.
AlignCenter
Layout.maximumWidth:
Kirigami
.
Units
.
gridUnit
*
25
// URL field
Controls
.
Label
{
id: urlLabel
text:
qsTr
(
"Your instance URL:"
)
}
Controls
.
TextField
{
id: urlField
text:
settings
.
phab_url
placeholderText:
qsTr
(
"https://phabricator.example.com"
)
Layout.fillWidth:
true
// selectByMouse: true
}
// API toekn field
Controls
.
Label
{
text:
qsTr
(
"Your API token:"
)
}
Controls
.
TextField
{
id: tokenField
text:
settings
.
api_token
selectByMouse:
true
Layout.fillWidth:
true
}
// Save button
Controls
.
Button
{
id: connectButton
Layout.fillWidth:
true
Kirigami.Theme.backgroundColor:
Material
.
accent
text:
qsTr
(
"Save"
)
onClicked:
{
// connect to given account data
// kaidan.jid = jidField.text.toLowerCase()
// kaidan.password = passField.text
// kaidan.mainConnect()
settings
.
phab_url
=
urlField
.
text
settings
.
api_token
=
tokenField
.
text
}
}
// connect when return was pressed
Keys.onPressed:
{
if
(
event
.
key
===
Qt
.
Key_Return
||
event
.
key
===
Qt
.
Key_Enter
)
{
connectButton
.
clicked
()
}
}
}
}
Component.onCompleted:
{
console
.
log
(
Qt
.
application
.
name
);
console
.
log
(
"Phab url is "
+
settings
.
phab_url
)
console
.
log
(
"API token is "
+
settings
.
api_token
)
// kaidan.connectionStateChanged.connect(handleConnectionState)
// kaidan.disconnReasonChanged.connect(handleConnectionError)
}
Component.onDestruction:
{
console
.
log
(
"Phab url is "
+
settings
.
phab_url
)
console
.
log
(
"API token is "
+
settings
.
api_token
)
// kaidan.connectionStateChanged.disconnect(handleConnectionState)
// kaidan.disconnReasonChanged.disconnect(handleConnectionError)
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 28, 3:28 AM (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
153999
Default Alt Text
SettingsPage.qml (2 KB)
Attached To
Mode
rMANIFOLD Manifold
Attached
Detach File
Event Timeline
Log In to Comment