diff --git a/src/Mod/Path/Gui/Resources/Path.qrc b/src/Mod/Path/Gui/Resources/Path.qrc
index 1cef2e5a8e..71d2d0cfa3 100644
--- a/src/Mod/Path/Gui/Resources/Path.qrc
+++ b/src/Mod/Path/Gui/Resources/Path.qrc
@@ -96,8 +96,8 @@
panels/PageOpDeburrEdit.ui
panels/PageOpDrillingEdit.ui
panels/PageOpEngraveEdit.ui
- panels/PageOpExtensionEdit.ui
panels/PageOpHelixEdit.ui
+ panels/PageOpPocketExtEdit.ui
panels/PageOpPocketFullEdit.ui
panels/PageOpProfileFullEdit.ui
panels/PageOpSurfaceEdit.ui
diff --git a/src/Mod/Path/Gui/Resources/panels/PageOpExtensionEdit.ui b/src/Mod/Path/Gui/Resources/panels/PageOpExtensionEdit.ui
deleted file mode 100644
index 65e7a18e7c..0000000000
--- a/src/Mod/Path/Gui/Resources/panels/PageOpExtensionEdit.ui
+++ /dev/null
@@ -1,335 +0,0 @@
-
-
- Form
-
-
-
- 0
- 0
- 324
- 550
-
-
-
- Form
-
-
- -
-
-
- Negative X
-
-
-
-
-
-
-
-
-
- :/icons/button_left.svg
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- <html><head/><body><p>Size of extension for each edge.</p></body></html>
-
-
-
- -
-
-
- <html><head/><body><p>List of edges to be extended.</p></body></html>
-
-
-
- -
-
-
-
-
-
-
- <html><head/><body><p>Add selected edge from 3d view to list.</p></body></html>
-
-
-
-
-
-
- :/icons/list-add.svg:/icons/list-add.svg
-
-
-
- -
-
-
- <html><head/><body><p>Remove selected edge from list above.</p></body></html>
-
-
-
-
-
-
- :/icons/list-remove.svg:/icons/list-remove.svg
-
-
-
-
-
-
-
-
-
- -
-
-
- Positive Y
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- false
-
-
-
-
-
-
-
-
-
- :/icons/button_up.svg
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- <html><head/><body><p>Size of extension for each edge.</p></body></html>
-
-
-
- -
-
-
- <html><head/><body><p>List of edges to be extended.</p></body></html>
-
-
-
- -
-
-
-
-
-
-
- <html><head/><body><p>Add selected edge from 3d view to list.</p></body></html>
-
-
-
-
-
-
- :/icons/list-add.svg:/icons/list-add.svg
-
-
-
- -
-
-
- <html><head/><body><p>Remove selected edge from list above.</p></body></html>
-
-
-
-
-
-
- :/icons/list-remove.svg:/icons/list-remove.svg
-
-
-
-
-
-
-
-
-
- -
-
-
- Positive X
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
-
-
-
-
-
-
- :/icons/button_right.svg
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- <html><head/><body><p>Size of extension for each edge.</p></body></html>
-
-
-
- -
-
-
- <html><head/><body><p>List of edges to be extended.</p></body></html>
-
-
-
- -
-
-
-
-
-
-
- <html><head/><body><p>Add selected edge from 3d view to list.</p></body></html>
-
-
-
-
-
-
- :/icons/list-add.svg:/icons/list-add.svg
-
-
-
- -
-
-
- <html><head/><body><p>Remove selected edge from list above.</p></body></html>
-
-
-
-
-
-
- :/icons/list-remove.svg:/icons/list-remove.svg
-
-
-
-
-
-
-
-
-
- -
-
-
- Negative Y
-
-
-
-
-
-
-
-
-
- :/icons/button_down.svg
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- <html><head/><body><p>Size of extension for each edge.</p></body></html>
-
-
-
- -
-
-
- <html><head/><body><p>List of edges to be extended.</p></body></html>
-
-
-
- -
-
-
-
-
-
-
- <html><head/><body><p>Add selected edge from 3d view to list.</p></body></html>
-
-
-
-
-
-
- :/icons/list-add.svg:/icons/list-add.svg
-
-
-
- -
-
-
- <html><head/><body><p>Remove selected edge from list above.</p></body></html>
-
-
-
-
-
-
- :/icons/list-remove.svg:/icons/list-remove.svg
-
-
-
-
-
-
-
-
-
- -
-
-
- QFrame::Panel
-
-
- QFrame::Raised
-
-
- Requires "Use Outline"!
-
-
- Qt::AlignCenter
-
-
-
-
-
-
-
- Gui::QuantitySpinBox
- QDoubleSpinBox
-
-
-
-
-
-
-
-
diff --git a/src/Mod/Path/Gui/Resources/panels/PageOpPocketExtEdit.ui b/src/Mod/Path/Gui/Resources/panels/PageOpPocketExtEdit.ui
new file mode 100644
index 0000000000..7cd06c936c
--- /dev/null
+++ b/src/Mod/Path/Gui/Resources/panels/PageOpPocketExtEdit.ui
@@ -0,0 +1,121 @@
+
+
+ Form
+
+
+
+ 0
+ 0
+ 381
+ 552
+
+
+
+ Form
+
+
+ -
+
+
+ QFrame::Panel
+
+
+ QFrame::Raised
+
+
+ Requires "Use Outline" to be enabled!
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+
+ 0
+
+
-
+
+
+
+ QFormLayout::AllNonFixedFieldsGrow
+
+
-
+
+
+ Default Length
+
+
+
+ -
+
+
+ -999999999.000000000000000
+
+
+ 999999999.000000000000000
+
+
+ 1.000000000000000
+
+
+
+
+
+
+ -
+
+
+
+ Feature
+
+
+
+
+ Length
+
+
+
+
+ Direction
+
+
+
+
+ -
+
+
+
-
+
+
+ Add
+
+
+
+ -
+
+
+ Remove
+
+
+
+ -
+
+
+ Clear
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Mod/Path/PathScripts/PathPocketShapeGui.py b/src/Mod/Path/PathScripts/PathPocketShapeGui.py
index e1a17a5a81..661942eb0f 100644
--- a/src/Mod/Path/PathScripts/PathPocketShapeGui.py
+++ b/src/Mod/Path/PathScripts/PathPocketShapeGui.py
@@ -24,10 +24,12 @@
import FreeCAD
import FreeCADGui
+import PathScripts.PathLog as PathLog
import PathScripts.PathOp as PathOp
import PathScripts.PathOpGui as PathOpGui
import PathScripts.PathPocketShape as PathPocketShape
import PathScripts.PathPocketBaseGui as PathPocketBaseGui
+import PathScripts.PathUtil as PathUtil
from PySide import QtCore, QtGui
@@ -36,29 +38,72 @@ __author__ = "sliptonic (Brad Collette)"
__url__ = "http://www.freecadweb.org"
__doc__ = "Pocket Shape operation page controller and command implementation."
+
+if True:
+ PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
+ PathLog.trackModule(PathLog.thisModule())
+else:
+ PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
+
+
class TaskPanelExtensionPage(PathOpGui.TaskPanelPage):
def initPage(self, obj):
- self.extensions = [self.form.negXInput, self.form.posXInput, self.form.negYInput, self.form.posYInput]
self.setTitle("Pocket Extensions")
self.enabled = True
self.enable(False)
+ tc = PathUtil.toolControllerForOp(self.obj)
+ if tc:
+ self.form.defaultLength.setValue(tc.Tool.Diameter/2)
def enable(self, ena):
if ena != self.enabled:
self.enabled = ena
if ena:
self.form.info.hide()
- for ext in self.extensions:
- ext.setEnabled(True)
+ self.form.extensionEdit.setEnabled(True)
else:
self.form.info.show()
- for ext in self.extensions:
- ext.setEnabled(False)
+ self.form.extensionEdit.setEnabled(False)
def getForm(self):
- return FreeCADGui.PySideUic.loadUi(":/panels/PageOpExtensionEdit.ui")
+ return FreeCADGui.PySideUic.loadUi(":/panels/PageOpPocketExtEdit.ui")
+ def updateSelection(self, obj, sel):
+ PathLog.track(sel)
+ if sel and sel[0].SubElementNames:
+ self.form.buttonAdd.setEnabled(True)
+ else:
+ self.form.buttonAdd.setEnabled(False)
+
+ def currentItemChanged(self, now, prev):
+ if 0 == self.form.extensions.rowCount():
+ self.form.buttonClear.setEnabled(False)
+ self.form.buttonRemove.setEnabled(False)
+ else:
+ self.form.buttonClear.setEnabled(True)
+ if self.form.extensions.selectedItems():
+ self.form.buttonRemove.setEnabled(True)
+ else:
+ self.form.buttonRemove.setEnabled(False)
+
+ def extensionsAdd(self):
+ pass
+
+ def extensionsClear(self):
+ self.form.extensions.clearContents()
+
+ def extensionsRemove(self):
+ pass
+
+ def pageRegisterSignalHandlers(self):
+ self.form.extensions.currentItemChanged.connect(self.currentItemChanged)
+ self.form.buttonAdd.clicked.connect(self.extensionsAdd)
+ self.form.buttonClear.clicked.connect(self.extensionsClear)
+ self.form.buttonRemove.clicked.connect(self.extensionsRemove)
+
+ self.updateSelection(self.obj, FreeCADGui.Selection.getSelectionEx())
+ self.currentItemChanged(-1, -1)
class TaskPanelOpPage(PathPocketBaseGui.TaskPanelOpPage):
'''Page controller class for Pocket operation'''