Changeset View
Changeset View
Standalone View
Standalone View
applets/notifications/package/contents/ui/JobDetails.qml
Show All 40 Lines | 31 | GridLayout { | |||
---|---|---|---|---|---|
41 | Repeater { | 41 | Repeater { | ||
42 | model: [1, 2] | 42 | model: [1, 2] | ||
43 | 43 | | |||
44 | PlasmaExtras.DescriptiveLabel { | 44 | PlasmaExtras.DescriptiveLabel { | ||
45 | Layout.column: 0 | 45 | Layout.column: 0 | ||
46 | Layout.row: index | 46 | Layout.row: index | ||
47 | Layout.alignment: Qt.AlignTop | Qt.AlignRight | 47 | Layout.alignment: Qt.AlignTop | Qt.AlignRight | ||
48 | text: jobDetails["descriptionLabel" + modelData] && jobDetails["descriptionValue" + modelData] | 48 | text: jobDetails["descriptionLabel" + modelData] && jobDetails["descriptionValue" + modelData] | ||
49 | ? i18nc("Row description, e.g. Source", "%1:", jobDetails["descriptionLabel" + modelData]) : "" | 49 | ? i18ndc("plasma_applet_org.kde.plasma.notifications", "Row description, e.g. Source", "%1:", jobDetails["descriptionLabel" + modelData]) : "" | ||
50 | font: theme.smallestFont | 50 | font: theme.smallestFont | ||
51 | textFormat: Text.PlainText | 51 | textFormat: Text.PlainText | ||
52 | visible: text !== "" | 52 | visible: text !== "" | ||
53 | } | 53 | } | ||
54 | } | 54 | } | ||
55 | 55 | | |||
56 | Repeater { | 56 | Repeater { | ||
57 | model: [1, 2] | 57 | model: [1, 2] | ||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | 101 | PlasmaExtras.DescriptiveLabel { | |||
105 | text: { | 105 | text: { | ||
106 | var processed = jobDetails["processed" + modelData]; | 106 | var processed = jobDetails["processed" + modelData]; | ||
107 | var total = jobDetails["total" + modelData]; | 107 | var total = jobDetails["total" + modelData]; | ||
108 | 108 | | |||
109 | if (processed > 0 || total > 1) { | 109 | if (processed > 0 || total > 1) { | ||
110 | if (processed > 0 && total > 0 && processed <= total) { | 110 | if (processed > 0 && total > 0 && processed <= total) { | ||
111 | switch(modelData) { | 111 | switch(modelData) { | ||
112 | case "Bytes": | 112 | case "Bytes": | ||
113 | return i18nc("How many bytes have been copied", "%2 of %1", | 113 | return i18ndc("plasma_applet_org.kde.plasma.notifications", "How many bytes have been copied", "%2 of %1", | ||
114 | KCoreAddons.Format.formatByteSize(total), | 114 | KCoreAddons.Format.formatByteSize(total), | ||
115 | KCoreAddons.Format.formatByteSize(processed)) | 115 | KCoreAddons.Format.formatByteSize(processed)) | ||
116 | case "Files": | 116 | case "Files": | ||
117 | return i18ncp("How many files have been copied", "%2 of %1 file", "%2 of %1 files", | 117 | return i18ndcp("plasma_applet_org.kde.plasma.notifications", "How many files have been copied", "%2 of %1 file", "%2 of %1 files", | ||
118 | total, processed); | 118 | total, processed); | ||
119 | case "Directories": | 119 | case "Directories": | ||
120 | return i18ncp("How many dirs have been copied", "%2 of %1 folder", "%2 of %1 folders", | 120 | return i18ndcp("plasma_applet_org.kde.plasma.notifications", "How many dirs have been copied", "%2 of %1 folder", "%2 of %1 folders", | ||
121 | total, processed); | 121 | total, processed); | ||
122 | } | 122 | } | ||
123 | } else { | 123 | } else { | ||
124 | switch(modelData) { | 124 | switch(modelData) { | ||
125 | case "Bytes": | 125 | case "Bytes": | ||
126 | return KCoreAddons.Format.formatByteSize(processed || total) | 126 | return KCoreAddons.Format.formatByteSize(processed || total) | ||
127 | case "Files": | 127 | case "Files": | ||
128 | return i18np("%1 file", "%1 files", (processed || total)); | 128 | return i18ndp("plasma_applet_org.kde.plasma.notifications", "%1 file", "%1 files", (processed || total)); | ||
129 | case "Directories": | 129 | case "Directories": | ||
130 | return i18np("%1 folder", "%1 folders", (processed || total)); | 130 | return i18ndp("plasma_applet_org.kde.plasma.notifications", "%1 folder", "%1 folders", (processed || total)); | ||
131 | } | 131 | } | ||
132 | } | 132 | } | ||
133 | } | 133 | } | ||
134 | 134 | | |||
135 | return ""; | 135 | return ""; | ||
136 | } | 136 | } | ||
137 | font: theme.smallestFont | 137 | font: theme.smallestFont | ||
138 | textFormat: Text.PlainText | 138 | textFormat: Text.PlainText | ||
139 | visible: text !== "" | 139 | visible: text !== "" | ||
140 | } | 140 | } | ||
141 | } | 141 | } | ||
142 | 142 | | |||
143 | PlasmaExtras.DescriptiveLabel { | 143 | PlasmaExtras.DescriptiveLabel { | ||
144 | Layout.column: 1 | 144 | Layout.column: 1 | ||
145 | Layout.row: 2 + 3 | 145 | Layout.row: 2 + 3 | ||
146 | Layout.fillWidth: true | 146 | Layout.fillWidth: true | ||
147 | text: jobDetails.speed > 0 ? i18nc("Bytes per second", "%1/s", | 147 | text: jobDetails.speed > 0 ? i18ndc("plasma_applet_org.kde.plasma.notifications", "Bytes per second", "%1/s", | ||
148 | KCoreAddons.Format.formatByteSize(jobDetails.speed)) : "" | 148 | KCoreAddons.Format.formatByteSize(jobDetails.speed)) : "" | ||
149 | font: theme.smallestFont | 149 | font: theme.smallestFont | ||
150 | textFormat: Text.PlainText | 150 | textFormat: Text.PlainText | ||
151 | visible: text !== "" | 151 | visible: text !== "" | ||
152 | } | 152 | } | ||
153 | } | 153 | } |