Changed default filename to empty string
When trying to save a new file it opens the save-as dialog
This commit is contained in:
parent
b386274738
commit
53de782d3c
@ -60,7 +60,7 @@ class MainWindow(wx.Frame):
|
|||||||
|
|
||||||
MainInitOnce()
|
MainInitOnce()
|
||||||
|
|
||||||
self.filename = 'noname.spdl'
|
self.filename = ''
|
||||||
self.filepath = ""
|
self.filepath = ""
|
||||||
|
|
||||||
self.load = False
|
self.load = False
|
||||||
@ -268,11 +268,14 @@ class MainWindow(wx.Frame):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def OnSave(self, event):
|
def OnSave(self, event):
|
||||||
textfile = open(os.path.join(self.dirname, self.filename), 'w')
|
if self.filename=='':
|
||||||
textfile.write(self.editor.GetText())
|
return self.OnSaveAs(event)
|
||||||
textfile.close()
|
else:
|
||||||
self.editor.SetSaved()
|
textfile = open(os.path.join(self.dirname, self.filename), 'w')
|
||||||
return True
|
textfile.write(self.editor.GetText())
|
||||||
|
textfile.close()
|
||||||
|
self.editor.SetSaved()
|
||||||
|
return True
|
||||||
|
|
||||||
def OnOpen(self, event):
|
def OnOpen(self, event):
|
||||||
if self.ConfirmLoss("Open"):
|
if self.ConfirmLoss("Open"):
|
||||||
|
Loading…
Reference in New Issue
Block a user