wx.EVT_CLOSE(self, self.OnClose)
- self.SetDropTarget(dropTarget.FileDropTarget(self.OnDropFiles, meshLoader.loadSupportedExtensions() + ['.g', '.gcode']))
+ self.SetDropTarget(dropTarget.FileDropTarget(self.OnDropFiles, meshLoader.loadSupportedExtensions() + ['.g', '.gcode', '.ini']))
self.normalModeOnlyItems = []
# Save normal mode sash
self.normalSashPos = self.splitter.GetSashPosition()
- # Change location of sash to width of quick mode pane
+ # Change location of sash to width of quick mode pane
(width, height) = self.simpleSettingsPanel.GetSizer().GetSize()
self.splitter.SetSashPosition(width, True)
self.config.SetPath("/ProfileMRU")
self.profileFileHistory.Save(self.config)
self.config.Flush()
- # Load Profile
+ # Load Profile
profile.loadProfile(path)
self.updateProfileToAllControls()
self.profileFileHistory.AddFileToHistory(file)
self.config.SetPath("/ProfileMRU")
self.profileFileHistory.Save(self.config)
- self.config.Flush()
+ self.config.Flush()
def updateProfileToAllControls(self):
self.scene.updateProfileToControls()
def OnSize(self, e):
# Make the size of the Notebook control the same size as this control
self.nb.SetSize(self.GetSize())
-
+
# Propegate the OnSize() event (just in case)
e.Skip()
-
+
# Perform out resize magic
self.UpdateSize(self.printPanel)
self.UpdateSize(self.advancedPanel)
-
+
def UpdateSize(self, configPanel):
sizer = configPanel.GetSizer()
-
+
# Pseudocde
# if horizontal:
# if width(col1) < best_width(col1) || width(col2) < best_width(col2):
# if width(col1) > (best_width(col1) + best_width(col1)):
# switch to horizontal
#
-
+
col1 = configPanel.leftPanel
colSize1 = col1.GetSize()
colBestSize1 = col1.GetBestSize()
colBestSize2 = col2.GetBestSize()
orientation = sizer.GetOrientation()
-
+
if orientation == wx.HORIZONTAL:
if (colSize1[0] <= colBestSize1[0]) or (colSize2[0] <= colBestSize2[0]):
configPanel.Freeze()
def loadFiles(self, filenames):
gcodeFilename = None
for filename in filenames:
- self.GetParent().GetParent().GetParent().addToModelMRU(filename)
+ self.GetParent().GetParent().GetParent().addToModelMRU(filename) #??? only Model files?
ext = filename[filename.rfind('.')+1:].upper()
if ext == 'G' or ext == 'GCODE':
gcodeFilename = filename
if gcodeFilename is not None:
self.loadGCodeFile(gcodeFilename)
else:
- self.loadSceneFiles(filenames)
+ profileFilename = None
+ for filename in filenames:
+ ext = filename[filename.rfind('.')+1:].upper()
+ if ext == 'INI':
+ profileFilename = filename
+ if profileFilename is not None:
+ profile.loadProfile(profileFilename)
+ self.GetParent().GetParent().GetParent().updateProfileToAllControls()
+ else:
+ self.loadSceneFiles(filenames)
def showLoadModel(self, button = 1):
if button == 1: