__copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License"
import wx
+import os
from Cura.gui import configWizard
from Cura.gui import configBase
configBase.TitleRow(right, 'SD Card settings')
configBase.SettingRow(right, 'auto_detect_sd')
configBase.SettingRow(right, 'sdcard_rootfolder')
-
+ #same as the expert settings button.
+ self.browseButton = wx.Button(right, -1, '...', style=wx.BU_EXACTFIT)
+ self.browseButton.SetFont(wx.Font(wx.SystemSettings.GetFont(wx.SYS_ANSI_VAR_FONT).GetPointSize() * 0.8, wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.FONTWEIGHT_NORMAL))
+ self.browseButton.Bind(wx.EVT_BUTTON, self.OnBrowseSDRootFolder)
+ right.GetSizer().Add(self.browseButton, (right.GetSizer().GetRows()-1, 2), flag=wx.ALIGN_CENTER_VERTICAL)
+
configBase.TitleRow(right, _("Cura settings"))
configBase.SettingRow(right, 'check_for_updates')
configBase.SettingRow(right, 'submit_slice_information')
#self.parent.reloadSettingPanels()
self.Destroy()
+ def OnBrowseSDRootFolder(self, e):
+ path = profile.getPreference('sdcard_rootfolder')
+ if path == '':
+ path = os.path.expanduser('~/Documents')
+ if not os.path.exists(path):
+ path = ''
+
+ dlg=wx.DirDialog(self, _("Select replication root folder"), path)
+ if dlg.ShowModal() != wx.ID_OK:
+ dlg.Destroy()
+ return
+
+ profile.putPreference('sdcard_rootfolder', dlg.GetPath())
+ dlg.Destroy()
+ self.Close()
+ self.parent.OnPreferences(None)
+
+
+
+
+
+
class machineSettingsDialog(wx.Dialog):
def __init__(self, parent):
super(machineSettingsDialog, self).__init__(None, title=_("Machine settings"))
setting('filament_cost_kg', '0', float, 'preference', 'hidden').setLabel(_("Cost (price/kg)"), _("Cost of your filament per kg, to estimate the cost of the final print."))
setting('filament_cost_meter', '0', float, 'preference', 'hidden').setLabel(_("Cost (price/m)"), _("Cost of your filament per meter, to estimate the cost of the final print."))
setting('auto_detect_sd', 'True', bool, 'preference', 'hidden').setLabel(_("Auto detect SD card drive"), _("Auto detect the SD card. You can disable this because on some systems external hard-drives or USB sticks are detected as SD card."))
-setting('sdcard_rootfolder', '', str, 'preference', 'hidden').setLabel(_("Base folder to replicate on SD card"), _("The specified folder will be used as a base path. Any gcode generated from object coming from within that folder will be automatically saved on the SD card at the same sub-folder. Any object coming from outside of this path will save the gcode on the root folder of the card."))
+
+def _getMyDocumentsFolder():
+ path = os.path.expanduser('~/Documents')
+ if not os.path.exists(path):
+ path = ''
+
+ return path
+
+setting('sdcard_rootfolder', _getMyDocumentsFolder(), str, 'preference', 'hidden').setLabel(_("Base folder to replicate on SD card"), _("The specified folder will be used as a base path. Any gcode generated from object coming from within that folder will be automatically saved on the SD card at the same sub-folder. Any object coming from outside of this path will save the gcode on the root folder of the card."))
setting('check_for_updates', 'True', bool, 'preference', 'hidden').setLabel(_("Check for updates"), _("Check for newer versions of Cura on startup"))
setting('submit_slice_information', 'False', bool, 'preference', 'hidden').setLabel(_("Send usage statistics"), _("Submit anonymous usage information to improve future versions of Cura"))
setting('youmagine_token', '', str, 'preference', 'hidden')