diff -r 4faa0bb578e0 -r b6646a975f23 objdictgen/commondialogs.py --- a/objdictgen/commondialogs.py Wed Jun 13 19:08:58 2012 +0200 +++ b/objdictgen/commondialogs.py Fri Jun 15 18:24:26 2012 +0200 @@ -1244,14 +1244,20 @@ wx.OPEN) if dialog.ShowModal() == wx.ID_OK: filepath = dialog.GetPath() - if os.path.isfile(filepath): - result = self.NodeList.ImportEDSFile(filepath) - if result: - message = wx.MessageDialog(self, _("%s\nWould you like to replace it ?")%result, _("Question"), wx.YES_NO|wx.ICON_QUESTION) - if message.ShowModal() == wx.ID_YES: - self.NodeList.ImportEDSFile(filepath, True) - message.Destroy() + else: + filepath = "" dialog.Destroy() + if os.path.isfile(filepath): + result, question = self.NodeList.ImportEDSFile(filepath) + if result is not None and question: + dialog = wx.MessageDialog(self, _("%s\nWould you like to replace it ?")%result, _("Question"), wx.YES_NO|wx.ICON_QUESTION) + if dialog.ShowModal() == wx.ID_YES: + dialog, question = self.NodeList.ImportEDSFile(filepath, True) + dialog.Destroy() + if result is not None and not question: + dialog = wx.MessageDialog(self, result, _("Error"), wx.OK|wx.ICON_ERROR) + dialog.ShowModal() + dialog.Destroy() self.RefreshEDSFile() event.Skip()