i = self.fileMenu.Append(-1, _("Save Profile..."))
self.normalModeOnlyItems.append(i)
self.Bind(wx.EVT_MENU, self.OnSaveProfile, i)
+ if version.isDevVersion():
+ i = self.fileMenu.Append(-1, "Save difference from default...")
+ self.normalModeOnlyItems.append(i)
+ self.Bind(wx.EVT_MENU, self.OnSaveDifferences, i)
i = self.fileMenu.Append(-1, _("Load Profile from GCode..."))
self.normalModeOnlyItems.append(i)
self.Bind(wx.EVT_MENU, self.OnLoadProfileFromGcode, i)
i = toolsMenu.Append(-1, _("Auto Firmware Update..."))
self.Bind(wx.EVT_MENU, self.OnAutoFirmwareUpdate, i)
- i = toolsMenu.Append(-1, _("Copy profile to clipboard"))
- self.Bind(wx.EVT_MENU, self.onCopyProfileClipboard,i)
+ #i = toolsMenu.Append(-1, _("Copy profile to clipboard"))
+ #self.Bind(wx.EVT_MENU, self.onCopyProfileClipboard,i)
toolsMenu.AppendSeparator()
self.allAtOnceItem = toolsMenu.Append(-1, _("Print all at once"), kind=wx.ITEM_RADIO)
#Timer set; used to check if profile is on the clipboard
self.timer = wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.onTimer)
- self.timer.Start(1000)
+ #self.timer.Start(1000)
self.lastTriedClipboard = profile.getProfileString()
# Restore the window position, size & state from the preferences file
if Publisher is not None:
Publisher().subscribe(self.onPluginUpdate, "pluginupdate")
+ pluginCount = self.normalSettingsPanel.pluginPanel.GetActivePluginCount()
+ if pluginCount == 1:
+ self.scene.notification.message("Warning: 1 plugin from the previous session is still active.")
+
+ if pluginCount > 1:
+ self.scene.notification.message("Warning: %i plugins from the previous session are still active." % pluginCount)
+
def onPluginUpdate(self,msg): #receives commands from the plugin thread
cmd = str(msg.data).split(";")
if cmd[0] == "OpenPluginProgressWindow":
print "Unable to read from clipboard"
- def updateSliceMode(self):
+ def updateSliceMode(self, changedMode = True):
isSimple = profile.getPreference('startMode') == 'Simple'
self.normalSettingsPanel.Show(not isSimple)
# Set splitter sash position & size
if isSimple:
- # Save normal mode sash
- self.normalSashPos = self.splitter.GetSashPosition()
+ # Save normal mode sash (only if we changed mode from normal
+ # to simple)
+ if changedMode:
+ self.normalSashPos = self.splitter.GetSashPosition()
# Change location of sash to width of quick mode pane
(width, height) = self.simpleSettingsPanel.GetSizer().GetSize()
# Disable sash
self.splitter.SetSashSize(0)
else:
- self.splitter.SetSashPosition(self.normalSashPos, True)
+ # Only change the sash position if we changed mode from simple
+ if changedMode:
+ self.splitter.SetSashPosition(self.normalSashPos, True)
# Enabled sash
self.splitter.SetSashSize(4)
self.defaultFirmwareInstallMenuItem.Enable(firmwareInstall.getDefaultFirmware() is not None)
- if profile.getMachineSetting('machine_type') == 'ultimaker2' or profile.getMachineSetting('machine_type') == 'lulzbot_mini' or profile.getMachineSetting('machine_type') == 'lulzbot_TAZ':
+ if profile.getMachineSetting('machine_type').startswith('ultimaker2') or \
+ profile.getMachineSetting('machine_type').startswith('lulzbot_'):
self.bedLevelWizardMenuItem.Enable(False)
self.headOffsetWizardMenuItem.Enable(False)
else:
prefDialog.Centre()
prefDialog.Show()
prefDialog.Raise()
- wx.CallAfter(prefDialog.Show)
def OnMachineSettings(self, e):
prefDialog = preferencesDialog.machineSettingsDialog(self)
self.normalSettingsPanel.updateProfileToControls()
self.simpleSettingsPanel.updateProfileToControls()
- def reloadSettingPanels(self):
+ def reloadSettingPanels(self, changedSliceMode = False):
self.leftSizer.Detach(self.simpleSettingsPanel)
self.leftSizer.Detach(self.normalSettingsPanel)
self.simpleSettingsPanel.Destroy()
self.normalSettingsPanel = normalSettingsPanel(self.leftPane, lambda : self.scene.sceneUpdated())
self.leftSizer.Add(self.simpleSettingsPanel, 1)
self.leftSizer.Add(self.normalSettingsPanel, 1, wx.EXPAND)
- self.updateSliceMode()
+ self.updateSliceMode(changedSliceMode)
self.updateProfileToAllControls()
def updateMachineMenu(self):
dlg=wx.FileDialog(self, _("Select profile file to save"), os.path.split(profile.getPreference('lastFile'))[0], style=wx.FD_SAVE)
dlg.SetWildcard("ini files (*.ini)|*.ini")
if dlg.ShowModal() == wx.ID_OK:
- profileFile = dlg.GetPath()
- if not profileFile.lower().endswith('.ini'): #hack for linux, as for some reason the .ini is not appended.
- profileFile += '.ini'
- profile.saveProfile(profileFile)
+ profile_filename = dlg.GetPath()
+ if not profile_filename.lower().endswith('.ini'): #hack for linux, as for some reason the .ini is not appended.
+ profile_filename += '.ini'
+ profile.saveProfile(profile_filename)
+ dlg.Destroy()
+
+ def OnSaveDifferences(self, e):
+ dlg=wx.FileDialog(self, _("Select profile file to save"), os.path.split(profile.getPreference('lastFile'))[0], style=wx.FD_SAVE)
+ dlg.SetWildcard("ini files (*.ini)|*.ini")
+ if dlg.ShowModal() == wx.ID_OK:
+ profile_filename = dlg.GetPath()
+ if not profile_filename.lower().endswith('.ini'): #hack for linux, as for some reason the .ini is not appended.
+ profile_filename += '.ini'
+ profile.saveProfileDifferenceFromDefault(profile_filename)
dlg.Destroy()
def OnResetProfile(self, e):
def OnNormalSwitch(self, e):
profile.putPreference('startMode', 'Normal')
+ dlg = wx.MessageDialog(self, _("Copy the settings from quickprint to your full settings?\n(This will overwrite any full setting modifications you have)"), _("Profile copy"), wx.YES_NO | wx.ICON_QUESTION)
+ result = dlg.ShowModal() == wx.ID_YES
+ dlg.Destroy()
+ if result:
+ profile.resetProfile()
+ for k, v in self.simpleSettingsPanel.getSettingOverrides().items():
+ profile.putProfileSetting(k, v)
+ self.updateProfileToAllControls()
self.updateSliceMode()
def OnDefaultMarlinFirmware(self, e):
def OnAddNewMachine(self, e):
self.Hide()
+ wasSimple = profile.getPreference('startMode') == 'Simple'
configWizard.ConfigWizard(True)
+ isSimple = profile.getPreference('startMode') == 'Simple'
self.Show()
- self.reloadSettingPanels()
+ self.reloadSettingPanels(isSimple != wasSimple)
self.updateMachineMenu()
def OnSelectMachine(self, index):
profile.setActiveMachine(index)
- self.reloadSettingPanels()
+ self.reloadSettingPanels(False)
def OnBedLevelWizard(self, e):
configWizard.bedLevelWizard()
wx.MessageBox(_("You are running the latest version of Cura!"), _("Awesome!"), wx.ICON_INFORMATION)
def OnAbout(self, e):
- aboutBox = aboutWindow.aboutWindow()
+ aboutBox = aboutWindow.aboutWindow(self)
aboutBox.Centre()
aboutBox.Show()
+ aboutBox.Raise()
def OnClose(self, e):
profile.saveProfile(profile.getDefaultProfilePath(), True)
#HACK: Set the paint function of the glCanvas to nothing so it won't keep refreshing. Which can keep wxWidgets from quiting.
print "Closing down"
self.scene.OnPaint = lambda e : e
- self.scene._engine.cleanup()
+ self.scene.cleanup()
self.Destroy()
def OnQuit(self, e):