objdictgen/commondialogs.py
changeset 740 b6646a975f23
parent 585 d62424ba12bf
child 748 18ed0f3b030a
equal deleted inserted replaced
739:4faa0bb578e0 740:b6646a975f23
  1242                                "",
  1242                                "",
  1243                                _("EDS files (*.eds)|*.eds|All files|*.*"),
  1243                                _("EDS files (*.eds)|*.eds|All files|*.*"),
  1244                                wx.OPEN)
  1244                                wx.OPEN)
  1245         if dialog.ShowModal() == wx.ID_OK:
  1245         if dialog.ShowModal() == wx.ID_OK:
  1246             filepath = dialog.GetPath()
  1246             filepath = dialog.GetPath()
  1247             if os.path.isfile(filepath):
  1247         else:
  1248                 result = self.NodeList.ImportEDSFile(filepath)
  1248             filepath = ""
  1249                 if result:
       
  1250                     message = wx.MessageDialog(self, _("%s\nWould you like to replace it ?")%result, _("Question"), wx.YES_NO|wx.ICON_QUESTION)
       
  1251                     if message.ShowModal() == wx.ID_YES:
       
  1252                         self.NodeList.ImportEDSFile(filepath, True)
       
  1253                     message.Destroy()
       
  1254         dialog.Destroy()
  1249         dialog.Destroy()
       
  1250         if os.path.isfile(filepath):
       
  1251             result, question = self.NodeList.ImportEDSFile(filepath)
       
  1252             if result is not None and question:
       
  1253                 dialog = wx.MessageDialog(self, _("%s\nWould you like to replace it ?")%result, _("Question"), wx.YES_NO|wx.ICON_QUESTION)
       
  1254                 if dialog.ShowModal() == wx.ID_YES:
       
  1255                     dialog, question = self.NodeList.ImportEDSFile(filepath, True)
       
  1256                 dialog.Destroy()
       
  1257             if result is not None and not question:
       
  1258                 dialog = wx.MessageDialog(self, result, _("Error"), wx.OK|wx.ICON_ERROR)
       
  1259                 dialog.ShowModal()
       
  1260                 dialog.Destroy()
  1255         self.RefreshEDSFile()
  1261         self.RefreshEDSFile()
  1256         event.Skip()
  1262         event.Skip()
  1257 
  1263 
  1258     def RefreshEDSFile(self):
  1264     def RefreshEDSFile(self):
  1259         selection = self.EDSFile.GetStringSelection()
  1265         selection = self.EDSFile.GetStringSelection()