mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-30 15:25:14 +08:00
Add a dialog that shows the engine log
This commit is contained in:
parent
52d4424635
commit
1118219f7d
@ -239,6 +239,15 @@ class PrinterApplication(QtApplication):
|
|||||||
job.finished.connect(lambda j: node.setMeshData(j.getResult()))
|
job.finished.connect(lambda j: node.setMeshData(j.getResult()))
|
||||||
job.start()
|
job.start()
|
||||||
|
|
||||||
|
@pyqtSlot(result=str)
|
||||||
|
def getEngineLog(self):
|
||||||
|
log = ""
|
||||||
|
|
||||||
|
for entry in self.getBackend().getLog():
|
||||||
|
log += entry.decode()
|
||||||
|
|
||||||
|
return log
|
||||||
|
|
||||||
def _onActiveMachineChanged(self):
|
def _onActiveMachineChanged(self):
|
||||||
machine = self.getActiveMachine()
|
machine = self.getActiveMachine()
|
||||||
if machine:
|
if machine:
|
||||||
|
41
qml/EngineLog.qml
Normal file
41
qml/EngineLog.qml
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import QtQuick 2.2
|
||||||
|
import QtQuick.Dialogs 1.2
|
||||||
|
import QtQuick.Controls 1.2
|
||||||
|
import QtQuick.Layouts 1.1
|
||||||
|
|
||||||
|
Dialog {
|
||||||
|
id: dialog
|
||||||
|
|
||||||
|
title: qsTr("Cura Engine Log");
|
||||||
|
|
||||||
|
standardButtons: StandardButton.Close;
|
||||||
|
modality: Qt.NonModal;
|
||||||
|
|
||||||
|
width: 640;
|
||||||
|
|
||||||
|
TextArea {
|
||||||
|
id: textArea
|
||||||
|
|
||||||
|
anchors.left: parent.left;
|
||||||
|
anchors.right: parent.right;
|
||||||
|
|
||||||
|
implicitHeight: 480;
|
||||||
|
}
|
||||||
|
|
||||||
|
onVisibleChanged: {
|
||||||
|
if(visible) {
|
||||||
|
textArea.text = Printer.getEngineLog();
|
||||||
|
updateTimer.start();
|
||||||
|
} else {
|
||||||
|
updateTimer.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: updateTimer;
|
||||||
|
interval: 1000;
|
||||||
|
running: false;
|
||||||
|
repeat: true;
|
||||||
|
onTriggered: textArea.text = Printer.getEngineLog();
|
||||||
|
}
|
||||||
|
}
|
@ -116,6 +116,7 @@ UM.MainWindow {
|
|||||||
//: Help menu
|
//: Help menu
|
||||||
title: qsTr("&Help");
|
title: qsTr("&Help");
|
||||||
|
|
||||||
|
MenuItem { action: actions.showEngineLog; }
|
||||||
MenuItem { action: actions.documentation; }
|
MenuItem { action: actions.documentation; }
|
||||||
MenuItem { action: actions.reportBug; }
|
MenuItem { action: actions.reportBug; }
|
||||||
MenuSeparator { }
|
MenuSeparator { }
|
||||||
@ -300,6 +301,7 @@ UM.MainWindow {
|
|||||||
|
|
||||||
documentation.onTriggered: Qt.openUrlExternally("https://ultimaker.com/en/support");
|
documentation.onTriggered: Qt.openUrlExternally("https://ultimaker.com/en/support");
|
||||||
reportBug.onTriggered: Qt.openUrlExternally("https://github.com/Ultimaker/PluggableCura/issues");
|
reportBug.onTriggered: Qt.openUrlExternally("https://github.com/Ultimaker/PluggableCura/issues");
|
||||||
|
showEngineLog.onTriggered: engineLog.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
Menu {
|
Menu {
|
||||||
@ -372,6 +374,10 @@ UM.MainWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EngineLog {
|
||||||
|
id: engineLog;
|
||||||
|
}
|
||||||
|
|
||||||
AddMachineWizard {
|
AddMachineWizard {
|
||||||
id: addMachine;
|
id: addMachine;
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,8 @@ Item {
|
|||||||
property alias configureMachines: settingsAction;
|
property alias configureMachines: settingsAction;
|
||||||
|
|
||||||
property alias preferences: preferencesAction;
|
property alias preferences: preferencesAction;
|
||||||
|
|
||||||
|
property alias showEngineLog: showEngineLogAction;
|
||||||
property alias documentation: documentationAction;
|
property alias documentation: documentationAction;
|
||||||
property alias reportBug: reportBugAction;
|
property alias reportBug: reportBugAction;
|
||||||
property alias about: aboutAction;
|
property alias about: aboutAction;
|
||||||
@ -169,4 +171,11 @@ Item {
|
|||||||
iconName: "document-save";
|
iconName: "document-save";
|
||||||
shortcut: StandardKey.Save;
|
shortcut: StandardKey.Save;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Action {
|
||||||
|
id: showEngineLogAction;
|
||||||
|
//: Show engine log action
|
||||||
|
text: qsTr("Show engine log...");
|
||||||
|
iconName: "view-list-text";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user