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