|
@@ -9,8 +9,8 @@
|
9
|
9
|
<webview id="view" />
|
10
|
10
|
</layout>
|
11
|
11
|
<menu name="File">
|
12
|
|
- <item id="save" shortcut="Ctrl+S">Save…</item>
|
13
|
|
- <item id="print" shortcut="Ctrl+P">Print…</item>
|
|
12
|
+ <item id="save" shortcut="Ctrl+S">Save...</item>
|
|
13
|
+ <item id="print" shortcut="Ctrl+P">Print...</item>
|
14
|
14
|
</menu>
|
15
|
15
|
<program>
|
16
|
16
|
<![CDATA[
|
|
@@ -21,7 +21,8 @@
|
21
|
21
|
{
|
22
|
22
|
conversion = 2.2;
|
23
|
23
|
}
|
24
|
|
- var unitText = (unit == 0 ? "Kg" : "Lb");
|
|
24
|
+ var unitText = (unit == 0 ? TTR("batchDetails", "Kg") :
|
|
25
|
+ TTR("batchDetails", "Lb"));
|
25
|
26
|
dataView = findChildObject(this, 'view');
|
26
|
27
|
var printMenu = findChildObject(this, 'print');
|
27
|
28
|
printMenu.triggered.connect(function() {
|
|
@@ -109,7 +110,7 @@
|
109
|
110
|
Windows.loggingWindow.raise();
|
110
|
111
|
Windows.loggingWindow.activateWindow();
|
111
|
112
|
input.input();
|
112
|
|
- log.newAnnotation("End", 1, lc);
|
|
113
|
+ log.newAnnotation(TTR("batchDetails", "End"), 1, lc);
|
113
|
114
|
query = query.invalidate();
|
114
|
115
|
});
|
115
|
116
|
var viewbutton = findChildObject(this, 'viewprofile');
|
|
@@ -159,9 +160,6 @@
|
159
|
160
|
graph.updatesEnabled = true;
|
160
|
161
|
log.newAnnotation("End", 1, lc);
|
161
|
162
|
}
|
162
|
|
- else {
|
163
|
|
- print("Query returned no results");
|
164
|
|
- }
|
165
|
163
|
query = query.invalidate();
|
166
|
164
|
});
|
167
|
165
|
window.loadData = function(table, row) {
|
|
@@ -175,25 +173,25 @@
|
175
|
173
|
output.writeStartElement("html");
|
176
|
174
|
output.writeAttribute("xmlns", "http://www.w3.org/1999/xhtml");
|
177
|
175
|
output.writeStartElement("head");
|
178
|
|
- output.writeTextElement("title", "Batch Details");
|
|
176
|
+ output.writeTextElement("title", TTR("batchDetails", "Batch Details"));
|
179
|
177
|
output.writeEndElement();
|
180
|
178
|
output.writeStartElement("body");
|
181
|
179
|
output.writeStartElement("div");
|
182
|
180
|
output.writeAttribute("style", "float: left; padding-right: 10px");
|
183
|
181
|
output.writeStartElement("p");
|
184
|
|
- output.writeTextElement("strong", "Roasted Coffee: ");
|
|
182
|
+ output.writeTextElement("strong", TTR("batchDetails", "Roasted Coffee: "));
|
185
|
183
|
output.writeTextElement("span", table.data(row, 2));
|
186
|
184
|
output.writeEndElement();
|
187
|
185
|
output.writeEndElement();
|
188
|
186
|
output.writeStartElement("div");
|
189
|
187
|
output.writeAttribute("style", "float: left");
|
190
|
188
|
output.writeStartElement("p");
|
191
|
|
- output.writeTextElement("strong", "Roasted On: ");
|
|
189
|
+ output.writeTextElement("strong", TTR("batchDetails", "Roasted On: "));
|
192
|
190
|
batchTime = table.data(row, 0);
|
193
|
191
|
output.writeTextElement("span", batchTime);
|
194
|
192
|
output.writeEndElement();
|
195
|
193
|
output.writeStartElement("p");
|
196
|
|
- output.writeTextElement("strong", "Batch Duration: ");
|
|
194
|
+ output.writeTextElement("strong", TTR("batchDetails", "Batch Duration: "));
|
197
|
195
|
output.writeTextElement("span", table.data(row, 6));
|
198
|
196
|
output.writeEndElement();
|
199
|
197
|
output.writeEndElement();
|
|
@@ -203,8 +201,8 @@
|
203
|
201
|
output.writeStartElement("table");
|
204
|
202
|
output.writeStartElement("thead");
|
205
|
203
|
output.writeStartElement("tr");
|
206
|
|
- output.writeTextElement("th", "Green Coffee");
|
207
|
|
- output.writeTextElement("th", "Weight (" + unitText + ")");
|
|
204
|
+ output.writeTextElement("th", TTR("batchDetails", "Green Coffee"));
|
|
205
|
+ output.writeTextElement("th", TTR("batchDetails", "Weight (") + unitText + ")");
|
208
|
206
|
output.writeEndElement();
|
209
|
207
|
output.writeEndElement();
|
210
|
208
|
output.writeStartElement("tbody");
|
|
@@ -241,7 +239,7 @@
|
241
|
239
|
output.writeStartElement("tr");
|
242
|
240
|
output.writeStartElement("td");
|
243
|
241
|
output.writeAttribute("align", "right");
|
244
|
|
- output.writeTextElement("strong", "Green Total:");
|
|
242
|
+ output.writeTextElement("strong", TTR("batchDetails", "Green Total:"));
|
245
|
243
|
output.writeEndElement();
|
246
|
244
|
output.writeStartElement("td");
|
247
|
245
|
output.writeAttribute("align", "center");
|
|
@@ -251,7 +249,7 @@
|
251
|
249
|
output.writeStartElement("tr");
|
252
|
250
|
output.writeStartElement("td");
|
253
|
251
|
output.writeAttribute("align", "right");
|
254
|
|
- output.writeTextElement("strong", "Roasted Weight:");
|
|
252
|
+ output.writeTextElement("strong", TTR("batchDetails", "Roasted Weight:"));
|
255
|
253
|
output.writeEndElement();
|
256
|
254
|
output.writeStartElement("td");
|
257
|
255
|
output.writeAttribute("align", "center");
|
|
@@ -262,7 +260,7 @@
|
262
|
260
|
output.writeStartElement("tr");
|
263
|
261
|
output.writeStartElement("td");
|
264
|
262
|
output.writeAttribute("align", "right");
|
265
|
|
- output.writeTextElement("strong", "Weight Loss:");
|
|
263
|
+ output.writeTextElement("strong", TTR("batchDetails", "Weight Loss:"));
|
266
|
264
|
output.writeEndElement();
|
267
|
265
|
output.writeStartElement("td");
|
268
|
266
|
output.writeAttribute("align", "center");
|
|
@@ -273,15 +271,15 @@
|
273
|
271
|
output.writeEndElement();
|
274
|
272
|
output.writeEndElement();
|
275
|
273
|
output.writeStartElement("p");
|
276
|
|
- output.writeTextElement("strong", "Approved: ");
|
|
274
|
+ output.writeTextElement("strong", TTR("batchDetails", "Approved: "));
|
277
|
275
|
output.writeCharacters(approval);
|
278
|
276
|
output.writeEndElement();
|
279
|
277
|
output.writeStartElement("p");
|
280
|
|
- output.writeTextElement("strong", "Files: ");
|
|
278
|
+ output.writeTextElement("strong", TTR("batchDetails", "Files: "));
|
281
|
279
|
output.writeCharacters(query.value(3));
|
282
|
280
|
output.writeEndElement();
|
283
|
281
|
output.writeStartElement("p");
|
284
|
|
- output.writeTextElement("strong", "Annotations:");
|
|
282
|
+ output.writeTextElement("strong", TTR("batchDetails", "Annotations:"));
|
285
|
283
|
var files = sqlToArray(query.value(3));
|
286
|
284
|
var annotations = annotationFromRecord(files[0]);
|
287
|
285
|
fileID = files[0];
|
|
@@ -293,12 +291,12 @@
|
293
|
291
|
var result = colQuery.exec();
|
294
|
292
|
buffer2.close();
|
295
|
293
|
var seriesHeaders = new Array();
|
296
|
|
- seriesHeaders.push("Time");
|
|
294
|
+ seriesHeaders.push(TTR("batchDetails", "Time"));
|
297
|
295
|
var records = result.split(";");
|
298
|
296
|
for(var i = 0; i < records.length - 1; i++) {
|
299
|
297
|
seriesHeaders.push(records[i].replace(/^\s+|\s+$/g,""));
|
300
|
298
|
}
|
301
|
|
- seriesHeaders.push("Note");
|
|
299
|
+ seriesHeaders.push(TTR("batchDetails", "Note"));
|
302
|
300
|
output.writeStartElement("table");
|
303
|
301
|
output.writeStartElement("thead");
|
304
|
302
|
output.writeStartElement("tr");
|
|
@@ -352,7 +350,7 @@
|
352
|
350
|
};
|
353
|
351
|
var saveMenu = findChildObject(this, 'save');
|
354
|
352
|
saveMenu.triggered.connect(function() {
|
355
|
|
- var filename = QFileDialog.getSaveFileName(window, "Save Log As…", QSettings.value("script/lastDir", "") + "/");
|
|
353
|
+ var filename = QFileDialog.getSaveFileName(window, TTR("batchDetails", "Save Log As..."), QSettings.value("script/lastDir", "") + "/");
|
356
|
354
|
if(filename != "") {
|
357
|
355
|
saveFileFromDatabase(fileID, filename);
|
358
|
356
|
}
|