2020-09-29 22:47:37 +03:00
|
|
|
import QtQuick 2.6
|
|
|
|
import Sailfish.Silica 1.0
|
|
|
|
import "utils.js" as Utils
|
|
|
|
import "../components"
|
|
|
|
|
|
|
|
Page {
|
|
|
|
allowedOrientations: Orientation.All
|
|
|
|
property var printer
|
|
|
|
|
|
|
|
SilicaFlickable {
|
|
|
|
anchors.fill: parent
|
|
|
|
contentHeight: col.height
|
|
|
|
|
|
|
|
Column {
|
|
|
|
id: col
|
|
|
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
width: parent.width - 2*Theme.paddingLarge
|
|
|
|
PageHeader {
|
|
|
|
title: qsTr("Details")
|
|
|
|
description: printer.attrs["printer-name"].value
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO:
|
|
|
|
// location?
|
|
|
|
// message from operator?
|
|
|
|
// organization /-unit
|
|
|
|
// supply info uri?
|
|
|
|
// identify button?
|
|
|
|
|
|
|
|
SectionHeader {
|
|
|
|
text: qsTr("Make and model")
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
2021-02-13 19:30:19 +03:00
|
|
|
text: Utils.unknownForEmptyString(printer.attrs["printer-make-and-model"].value)
|
2020-09-29 22:47:37 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
SectionHeader {
|
2020-09-30 21:57:05 +03:00
|
|
|
text: qsTr("Printer status")
|
2020-09-29 22:47:37 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
text: Utils.ippName("printer-state", printer.attrs["printer-state"].value)
|
|
|
|
}
|
|
|
|
|
2020-10-10 18:32:44 +03:00
|
|
|
Repeater
|
|
|
|
{
|
|
|
|
model: printer.attrs["printer-state-reasons"].value
|
|
|
|
Label {
|
|
|
|
text: Utils.ippName("printer-state-reasons", printer.attrs["printer-state-reasons"].value[index])
|
|
|
|
}
|
2020-09-29 22:47:37 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
text: printer.attrs["printer-state-message"].value
|
|
|
|
visible: printer.attrs.hasOwnProperty("printer-state-message")
|
|
|
|
}
|
|
|
|
|
|
|
|
SectionHeader {
|
|
|
|
text: qsTr("IPP versions")
|
|
|
|
visible: printer.attrs.hasOwnProperty("ipp-versions-supported")
|
|
|
|
}
|
|
|
|
|
2020-09-30 21:57:05 +03:00
|
|
|
|
|
|
|
Label
|
2020-09-29 22:47:37 +03:00
|
|
|
{
|
2020-09-30 21:57:05 +03:00
|
|
|
text: printer.attrs["ipp-versions-supported"].value.join(" ")
|
|
|
|
visible: printer.attrs.hasOwnProperty("ipp-versions-supported")
|
2020-09-29 22:47:37 +03:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
SectionHeader {
|
|
|
|
text: qsTr("IPP features")
|
|
|
|
visible: printer.attrs.hasOwnProperty("ipp-features-supported")
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Repeater
|
|
|
|
{
|
|
|
|
model: printer.attrs["ipp-features-supported"].value.length
|
|
|
|
Label
|
|
|
|
{
|
|
|
|
text: printer.attrs["ipp-features-supported"].value[index]
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
SectionHeader {
|
|
|
|
text: qsTr("Firmware")
|
|
|
|
visible: printer.attrs.hasOwnProperty("marker-colors")
|
|
|
|
}
|
|
|
|
|
|
|
|
Repeater
|
|
|
|
{
|
|
|
|
model: printer.attrs["printer-firmware-name"].value.length
|
|
|
|
Label
|
|
|
|
{
|
|
|
|
text: printer.attrs["printer-firmware-name"].value[index]+": "
|
|
|
|
+ printer.attrs["printer-firmware-string-version"].value[index]
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
SectionHeader {
|
|
|
|
text: qsTr("Supply status")
|
|
|
|
visible: printer.attrs.hasOwnProperty("marker-colors")
|
|
|
|
}
|
|
|
|
|
|
|
|
Repeater
|
|
|
|
{
|
|
|
|
model: printer.attrs["marker-colors"].value.length
|
|
|
|
|
|
|
|
SupplyItem
|
|
|
|
{
|
|
|
|
color: printer.attrs["marker-colors"].value[index]
|
|
|
|
level: printer.attrs["marker-levels"].value[index]
|
|
|
|
high_level: printer.attrs["marker-high-levels"].value[index]
|
|
|
|
low_level: printer.attrs["marker-low-levels"].value[index]
|
|
|
|
name: printer.attrs["marker-names"].value[index]
|
|
|
|
type: printer.attrs["marker-types"].value[index]
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|