import wx
import os
import webbrowser
+import sys
+
from Cura.gui import configBase
from Cura.gui import expertConfig
# allow dropping any file, restrict later
self.SetDropTarget(dropTarget.FileDropTarget(self.OnDropFiles))
+ # TODO: wxWidgets 2.9.4 has a bug when NSView does not register for dragged types when wx drop target is set. It was fixed in 2.9.5
+ if sys.platform.startswith('darwin'):
+ try:
+ import objc
+ nswindow = objc.objc_object(c_void_p=self.MacGetTopLevelWindowRef())
+ view = nswindow.contentView()
+ view.registerForDraggedTypes_([u'NSFilenamesPboardType'])
+ except:
+ pass
+
self.normalModeOnlyItems = []
mruFile = os.path.join(profile.getBasePath(), 'mru_filelist.ini')
self.Bind(wx.EVT_MENU, lambda e: self.scene.showLoadModel(), i)
i = self.fileMenu.Append(-1, _("Save model...\tCTRL+S"))
self.Bind(wx.EVT_MENU, lambda e: self.scene.showSaveModel(), i)
+ i = self.fileMenu.Append(-1, _("Reload platform\tF5"))
+ self.Bind(wx.EVT_MENU, lambda e: self.scene.reloadScene(e), i)
i = self.fileMenu.Append(-1, _("Clear platform"))
self.Bind(wx.EVT_MENU, lambda e: self.scene.OnDeleteAll(e), i)
if int(profile.getMachineSetting('extruder_amount')) < 2:
self.headOffsetWizardMenuItem.Enable(False)
self.scene.updateProfileToControls()
+ self.scene._scene.pushFree()
def onOneAtATimeSwitch(self, e):
profile.putPreference('oneAtATime', self.oneAtATime.IsChecked())
if self.oneAtATime.IsChecked() and profile.getMachineSettingFloat('extruder_head_size_height') < 1:
wx.MessageBox(_('For "One at a time" printing, you need to have entered the correct head size and gantry height in the machine settings'), _('One at a time warning'), wx.OK | wx.ICON_WARNING)
self.scene.updateProfileToControls()
+ self.scene._scene.pushFree()
self.scene.sceneUpdated()
def OnPreferences(self, e):