From: John L. <jr...@us...> - 2010-08-25 02:31:21
|
Update of /cvsroot/wxlua/wxLua/samples In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv928/samples Modified Files: editor.wx.lua Log Message: Ask to overwrite the file in Save As dialog. Index: editor.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/editor.wx.lua,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** editor.wx.lua 1 Jun 2009 22:28:30 -0000 1.59 --- editor.wx.lua 25 Aug 2010 02:31:13 -0000 1.60 *************** *** 975,979 **** local filePath = fileDialog:GetPath() ! if SaveFile(editor, filePath) then SetupKeywords(editor, IsLuaFile(filePath)) saved = true --- 975,986 ---- local filePath = fileDialog:GetPath() ! local save_file = true ! ! if wx.wxFileExists(filePath) then ! save_file = (wx.wxYES == wx.wxMessageBox(string.format("Replace file:\n%s", filePath), "wxLua Overwrite File", ! wx.wxYES_NO + wx.wxICON_QUESTION, frame)) ! end ! ! if save_file and SaveFile(editor, filePath) then SetupKeywords(editor, IsLuaFile(filePath)) saved = true |