Commit 06a2aa5f authored by Martin Straka's avatar Martin Straka

Records management settings refactoring

parent e098f446
......@@ -39,17 +39,18 @@ Item {
function areUrlandTokenFilled() {
infoButton.enabled = (urlTextField.text.toString() !== "" && tokenTextField.text.toString() !== "")
clearButton.enabled = infoButton.enabled
acceptElement.visible = infoButton.enabled
}
/* Clear all data and info */
function clearAll() {
updateRmData.visible = false
urlTextField.clear()
tokenTextField.clear()
serviceInfo.visible = false
areUrlandTokenFilled()
infoButton.text = qsTr("Get service info")
acceptElement.visible = true
userNote.visible = true
}
Component.onCompleted: {
......@@ -59,7 +60,8 @@ Item {
tokenTextField.text = settings.rmToken()
areUrlandTokenFilled()
recordsManagement.loadStoredServiceInfo()
updateRmDataButton.visible = recordsManagement.isValidRecordsManagement()
updateRmData.visible = recordsManagement.isValidRecordsManagement()
userNote.visible = !updateRmData.visible
}
PageHeader {
......@@ -104,12 +106,36 @@ Item {
anchors.right: parent.right
anchors.left: parent.left
spacing: formItemVerticalSpacing
Column {
id: updateRmData
width: parent.width
spacing: formItemVerticalSpacing
visible: false
AccessibleText {
color: datovkaPalette.mid
wrapMode: Text.Wrap
horizontalAlignment: Text.AlignHCenter
width: parent.width
text: qsTr("Click button below for synchronization of information about uploaded files.")
}
AccessibleButton {
id: updateRmDataButton
height: inputItemHeight
font.pointSize: defaultTextFont.font.pointSize
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Update list of uploaded files")
onClicked: {
recordsManagement.getStoredMsgInfoFromRecordsManagement(urlTextField.text, tokenTextField.text)
}
}
} // Column
AccessibleText {
id: userNote
color: datovkaPalette.mid
wrapMode: Text.Wrap
horizontalAlignment: Text.AlignHCenter
width: parent.width
text: qsTr("Please fill service URL and your identification token. Click button 'Get service info' to login into records management service. You should received service info. Finally, click to icon for saving into settings.")
text: qsTr("Please fill service URL and your identification token. Click button 'Get service info' to login into records management service. You should received service info. Finally, click the icon for saving into settings.")
}
AccessibleText {
color: datovkaPalette.text
......@@ -172,6 +198,7 @@ Item {
onClicked: {
serviceInfo.visible = recordsManagement.callServiceInfo(urlTextField.text, tokenTextField.text)
serviceInfoError.visible = !serviceInfo.visible
acceptElement.visible = serviceInfo.visible
}
}
AccessibleButton {
......@@ -238,25 +265,7 @@ Item {
accessibleName: qsTr("Records management logo")
}
} // Grid
AccessibleText {
color: datovkaPalette.mid
wrapMode: Text.Wrap
horizontalAlignment: Text.AlignHCenter
width: parent.width
text: qsTr("Click button below for synchronization of information about uploaded files.")
}
AccessibleButton {
id: updateRmDataButton
visible: false
height: inputItemHeight
font.pointSize: defaultTextFont.font.pointSize
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Update list of uploaded files")
onClicked: {
recordsManagement.getStoredMsgInfoFromRecordsManagement(urlTextField.text, tokenTextField.text)
}
}
} // // Column
} // Column
} // Column
} // Pane
ScrollIndicator.vertical: ScrollIndicator {}
......@@ -266,15 +275,17 @@ Item {
onServiceInfo: {
if (srName !== "" && srToken !== "") {
serviceInfo.visible = true
userNote.visible = false
acceptElement.visible = true
infoButton.text = (serviceInfo.visible) ? qsTr("Update service info") : qsTr("Get service info")
serviceName.text = srName
tokenName.text = srToken
updateRmDataButton.visible = serviceInfo.visible
serviceInfoError.visible = false
serviceLogo.source = "image://images/rmlogo.svg"
} else {
serviceInfo.visible = false
updateRmDataButton.visible = serviceInfo.visible
updateRmData.visible = serviceInfo.visible
userNote.visible = !serviceInfo.visible
}
}
}
......
......@@ -343,10 +343,10 @@ void RecordsManagement::rmSyncFinished(const QString &userName, int accNumber,
{
if (accNumber < accTotal) {
emit statusBarTextChanged(
tr("Sync account '%1' (%2/%3)").arg(userName).arg(accNumber).arg(accTotal),
tr("Update account '%1' (%2/%3)").arg(userName).arg(accNumber).arg(accTotal),
true, true);
} else {
emit statusBarTextChanged(tr("Sync done"), false, true);
emit statusBarTextChanged(tr("Update done"), false, true);
}
}
......
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