EngineLog.qml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Copyright (c) 2015 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.2
  4. import QtQuick.Controls 1.1
  5. import QtQuick.Layouts 1.1
  6. import UM 1.1 as UM
  7. UM.Dialog
  8. {
  9. id: dialog;
  10. //: Engine Log dialog title
  11. title: catalog.i18nc("@title:window","Engine Log");
  12. modality: Qt.NonModal;
  13. TextArea
  14. {
  15. id: textArea
  16. anchors.fill: parent;
  17. Timer
  18. {
  19. id: updateTimer;
  20. interval: 1000;
  21. running: false;
  22. repeat: true;
  23. onTriggered: textArea.text = CuraApplication.getEngineLog();
  24. }
  25. UM.I18nCatalog{id: catalog; name:"cura"}
  26. }
  27. rightButtons: Button
  28. {
  29. //: Close engine log button
  30. text: catalog.i18nc("@action:button","Close");
  31. onClicked: dialog.visible = false;
  32. }
  33. onVisibleChanged:
  34. {
  35. if(visible)
  36. {
  37. textArea.text = CuraApplication.getEngineLog();
  38. updateTimer.start();
  39. } else
  40. {
  41. updateTimer.stop();
  42. }
  43. }
  44. }