From f24ca6246a70a19898946e7334dbda438927fa4e Mon Sep 17 00:00:00 2001 From: Max Voss Date: Thu, 7 Sep 2017 12:06:09 +0200 Subject: [PATCH] Outline previews get now created when the button is pushed, not when the tool is loaded. --- src/Mod/Ship/shipOutlineDraw/TaskPanel.py | 26 ++++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/Mod/Ship/shipOutlineDraw/TaskPanel.py b/src/Mod/Ship/shipOutlineDraw/TaskPanel.py index a359b900e7..a407cee092 100644 --- a/src/Mod/Ship/shipOutlineDraw/TaskPanel.py +++ b/src/Mod/Ship/shipOutlineDraw/TaskPanel.py @@ -131,13 +131,14 @@ class TaskPanel: if self.initValues(): return True self.retranslateUi() - self.obj = self.preview.update(self.ship.Length.getValueAs('m').Value, - self.ship.Breadth.getValueAs('m').Value, - self.ship.Draft.getValueAs('m').Value, - self.LSections, - self.BSections, - self.TSections, - self.ship.Shape) + #don't do that here. + #self.obj = self.preview.update(self.ship.Length.getValueAs('m').Value, + # self.ship.Breadth.getValueAs('m').Value, + # self.ship.Draft.getValueAs('m').Value, + # self.LSections, + # self.BSections, + # self.TSections, + # self.ship.Shape) # Connect Signals and Slots QtCore.QObject.connect( form.sectionType, @@ -155,7 +156,15 @@ class TaskPanel: form.createButton, QtCore.SIGNAL("pressed()"), self.onCreateButton) - + + def createPreview(self): + self.obj = self.preview.update(self.ship.Length.getValueAs('m').Value, + self.ship.Breadth.getValueAs('m').Value, + self.ship.Draft.getValueAs('m').Value, + self.LSections, + self.BSections, + self.TSections, + self.ship.Shape) def getMainWindow(self): toplevel = QtGui.qApp.topLevelWidgets() for i in toplevel: @@ -434,6 +443,7 @@ class TaskPanel: elif ID == 2: self.TSections = SectionList[:] self.setSectionType(ID) + self.createPreview() def loadSections(self): """ Loads from the ship object all the previously selected sections.