chiark / gitweb /
Merge tag '15.02.1' into upstream
[cura.git] / Cura / gui / mainWindow.py
index 6fb06a62e61ce4692b8d44430ad725a4a0d113e7..fbab3ac25ca6561221dc71b7af06c245857a7388 100644 (file)
@@ -93,6 +93,10 @@ class mainWindow(wx.Frame):
                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)
@@ -142,8 +146,8 @@ class mainWindow(wx.Frame):
                        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)
@@ -241,7 +245,7 @@ class mainWindow(wx.Frame):
                #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
@@ -281,6 +285,13 @@ class mainWindow(wx.Frame):
                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":
@@ -369,7 +380,8 @@ class mainWindow(wx.Frame):
                        # 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:
@@ -519,10 +531,20 @@ class mainWindow(wx.Frame):
                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):
@@ -539,6 +561,14 @@ class mainWindow(wx.Frame):
 
        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):