Added button to stock dialog to recreate the stock object.

This commit is contained in:
markus
2018-08-22 13:17:13 -07:00
committed by wmayer
parent 5b39974bfb
commit 8054540afe
3 changed files with 51 additions and 27 deletions

View File

@@ -14,7 +14,7 @@
<string>Job Edit</string>
</property>
<property name="currentIndex">
<number>0</number>
<number>2</number>
</property>
<widget class="QWidget" name="tabGeneral">
<attribute name="title">
@@ -146,30 +146,49 @@
<number>0</number>
</property>
<item>
<widget class="QComboBox" name="stock">
<property name="currentIndex">
<number>2</number>
</property>
<item>
<property name="text">
<string>Create Box</string>
</property>
</item>
<item>
<property name="text">
<string>Create Cylinder</string>
</property>
</item>
<item>
<property name="text">
<string>Extend Model's Bound Box</string>
</property>
</item>
<item>
<property name="text">
<string>Use Existing Solid</string>
</property>
</item>
<widget class="QWidget" name="widget_2" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QComboBox" name="stock">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>2</number>
</property>
<item>
<property name="text">
<string>Create Box</string>
</property>
</item>
<item>
<property name="text">
<string>Create Cylinder</string>
</property>
</item>
<item>
<property name="text">
<string>Extend Model's Bound Box</string>
</property>
</item>
<item>
<property name="text">
<string>Use Existing Solid</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QPushButton" name="updateStock">
<property name="text">
<string>New</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
@@ -632,7 +651,6 @@
<tabstop>postProcessorSetOutputFile</tabstop>
<tabstop>postProcessor</tabstop>
<tabstop>postProcessorArguments</tabstop>
<tabstop>stock</tabstop>
<tabstop>stockExisting</tabstop>
<tabstop>stockExtXneg</tabstop>
<tabstop>stockExtXpos</tabstop>

View File

@@ -900,6 +900,9 @@ class TaskPanel:
PathLog.error(translate('PathJob', "Unsupported stock type %s (%d)") % (self.form.stock.currentText(), index))
self.stockEdit.activate(self.obj, index == -1)
def updateStock(self):
self.updateStockEditor(self.form.stock.currentIndex())
def centerInStock(self):
bbb = self.obj.Base.Shape.BoundBox
bbs = self.obj.Stock.Shape.BoundBox
@@ -982,6 +985,7 @@ class TaskPanel:
self.form.centerInStockXY.clicked.connect(self.centerInStockXY)
self.form.stock.currentIndexChanged.connect(self.updateStockEditor)
self.form.updateStock.clicked.connect(self.updateStock)
self.form.orientXAxis.clicked.connect(lambda: self.orientSelected(FreeCAD.Vector(1, 0, 0)))
self.form.orientYAxis.clicked.connect(lambda: self.orientSelected(FreeCAD.Vector(0, 1, 0)))

View File

@@ -31,9 +31,11 @@ import math
from PySide import QtCore
if True:
if False:
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
PathLog.trackModule(PathLog.thisModule())
else:
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
# Qt tanslation handling
def translate(context, text, disambig=None):