-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathServerConfigPage.qml
90 lines (73 loc) · 2.65 KB
/
ServerConfigPage.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import Qt.labs.settings 1.1
import br.edu.ifba.gsort.webscraping 1.0
Page {
property Image busyIndicator
property WebScraper webScraper
title: qsTr("Configuração do Servidor")
ColumnLayout {
id: columnLayout
anchors.centerIn: parent
spacing: 20
width: parent.width*0.75
ColumnLayout {
Layout.preferredWidth: parent.width
spacing: 2
Label { text: "URL do servidor:" }
SEITextField {
id: txtServerURL
Layout.preferredWidth: parent.width
placeholderText: "ex: sei.ifba.edu.br"
}
}
ColumnLayout {
Layout.preferredWidth: parent.width
spacing: 2
Label { text: "Sigla do órgão:" }
SEITextField {
id: txtSiglaOrgaoSistema
Layout.preferredWidth: parent.width
placeholderText: "verifique na URL"
}
}
ColumnLayout {
Layout.preferredWidth: parent.width
spacing: 2
Label { text: "Sigla do sistema:" }
SEITextField {
id: txtSiglaSistema
Layout.preferredWidth: parent.width
text: "SEI"
}
}
Button {
id: loginButton
Layout.fillWidth: true
text: "avançar"
onClicked: stackView.push("qrc:/LoginPage.qml", { busyIndicator: busyIndicator, serverSettings: serverSettings, webScraper: webScraper })
Text {
id: errorText
anchors { horizontalCenter: parent.horizontalCenter; top: loginButton.bottom; topMargin: columnLayout.spacing }
color: "#607D8B"
horizontalAlignment: Label.AlignHCenter
}
}
}
Settings {
id: serverSettings
property alias serverURL: txtServerURL.text
property alias siglaOrgaoSistema: txtSiglaOrgaoSistema.text
property alias siglaSistema: txtSiglaSistema.text
}
Component.onCompleted: {
if (Qt.platform.os != "android") txtServerURL.forceActiveFocus()
if (serverSettings.serverURL !== "" && serverSettings.siglaOrgaoSistema !== "") {
txtServerURL.text = serverSettings.serverURL
txtSiglaOrgaoSistema.text = serverSettings.siglaOrgaoSistema
txtSiglaSistema.text = serverSettings.siglaSistema
stackView.push("qrc:/LoginPage.qml", { busyIndicator: busyIndicator, serverSettings: serverSettings, webScraper: webScraper })
}
}
}