diff --git a/src/Mod/Path/Gui/Resources/panels/PathEdit.ui b/src/Mod/Path/Gui/Resources/panels/PathEdit.ui index e94d6ebca8..2f8f0708d9 100644 --- a/src/Mod/Path/Gui/Resources/panels/PathEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/PathEdit.ui @@ -14,7 +14,7 @@ Job Edit - 1 + 2 @@ -24,15 +24,15 @@ - 1 + 0 - + 0 0 - 242 - 129 + 378 + 793 @@ -81,122 +81,65 @@ - - - - 0 - 0 - 294 - 309 - - + - Template + Post Processing - - - - - General - - - true - - - - - - Material - - - true - - - - - - - - - - Setup - - - true - - - - - - Stock - - - true - - - - - - - Post Processor - - - true - - - - - - - - - - Tools - - - true - - - - - - - - Operations - - - true - - - - - - Default Values - - - true - - - - - - - - - - QDialogButtonBox::Save + + + + + Output File - - + + + + <html><head/><body><p>Enter a path and optionally file name (see below) to be used as the default for the post processor export.</p><p>The following substitutions are performed before the name is resolved at the time of the post processing:</p><p>%D ... directory of the active document<br/>%d ... name of the active document (with extension)<br/>%M ... user macro directory<br/>%j ... name of the active Job object</p><p>The following example store all files with the same name as the document the directory /home/freecad (please remove quotes):</p><p>&quot;/home/cnc/%d.g-code&quot;</p><p>See the file save policy below on how to deal with name conflicts.</p></body></html> + + + + + + + ... + + + + + + + Processor + + + + + + + + + + Arguments + + + + + + + <html><head/><body><p>Optional arguments passed to the Post Processor. The arguments are specific for each Post Processor, please see it's documentation for details.</p></body></html> + + + + + Qt::Vertical 20 - 40 + 655 @@ -220,13 +163,13 @@ 0 - + 0 0 378 - 719 + 830 @@ -490,150 +433,27 @@ - - - - 0 - 0 - 233 - 135 - - - - Post Processor - - - - - - - - - Processor - - - - - - - Output File - - - - - - - <html><head/><body><p>Enter a path and optionally file name (see below) to be used as the default for the post processor export.</p><p>The following substitutions are performed before the name is resolved at the time of the post processing:</p><p>%D ... directory of the active document<br/>%d ... name of the active document (with extension)<br/>%M ... user macro directory<br/>%j ... name of the active Job object</p><p>The following example store all files with the same name as the document the directory /home/freecad (please remove quotes):</p><p>&quot;/home/cnc/%d.g-code&quot;</p><p>See the file save policy below on how to deal with name conflicts.</p></body></html> - - - - - - - <html><head/><body><p>Optional arguments passed to the Post Processor. The arguments are specific for each Post Processor, please see it's documentation for details.</p></body></html> - - - - - - - Arguments - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - ... - - - - - - - - - 0 - 0 - 142 - 41 - - - - Fixtures - - - - - - false - - - Coming Soon - - - - - - - - - 0 - 0 - 142 - 41 - - - - Vise - - - - - - false - - - Coming Soon - - - - - - + Tools - + 0 - + 0 0 - 312 - 159 + 378 + 830 @@ -721,23 +541,23 @@ - + Workplan - + 0 - + 0 0 - 255 - 234 + 378 + 793 @@ -773,6 +593,61 @@ + + + + + 0 + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + ... + + + + + + + + + + ... + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + @@ -781,14 +656,24 @@ - - false - Edit + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -801,13 +686,13 @@ - + 0 0 395 - 430 + 778 @@ -1003,19 +888,6 @@ moveToOrigin centerInStock centerInStockXY - postProcessorOutputFile - postProcessorSetOutputFile - postProcessor - postProcessorArguments - templateDefaultValues - templatePostProcessor - buttonBox - templateGeneral - templateMaterial - templateSetup - templateStock - templateOperations - templateTools toolControllerList toolControllerEdit toolControllerAdd diff --git a/src/Mod/Path/PathScripts/PathJobGui.py b/src/Mod/Path/PathScripts/PathJobGui.py index 9d152feb0a..5ac672b090 100644 --- a/src/Mod/Path/PathScripts/PathJobGui.py +++ b/src/Mod/Path/PathScripts/PathJobGui.py @@ -565,8 +565,13 @@ class TaskPanel: def operationSelect(self): if self.form.operationsList.selectedItems(): self.form.operationModify.setEnabled(True) + self.form.operationMove.setEnabled(True) + row = self.form.operationsList.currentRow() + self.form.operationUp.setEnabled(row > 0) + self.form.operationDown.setEnabled(row < self.form.operationsList.count() - 1) else: self.form.operationModify.setEnabled(False) + self.form.operationMove.setEnabled(False) def objectDelete(self, widget): for item in widget.selectedItems(): @@ -579,6 +584,22 @@ class TaskPanel: def operationDelete(self): self.objectDelete(self.form.operationsList) + def operationMoveUp(self): + row = self.form.operationsList.currentRow() + if row > 0: + item = self.form.operationsList.takeItem(row) + self.form.operationsList.insertItem(row-1, item) + self.form.operationsList.setCurrentRow(row-1) + self.getFields() + + def operationMoveDown(self): + row = self.form.operationsList.currentRow() + if row < self.form.operationsList.count() - 1: + item = self.form.operationsList.takeItem(row) + self.form.operationsList.insertItem(row+1, item) + self.form.operationsList.setCurrentRow(row+1) + self.getFields() + def toolControllerSelect(self): def canDeleteTC(tc): # if the TC is referenced anywhere but the job we don't want to delete it @@ -828,10 +849,15 @@ class TaskPanel: self.form.postProcessorOutputFile.editingFinished.connect(self.getFields) self.form.postProcessorSetOutputFile.clicked.connect(self.setPostProcessorOutputFile) + # Workplan self.form.operationsList.itemSelectionChanged.connect(self.operationSelect) self.form.operationsList.indexesMoved.connect(self.getFields) self.form.operationDelete.clicked.connect(self.operationDelete) + self.form.operationUp.clicked.connect(self.operationMoveUp) + self.form.operationDown.clicked.connect(self.operationMoveDown) + self.form.operationEdit.hide() # not supported yet + # Tool controller self.form.toolControllerList.itemSelectionChanged.connect(self.toolControllerSelect) self.form.toolControllerList.itemChanged.connect(self.toolControllerChanged) self.form.toolControllerEdit.clicked.connect(self.toolControllerEdit)