Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/pathview/PathViewCore.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ import Machinekit.PathView 1.0
import Machinekit.Application 1.0

ApplicationItem {
/*! If this property is set to \c{true}, the preview loads automatically when
the remote program is changed.
In some cases it might be preferred to update the preview manually, this can
be done using the \l updatePreview function.

The default value is \c{true}.
*/
property bool autoPreview: true

property alias gcodeProgramModel: gcodeProgramModel
property alias gcodeProgramLoader: gcodeProgramLoader
property alias previewClient: previewClient
Expand Down Expand Up @@ -87,7 +96,8 @@ ApplicationItem {
if (previewEnabled
&& (file.remoteFilePath !== "")
&& (file.localFilePath !== "")
&& (file.transferState === ApplicationFile.NoTransfer))
&& (file.transferState === ApplicationFile.NoTransfer)
&& autoPreview)
{
executePreview();
}
Expand All @@ -96,7 +106,7 @@ ApplicationItem {
function reloadModelAndPreview() {
gcodeProgramModel.clear();
gcodeProgramLoader.load();
if (previewEnabled) {
if (previewEnabled && autoPreview) {
executePreview();
}
}
Expand Down