Changeset View
Changeset View
Standalone View
Standalone View
plasmoid/package/contents/ui/printmanager.qml
Show All 31 Lines | 27 | Item { | |||
---|---|---|---|---|---|
32 | 32 | | |||
33 | property alias serverUnavailable: printersModel.serverUnavailable | 33 | property alias serverUnavailable: printersModel.serverUnavailable | ||
34 | property string printersModelError: "" | 34 | property string printersModelError: "" | ||
35 | 35 | | |||
36 | readonly property string kcmName: "kcm_printer_manager" | 36 | readonly property string kcmName: "kcm_printer_manager" | ||
37 | readonly property bool kcmAllowed: KCMShell.authorize(kcmName + ".desktop").length > 0 | 37 | readonly property bool kcmAllowed: KCMShell.authorize(kcmName + ".desktop").length > 0 | ||
38 | 38 | | |||
39 | Plasmoid.toolTipMainText: i18n("Printers") | 39 | Plasmoid.toolTipMainText: i18n("Printers") | ||
40 | Plasmoid.toolTipSubText: activeJobsFilterModel.activeCount ? i18np("There is one print job in the queue", | 40 | Plasmoid.toolTipSubText: { | ||
41 | if (serverUnavailable && printersModelError) { | ||||
42 | return printersModelError; | ||||
43 | } else if (activeJobsFilterModel.activeCount > 1) { | ||||
44 | return i18np("There is one print job in the queue", | ||||
41 | "There are %1 print jobs in the queue", | 45 | "There are %1 print jobs in the queue", | ||
42 | activeJobsFilterModel.activeCount) | 46 | activeJobsFilterModel.activeCount); | ||
43 | : i18n("Print queue is empty") | 47 | // If there is only one job, show more information about it | ||
48 | } else if (activeJobsFilterModel.activeCount === 1) { | ||||
49 | var idx = activeJobsFilterModel.index(0, 0); | ||||
50 | var jobName = activeJobsFilterModel.data(idx, PrintManager.JobModel.RoleJobName); | ||||
51 | var printerName = activeJobsFilterModel.data(idx, PrintManager.JobModel.RoleJobPrinter); | ||||
52 | if (jobName) { | ||||
53 | return i18nc("Printing document name with printer name", "Printing %1 with %2", jobName, printerName); | ||||
ngraham: "on" -> "with" or "using" | |||||
54 | } else { | ||||
55 | return i18nc("Printing with printer name", "Printing with %1", printerName); | ||||
ngraham: "on" -> "with" or "using" | |||||
56 | } | ||||
57 | } else if (printersModel.count > 0) { | ||||
58 | return i18n("Print queue is empty"); | ||||
59 | } else { | ||||
60 | return i18n("No printers have been configured or discovered"); | ||||
61 | } | ||||
62 | } | ||||
44 | Plasmoid.icon: "printer" | 63 | Plasmoid.icon: "printer" | ||
45 | Plasmoid.fullRepresentation: PopupDialog { | 64 | Plasmoid.fullRepresentation: PopupDialog { | ||
46 | id: dialogItem | 65 | id: dialogItem | ||
47 | 66 | | |||
48 | anchors.fill: parent | 67 | anchors.fill: parent | ||
49 | focus: true | 68 | focus: true | ||
50 | } | 69 | } | ||
51 | 70 | | |||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |
"on" -> "with" or "using"