2
* Copyright 2017 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by Jonas G. Drange <jonas.drange@canonical.com>
20
import QtQuick.Layouts 1.1
21
import Ubuntu.Components 1.3
22
import Ubuntu.Components.Popups 1.3
23
import Ubuntu.Components.ListItems 1.3 as ListItems
24
import Ubuntu.Settings.Components 0.1
25
import Ubuntu.Settings.Printers 0.1
39
flickable: printerFlickable
50
topMargin: units.gu(2)
64
ListItems.SingleControl {
77
text: printer.description
78
onTextChanged: printer.description = text
83
ListItems.ValueSelector {
88
enabled: values.length > 1
90
values: printer.supportedDuplexModes
91
onSelectedIndexChanged: printer.duplexMode = selectedIndex
92
Component.onCompleted: {
94
selectedIndex = printer.duplexMode
99
ListItems.ValueSelector {
105
values: printer.supportedPageSizes
106
onSelectedIndexChanged: printer.pageSize = selectedIndex
107
Component.onCompleted: selectedIndex = printer.supportedPageSizes.indexOf(printer.pageSize)
110
ListItems.ValueSelector {
115
visible: printer.supportedColorModels.length
117
values: printer.supportedColorModels
118
enabled: values.length > 1
119
onSelectedIndexChanged: printer.colorModel = selectedIndex
120
Component.onCompleted: {
122
selectedIndex = printer.colorModel
126
ListItems.ValueSelector {
131
visible: printer.supportedPrintQualities.length
133
values: printer.supportedPrintQualities
134
enabled: values.length > 1
135
onSelectedIndexChanged: printer.printQuality = selectedIndex
136
Component.onCompleted: {
138
selectedIndex = printer.printQuality
149
Component.onCompleted: push(printersPage)
155
flickable: printerList
161
anchors { fill: parent }
162
model: Printers.allPrintersWithPdf
164
height: modelLayout.height + (divider.visible ? divider.height : 0)
167
title.text: displayName
168
title.font.bold: model.default
169
subtitle.text: description
174
height: units.gu(2.5)
175
name: "printer-symbolic"
176
SlotsLayout.position: SlotsLayout.First
181
onClicked: pageStack.push(printerPage, { printer: model })
182
Component.onCompleted: console.log("printer", model.name)