chiark / gitweb /
Add some more missing strings to the translations.
[cura.git] / Cura / gui / sceneView.py
index 0618ca1c0badf25355854756828457b2e496ae56..c1367ff1e050ce8824b4bb25ba718a2f06320bbb 100644 (file)
@@ -151,7 +151,7 @@ class SceneView(openglGui.glGuiPanel):
                gcodeFilename = None
                if len(filenames) == 1:
                        filename = filenames[0]
-                       ext = filename[filename.rfind('.'):].lower()
+                       ext = os.path.splitext(filename)[1].lower()
                        if ext == '.g' or ext == '.gcode':
                                gcodeFilename = filename
                                mainWindow.addToModelMRU(filename)
@@ -170,7 +170,7 @@ class SceneView(openglGui.glGuiPanel):
                                        # directory: queue all included files and directories
                                        filenames.extend(os.path.join(filename, f) for f in os.listdir(filename))
                                else:
-                                       ext = filename[filename.rfind('.'):].lower()
+                                       ext = os.path.splitext(filename)[1].lower()
                                        if ext == '.ini':
                                                profile.loadProfile(filename)
                                                mainWindow.addToProfileMRU(filename)
@@ -254,10 +254,9 @@ class SceneView(openglGui.glGuiPanel):
                        self._slicer.submitSliceInfoOnline()
 
        def showSaveGCode(self):
-               defPath = profile.getPreference('lastFile')
-               defPath = defPath[0:defPath.rfind('.')] + '.gcode'
-               dlg=wx.FileDialog(self, _("Save toolpath"), defPath, style=wx.FD_SAVE)
-               dlg.SetFilename(self._scene._objectList[0].getName())
+               dlg=wx.FileDialog(self, _("Save toolpath"), os.path.dirname(profile.getPreference('lastFile')), style=wx.FD_SAVE)
+               filename = self._scene._objectList[0].getName() + '.gcode'
+               dlg.SetFilename(filename)
                dlg.SetWildcard('Toolpath (*.gcode)|*.gcode;*.g')
                if dlg.ShowModal() != wx.ID_OK:
                        dlg.Destroy()
@@ -420,7 +419,7 @@ class SceneView(openglGui.glGuiPanel):
                if self._focusObj is None:
                        return
                obj = self._focusObj
-               dlg = wx.NumberEntryDialog(self, "How many copies do you want?", "Copies", "Multiply", 1, 1, 100)
+               dlg = wx.NumberEntryDialog(self, _("How many copies do you want?"), _("Number of copies"), _("Multiply"), 1, 1, 100)
                if dlg.ShowModal() != wx.ID_OK:
                        dlg.Destroy()
                        return