From af9d697844d89da2d5f0db7ea42fb6e2eaa948f1 Mon Sep 17 00:00:00 2001 From: daid303 Date: Wed, 6 Feb 2013 10:44:38 +0100 Subject: [PATCH] Remove the load/prepare/print buttons from the bottom as they are in the 3D window now. Add dual/triple/quad load buttons on the 3D window. --- Cura/cura.py | 2 ++ Cura/gui/mainWindow.py | 33 ++------------------------------- Cura/gui/preview3d.py | 8 ++++++++ 3 files changed, 12 insertions(+), 31 deletions(-) diff --git a/Cura/cura.py b/Cura/cura.py index 07b901c1..8474a661 100644 --- a/Cura/cura.py +++ b/Cura/cura.py @@ -69,6 +69,8 @@ def main(): #Place any unused arguments as last file, so Cura starts with opening those files. if len(args) > 0: profile.putPreference('lastFile', ';'.join(args)) + profile.putProfileSetting('model_matrix', '1,0,0,0,1,0,0,0,1') + profile.setPluginConfig([]) #Do not import anything from Cura.gui before this spot, as the above code also needs to run in pypy. from Cura.gui import app diff --git a/Cura/gui/mainWindow.py b/Cura/gui/mainWindow.py index fe9307c7..47aaef71 100644 --- a/Cura/gui/mainWindow.py +++ b/Cura/gui/mainWindow.py @@ -173,42 +173,13 @@ class mainWindow(wx.Frame): #Preview window self.preview3d = preview3d.previewPanel(self.rightPane) - # load and slice buttons. - loadButton = wx.Button(self.rightPane, -1, '&Load model') - sliceButton = wx.Button(self.rightPane, -1, 'P&repare print') - printButton = wx.Button(self.rightPane, -1, '&Print') - self.Bind(wx.EVT_BUTTON, lambda e: self._showModelLoadDialog(1), loadButton) - self.Bind(wx.EVT_BUTTON, self.OnSlice, sliceButton) - self.Bind(wx.EVT_BUTTON, self.OnPrint, printButton) - - if self.extruderCount > 1: - loadButton2 = wx.Button(self.rightPane, -1, 'Load Dual') - self.Bind(wx.EVT_BUTTON, lambda e: self._showModelLoadDialog(2), loadButton2) - if self.extruderCount > 2: - loadButton3 = wx.Button(self.rightPane, -1, 'Load Triple') - self.Bind(wx.EVT_BUTTON, lambda e: self._showModelLoadDialog(3), loadButton3) - if self.extruderCount > 3: - loadButton4 = wx.Button(self.rightPane, -1, 'Load Quad') - self.Bind(wx.EVT_BUTTON, lambda e: self._showModelLoadDialog(4), loadButton4) - #Also bind double clicking the 3D preview to load an STL file. #self.preview3d.glCanvas.Bind(wx.EVT_LEFT_DCLICK, lambda e: self._showModelLoadDialog(1), self.preview3d.glCanvas) #Main sizer, to position the preview window, buttons and tab control - sizer = wx.GridBagSizer() + sizer = wx.BoxSizer() self.rightPane.SetSizer(sizer) - sizer.Add(self.preview3d, (0,1), span=(1,2+self.extruderCount), flag=wx.EXPAND) - sizer.AddGrowableCol(2 + self.extruderCount) - sizer.AddGrowableRow(0) - sizer.Add(loadButton, (1,1), flag=wx.RIGHT|wx.BOTTOM|wx.TOP, border=5) - if self.extruderCount > 1: - sizer.Add(loadButton2, (1,2), flag=wx.RIGHT|wx.BOTTOM|wx.TOP, border=5) - if self.extruderCount > 2: - sizer.Add(loadButton3, (1,3), flag=wx.RIGHT|wx.BOTTOM|wx.TOP, border=5) - if self.extruderCount > 3: - sizer.Add(loadButton4, (1,4), flag=wx.RIGHT|wx.BOTTOM|wx.TOP, border=5) - sizer.Add(sliceButton, (1,1+self.extruderCount), flag=wx.RIGHT|wx.BOTTOM|wx.TOP, border=5) - sizer.Add(printButton, (1,2+self.extruderCount), flag=wx.RIGHT|wx.BOTTOM|wx.TOP, border=5) + sizer.Add(self.preview3d, 1, flag=wx.EXPAND) # Main window sizer sizer = wx.BoxSizer(wx.VERTICAL) diff --git a/Cura/gui/preview3d.py b/Cura/gui/preview3d.py index f51b2cab..9edc4b66 100644 --- a/Cura/gui/preview3d.py +++ b/Cura/gui/preview3d.py @@ -119,6 +119,14 @@ class previewPanel(wx.Panel): self.sliceButton = openglGui.glButton(self.glCanvas, 6, 'Prepare model', (0,-2), lambda : self.GetParent().GetParent().GetParent().OnSlice(None)) self.printButton = openglGui.glButton(self.glCanvas, 7, 'Print model', (0,-1), lambda : self.GetParent().GetParent().GetParent().OnPrint(None)) + extruderCount = int(profile.getPreference('extruder_amount')) + if extruderCount > 1: + openglGui.glButton(self.glCanvas, 3, 'Load dual model', (1,0), lambda : self.GetParent().GetParent().GetParent()._showModelLoadDialog(2)) + if extruderCount > 2: + openglGui.glButton(self.glCanvas, 3, 'Load triple model', (2,0), lambda : self.GetParent().GetParent().GetParent()._showModelLoadDialog(3)) + if extruderCount > 3: + openglGui.glButton(self.glCanvas, 3, 'Load quad model', (3,0), lambda : self.GetParent().GetParent().GetParent()._showModelLoadDialog(4)) + self.scaleForm = openglGui.glFrame(self.glCanvas, (1, 3)) openglGui.glGuiLayoutGrid(self.scaleForm) openglGui.glLabel(self.scaleForm, 'Scale X', (0,0)) -- 2.30.2