Use UM Dialog for EngineLog dialog

This commit is contained in:
Arjen Hiemstra 2015-04-29 17:39:09 +02:00
parent 5917596ad7
commit 2b2c624e4e

View File

@ -1,56 +1,35 @@
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Window 2.1
import QtQuick.Controls 1.1 import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import UM 1.0 as UM import UM 1.0 as UM
Window { UM.Dialog {
id: dialog id: dialog;
title: qsTr("Cura Engine Log"); //: Engine Log dialog title
title: qsTr("Engine Log");
modality: Qt.NonModal; modality: Qt.NonModal;
flags: Qt.Dialog;
width: 640; TextArea {
height: 480; id: textArea
Rectangle {
anchors.fill: parent; anchors.fill: parent;
color: UM.Theme.colors.system_window;
ColumnLayout { Timer {
anchors.fill: parent; id: updateTimer;
anchors.margins: UM.Theme.sizes.default_margin.width; interval: 1000;
running: false;
TextArea { repeat: true;
id: textArea onTriggered: textArea.text = Printer.getEngineLog();
Layout.fillWidth: true
Layout.fillHeight: true
}
Timer {
id: updateTimer;
interval: 1000;
running: false;
repeat: true;
onTriggered: textArea.text = Printer.getEngineLog();
}
RowLayout {
Item {
Layout.fillWidth: true;
}
Button {
text: qsTr("Close");
onClicked: dialog.visible = false;
}
}
} }
} }
rightButtons: Button {
text: qsTr("Close");
onClicked: dialog.visible = false;
}
onVisibleChanged: { onVisibleChanged: {
if(visible) { if(visible) {
textArea.text = Printer.getEngineLog(); textArea.text = Printer.getEngineLog();