Skip to content

Commit ab3a606

Browse files
authored
PathViewCore: add autoPreview property (#287)
1 parent 4e27a5f commit ab3a606

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/pathview/PathViewCore.qml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ import Machinekit.PathView 1.0
2626
import Machinekit.Application 1.0
2727

2828
ApplicationItem {
29+
/*! If this property is set to \c{true}, the preview loads automatically when
30+
the remote program is changed.
31+
In some cases it might be preferred to update the preview manually, this can
32+
be done using the \l updatePreview function.
33+
34+
The default value is \c{true}.
35+
*/
36+
property bool autoPreview: true
37+
2938
property alias gcodeProgramModel: gcodeProgramModel
3039
property alias gcodeProgramLoader: gcodeProgramLoader
3140
property alias previewClient: previewClient
@@ -87,7 +96,8 @@ ApplicationItem {
8796
if (previewEnabled
8897
&& (file.remoteFilePath !== "")
8998
&& (file.localFilePath !== "")
90-
&& (file.transferState === ApplicationFile.NoTransfer))
99+
&& (file.transferState === ApplicationFile.NoTransfer)
100+
&& autoPreview)
91101
{
92102
executePreview();
93103
}
@@ -96,7 +106,7 @@ ApplicationItem {
96106
function reloadModelAndPreview() {
97107
gcodeProgramModel.clear();
98108
gcodeProgramLoader.load();
99-
if (previewEnabled) {
109+
if (previewEnabled && autoPreview) {
100110
executePreview();
101111
}
102112
}

0 commit comments

Comments
 (0)