Typica is a free program for professional coffee roasters. https://typica.us
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

editbatchdetails.xml 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <window id="editBatchDetails">
  2. <layout type="vertical">
  3. <button type="check" name="Approved" id="approval" />
  4. <layout type="horizontal">
  5. <label>Annotation</label>
  6. <textarea id="annotation" />
  7. </layout>
  8. <button type="push" id="submit" name="Submit" />
  9. </layout>
  10. <program>
  11. <![CDATA[
  12. var window = this;
  13. var approvalButton = findChildObject(this, 'approval');
  14. var annotationField = findChildObject(this, 'annotation');
  15. var parentWindow;
  16. var tableReference;
  17. var rowReference;
  18. var timeKey;
  19. var machineKey;
  20. var submit = findChildObject(this, 'submit');
  21. submit.enabled = false;
  22. this.loadData = function(parent, table, row, time, machine, approval, annotation) {
  23. parentWindow = parent;
  24. tableReference = table;
  25. rowReference = row;
  26. if(approval == "true") {
  27. approvalButton.checked = true;
  28. }
  29. annotationField.plainText = annotation;
  30. timeKey = time;
  31. machineKey = machine;
  32. submit.enabled = true;
  33. };
  34. submit.clicked.connect(function() {
  35. var query = new QSqlQuery;
  36. query.prepare("UPDATE roasting_log SET approval = :approval, annotation = :annotation WHERE time = :time AND machine = :machine");
  37. query.bind("approval", approvalButton.checked);
  38. query.bind("annotation", annotationField.plainText);
  39. query.bind("time", timeKey);
  40. query.bind("machine", machineKey);
  41. query.exec();
  42. parentWindow.loadData(tableReference, rowReference);
  43. window.close();
  44. });
  45. ]]>
  46. </program>
  47. </window>